kit Commands
These functions provide programmatic access to the KitOps Command-Line Interface.
Available commands include:
info()inspect()list()login()logout()pack()pull()push()remove()tag()unpack()version()
You can import them all from kitops.cli.kit
import kitops.cli.kit as kit
Retrieve information about a kit repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_with_tag
|
str
|
The path to the repository along with the tag. |
required |
filters
|
Optional[List[str]]
|
A list of kitfile parts for which to retrieve information. Defaults to None. |
None
|
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> info("jozu.ml/brett/titanic-survivability:latest")
# Returns information from the local registry about the
# "titanic-survivability:latest" ModelKit.
Source code in kitops/cli/kit.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
Inspect a repository using the 'kit' command.
Parameters: repo_path_with_tag (str): The path to the repository along with the tag. remote (Optional[bool]): Flag to indicate if the inspection should be done remotely. Defaults to True. Otherwise, the inspection will be done locally. **kwargs: Additional arguments to pass to the command.
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
Lists the ModelKits available in the specified repository path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_without_tag
|
Optional[str]
|
The path to the repository without the tag. If not provided, lists kits from the local registry. |
None
|
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
Logs in to the specified registry using the provided username and password.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user
|
str
|
The username for the registry. |
required |
passwd
|
str
|
The password for the registry. |
required |
registry
|
str
|
The registry URL. Defaults to "jozu.ml". |
'jozu.ml'
|
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
Logs out from the specified registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry
|
str
|
The registry to log out from. Defaults to "jozu.ml". |
'jozu.ml'
|
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
Packs the current directory into a ModelKit package with a specified tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_with_tag
|
str
|
The repository path along with the tag to be used for the package. |
required |
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
Pulls the specified ModelKit from the remote registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_with_tag
|
str
|
The path to the repository along with the tag to pull. |
required |
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
Pushes the specified ModelKit to the remote registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_with_tag
|
str
|
The path to the repository along with the tag to be pushed. |
required |
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
Remove a ModelKit from the registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_with_tag
|
str
|
The path to the repository with its tag. |
required |
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
Tag a ModelKit with a new tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_with_tag
|
str
|
The path to the repository with its tag. |
required |
repo_path_with_new_tag
|
str
|
The new tag to be assigned to the ModelKit. |
required |
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Raises:
| Type | Description |
|---|---|
CalledProcessError
|
If the command returns a non-zero exit status |
Examples:
>>> tag("jozu.ml/brett/titanic-survivability:latest",
"jozu.ml/brett/titanic-survivability:v2")
Source code in kitops/cli/kit.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
Unpacks a ModelKit to the specified directory from the remote registry.
This function constructs a command to unpack a ModelKit and calls an internal function to execute the command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path_with_tag
|
str
|
The path to the repository along with the tag to be unpacked. |
required |
dir
|
str
|
The directory to unpack the ModelKit to. |
required |
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
Lists the version of the KitOps Command-line Interface (CLI).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Additional arguments to pass to the command. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in kitops/cli/kit.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 | |