Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename cli to kit, package to kitops #28

Merged
merged 4 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,29 @@ jobs:
version="nightly"
gitCommit=$(git rev-parse HEAD)
buildTime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
binName="jmm-$GOOS-$GOARCH"
binName="kit-$GOOS-$GOARCH"
if [ $GOOS == "windows" ]; then
binName="${binName}.exe"
fi
go build -o "$binName" \
-ldflags="-s -w -X 'jmm/pkg/cmd/version.Version=${version}' -X 'jmm/pkg/cmd/version.GitCommit=${gitCommit}' -X 'jmm/pkg/cmd/version.BuildTime=${buildTime}'"
-ldflags="-s -w -X 'kit/pkg/cmd/version.Version=${version}' -X 'kit/pkg/cmd/version.GitCommit=${gitCommit}' -X 'kit/pkg/cmd/version.BuildTime=${buildTime}'"

- name: Generate archive
run: |
if [ $GOOS == "windows" ]; then
zip -9 -y -r -q "jmm-${GOOS}-${GOARCH}.zip" "jmm-${GOOS}-${GOARCH}.exe"
zip -9 -y -r -q "kit-${GOOS}-${GOARCH}.zip" "kit-${GOOS}-${GOARCH}.exe"
else
tar -czvf "jmm-${GOOS}-${GOARCH}.tar.gz" "jmm-${GOOS}-${GOARCH}"
tar -czvf "kit-${GOOS}-${GOARCH}.tar.gz" "kit-${GOOS}-${GOARCH}"
fi


