Workers subcommands
The arkindex worker
command contains two subcommands to help you add new workers and worker versions to Arkindex:
import
-
Imports workers using the newer worker configuration format, with one worker per file. The command will look for files within the
arkindex/
directory with.yml
or.yaml
file extensions. publish
-
Uses an older configuration format, with multiple workers stored in one YAML file,
.arkindex.yml
. The file is expected to be found within the current working directory.
Both commands will create new worker versions on Arkindex for all workers defined in the configuration files. If a worker version already exists for this revision, both commands may update its tag
and branch
. The worker for each worker version may also be created or updated.
Both commands accept the same arguments, described below.
Usage
arkindex worker import registry.gitlab.example.com/my_group/my_worker:0.4.2
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2
The only required argument is a Docker image reference for the new worker version.
The worker’s information (configuration, slug, GPU and model usage) is retrieved from the .arkindex.yml
file in the directory the command is being launched from.
Optional arguments
If none of the additional arguments are set, their value is deduced from the local Git repository the command is launched from.
--repository-url
-
The URL of the worker’s Git repository. If unset, the command assumes it is being launched from the Git repository containing the worker, and uses the URL of this local repository.
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2 \ --repository-url http://gitlab.example.com/my_group/my_worker
--revision-branch
-
The name of a branch to assign to the Git revision. If unset, the command assumes it is being launched from the Git repository containing the worker, and retrieves the branch from this local repository.
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2 \ --revision-branch 'something-something-branch'
--revision-tag
-
The tag to assign to the Git revision. If unset, the command assumes it is being launched from the Git repository containing the worker, and retrieves the first tag it finds in this local repository.
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2 \ --revision-tag 0.4.2
Running the command in a Gitlab CI pipeline
When either subcommand is launched from a Gitlab pipeline, then any missing values are retrieved from their corresponding environment variables.
Command argument | Environment variable |
---|---|
|
|
|
|
|
|