- name: Upload artifacts
uses: WebFreak001/[email protected]
with:
upload_url: https://uploads.github.com/repos/jozu-ai/jmm/releases/140709733/assets{?name,label}",
upload_url: https://uploads.github.com/repos/jozu-ai/kitops/releases/140709733/assets{?name,label}",
release_id: 140709733
asset_path: jmm-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.archive_ext }}
asset_name: jmm-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.archive_ext }}
asset_path: kit-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.archive_ext }}
asset_name: kit-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.archive_ext }}
asset_content_type: application/zip
max_releases: 2

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.DS_Store
.jozuStore/**
.vscode
jmm
kit
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# JMM - Jozu Model Manager
# Kit


## Description

JMM is a command-line interface (CLI) tool designed to simplify the packaging, versioning, and distribution of AI/ML models as OCI (Open Container Initiative) artifacts. By leveraging the familiar workflow of containerization platforms like Docker, JMM enables data scientists and AI developers to encapsulate their models along with all necessary dependencies, configurations, and environments into a standardized, portable format. This facilitates easy sharing and deployment across diverse computing environments, ensuring that models are readily usable without compatibility issues. JMM supports a wide range of AI/ML frameworks, offers robust version control for model iterations, integrates security practices for safe distribution, and provides a seamless connection to model repositories for storing and retrieving models. With JMM, the aim is to streamline the end-to-end lifecycle of AI/ML model management, making it as effortless as managing containerized applications.
`kit` is a command-line interface (CLI) tool designed to simplify the packaging, versioning, and distribution of AI/ML models as OCI (Open Container Initiative) artifacts. By leveraging the familiar workflow of containerization platforms like Docker, `kit` enables data scientists and AI developers to encapsulate their models along with all necessary dependencies, configurations, and environments into a standardized, portable format. This facilitates easy sharing and deployment across diverse computing environments, ensuring that models are readily usable without compatibility issues. `kit` supports a wide range of AI/ML frameworks, offers robust version control for model iterations, integrates security practices for safe distribution, and provides a seamless connection to model repositories for storing and retrieving models. With `kit`, the aim is to streamline the end-to-end lifecycle of AI/ML model management, making it as effortless as managing containerized applications.

## Table of Contents

Expand All @@ -15,19 +15,19 @@ JMM is a command-line interface (CLI) tool designed to simplify the packaging, v
## Build the project

```shell
go build
go build -o kit
```

## Run the project

```shell
./jmm
./kit
```

Alternatively

```shell
go run jmm
go run kit
```

## Contributing
Expand Down
26 changes: 13 additions & 13 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Copyright © 2024 Jozu.com
package cmd

import (
"jmm/pkg/cmd/build"
"jmm/pkg/cmd/export"
"jmm/pkg/cmd/login"
"jmm/pkg/cmd/models"
"jmm/pkg/cmd/pull"
"jmm/pkg/cmd/push"
"jmm/pkg/cmd/version"
"kitops/pkg/cmd/build"
"kitops/pkg/cmd/export"
"kitops/pkg/cmd/list"
"kitops/pkg/cmd/login"
"kitops/pkg/cmd/pull"
"kitops/pkg/cmd/push"
"kitops/pkg/cmd/version"
"os"
"os/user"
"path/filepath"
Expand All @@ -30,8 +30,8 @@ type (
)

var (
shortDesc = `Jozu Model Manager`
longDesc = `Jozu Model Manager is a tool to manage AI and ML models`
shortDesc = `KitOps model manager`
longDesc = `KitOps is a tool to manage AI and ML models`
)

// rootCmd represents the base command when called without any subcommands
Expand All @@ -42,15 +42,15 @@ func init() {
rootCmd.AddCommand(login.NewCmdLogin())
rootCmd.AddCommand(pull.PullCommand())
rootCmd.AddCommand(push.PushCommand())
rootCmd.AddCommand(models.ModelsCommand())
rootCmd.AddCommand(list.ListCommand())
rootCmd.AddCommand(export.ExportCommand())
rootCmd.AddCommand(version.NewCmdVersion())
}

func newRootCmd() *cobra.Command {
flags := &RootFlags{}
cmd := &cobra.Command{
Use: "jmm",
Use: "kit",
Short: shortDesc,
Long: longDesc,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
Expand All @@ -69,7 +69,7 @@ func newRootCmd() *cobra.Command {
}

func (f *RootFlags) addFlags(cmd *cobra.Command) {
cmd.PersistentFlags().StringVar(&f.ConfigHome, "config", "", "config file (default is $HOME/.jozu)")
cmd.PersistentFlags().StringVar(&f.ConfigHome, "config", "", "config file (default is $HOME/.kitops)")
viper.BindPFlag("config", cmd.PersistentFlags().Lookup("config"))
}

Expand All @@ -85,7 +85,7 @@ func (o *RootOptions) Complete() error {
if err != nil {
return err
}
configpath := filepath.Join(currentUser.HomeDir, ".jozu")
configpath := filepath.Join(currentUser.HomeDir, ".kitops")
viper.Set("config", configpath)
o.ConfigHome = configpath
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func TestRootCmd(t *testing.T) {

err = o.Complete()
assert.NoError(t, err)
assert.Equal(t, filepath.Join(currentUser.HomeDir, ".jozu"), o.ConfigHome)
assert.Equal(t, filepath.Join(currentUser.HomeDir, ".jozu"), viper.GetString("config"))
assert.Equal(t, filepath.Join(currentUser.HomeDir, ".kitops"), o.ConfigHome)
assert.Equal(t, filepath.Join(currentUser.HomeDir, ".kitops"), viper.GetString("config"))

})
})
Expand Down
6 changes: 3 additions & 3 deletions demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Follow these steps to run the demo scripts successfully:
2. **Navigate to the Demo Directory:** Change your current working directory to the demo's directory by using the `cd` command followed by the path to the directory. For example:

```shell
cd jmm/demo/
cd kitops/demo/
```


3. **Download the CLI Version:** Obtain the version of the Command Line Interface (CLI) tool that is required for the demo. You can get the [nightly](https://github.com/jozu-ai/jmm/releases/tag/nightly) builds. Once downloaded, move the CLI tool into the demo directory.Rename the CLI and remove any platform specifications from the name. Ensure that the CLI tool has the correct permissions to be executed. If necessary, you can change the permissions by running:
3. **Download the CLI Version:** Obtain the version of the Command Line Interface (CLI) tool that is required for the demo. You can get the [nightly](https://github.com/jozu-ai/kitops/releases/tag/nightly) builds. Once downloaded, move the CLI tool into the demo directory.Rename the CLI and remove any platform specifications from the name. Ensure that the CLI tool has the correct permissions to be executed. If necessary, you can change the permissions by running:

```shell
chmod +x ./jmm
chmod +x ./kitops
```
4. **Run the Demo Script:** Execute the demo script by typing the name of the demo you want to execute to your terminal:

Expand Down
34 changes: 17 additions & 17 deletions demos/sprint-24w6-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,36 @@ fi
clear


pe "./jmm version"
pe "./kit version"

# Let's check if there are any models locally
pe "./jmm models"
# Let's check if there are any model kits locally
pe "./kit list"

# clean the local models and check again
pe "rm -rf ~/.jozu"
pe "./jmm models"
# clean the local model kits and check again
pe "rm -rf ~/.kitops"
pe "./kit list"

pe "./jmm build --help"
pe "./kit build --help"

# Let's build the onnx model
pe "./jmm build ../examples/onnx -t localhost:5050/test-repo:test-tag"
pe "./kit build ../examples/onnx -t localhost:5050/test-repo:test-tag"

# Let's check if the model is built
pe "./jmm models"
# Let's check if the model kit is built
pe "./kit list"

# run a local registry
pe "$DOCKER run --name registry --rm -d -p 5050:5050 -e REGISTRY_HTTP_ADDR=:5050 registry"

# Let's push the model to the local registry
pe "./jmm push localhost:5050/test-repo:test-tag --http"
pe "./kit push localhost:5050/test-repo:test-tag --http"
# Let's check if the model is pushed
pe "./jmm models localhost:5050/test-repo --http"
pe "./kit list localhost:5050/test-repo --http"
# clean the local models and check again
pe "rm -rf ~/.jozu"
pe "./jmm models"
pe "rm -rf ~/.kitops"
pe "./kit list"

# Let's pull the model to the local registry
pe "./jmm pull localhost:5050/test-repo:test-tag --http"
# Let's pull the model kit to the local registry
pe "./kit pull localhost:5050/test-repo:test-tag --http"

pe "./jmm models"
pe "./kit list"

4 changes: 2 additions & 2 deletions docs/src/docs/cli/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ These flags run next to a command.

### Example

`./kit models --help`
`./kit list --help`

or

`./kit models -h`
`./kit list -h`
6 changes: 3 additions & 3 deletions docs/src/docs/cli/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Available Commands:
| `completion` | Generate the autocompletion script for the specified shell |
| `help` | Help about any command |
| `login` | A brief description of your command |
| `models` | List models |
| `list` | List model kits |
| `pull` | Pull model from registry |
| `push` | Push model to registry |
| `version` | Display the version information for kit |

## Example

To list your available models you can do:
To list your available model kits you can do:

```sh
$ ./kit models
$ ./kit list
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module jmm
module kitops

go 1.21.6

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright © 2024 Jozu.com
*/
package main

import "jmm/cmd"
import "kitops/cmd"

func main() {
cmd.Execute()
Expand Down
11 changes: 5 additions & 6 deletions pkg/artifact/jozu_file.go → pkg/artifact/kit-file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type (
JozuFile struct {
KitFile struct {
ManifestVersion string `json:"manifestVersion"`
Package Package `json:"package,omitempty"`
Code []Code `json:"code,omitempty"`
Expand Down Expand Up @@ -61,22 +61,21 @@ type (
}
)

func (jf *JozuFile) LoadModel(file *os.File) error {
func (kf *KitFile) LoadModel(file *os.File) error {
// Read the file
data, err := io.ReadAll(file)
if err != nil {
return err
}
err = yaml.Unmarshal(data, jf)
err = yaml.Unmarshal(data, kf)
if err != nil {
return err
}
return nil
}

func (jf *JozuFile) MarshalToJSON() ([]byte, error) {
// Marshal the JozuFile to JSON
jsonData, err := json.Marshal(jf)
func (kf *KitFile) MarshalToJSON() ([]byte, error) {
jsonData, err := json.Marshal(kf)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/build/jozu-file.md → pkg/artifact/kit-file.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Jozu AI/ML Packaging Manifest Format Reference
# KitOps AI/ML Packaging Manifest Format Reference

The Jozu manifest for AI/ML is a YAML file designed to encapsulate all the necessary information about the package, including code, datasets, models, and their metadata. This reference documentation outlines the structure and specifications of the manifest format.
The Kit manifest for AI/ML is a YAML file designed to encapsulate all the necessary information about the package, including code, datasets, models, and their metadata. This reference documentation outlines the structure and specifications of the manifest format.

## Overview

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/artifact/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package artifact
type Model struct {
Repository string
Layers []ModelLayer
Config *JozuFile
Config *KitFile
}
2 changes: 1 addition & 1 deletion pkg/artifact/spec.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Jozu Model Specification v0.1
# Kit Model Specification v0.1

A *model package* is an ordered collection AI/ML artifacts and the corresponding execution and training parameters. This specification outlines the format of these artifacts and corresponding parameters and describes how to create and use them.

Expand Down
Loading