Workers subcommands

Publish workers

The worker publish command allows you to publish workers on Arkindex, from Git repositories.

Basic usage

arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2

The publish command creates a new worker version for a given worker on Arkindex, from a Git repository. If the parent worker and/or repository do not exist on Arkindex, they are created as well.

The only required argument is the docker_image_tag which is a positional argument, and the URL of the Docker image linked to 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 folder 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-hash: the hash of the Git revision on which the worker version is published. If unset, the command assumes it is being launched from the Git repository containing the worker, and retrieves this hash from this local repository.
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2 --revision-hash f2a88760e159d3649845ceee7dbaca19d8654f33
  • --revision-message: the message of the Git revision on which the worker version is published. If unset, the command assumes it is being launched from the Git repository containing the worker, and retrieves this message from this local repository.
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2 --revision-message 'my commit message'
  • --revision-author: the name of the author of the Git revision on which the worker version is published. If unset, the command assumes it is being launched from the Git repository containing the worker, and retrieves the author's name from this local repository.
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2 --revision-author 'Fox Mulder'
  • --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-tags: the tags to assign to the Git revision. If unset, the command assumes it is being launched from the Git repository containing the worker, and retrieves these tags from this local repository.
arkindex worker publish registry.gitlab.example.com/my_group/my_worker:0.4.2 --revision-tags one-tag second-tag other-tag

Running the command in a Gitlab CI pipeline

When the publish command is launched from a Gitlab pipeline, then any missing values are retrieved from their corresponding environment variables.

Command argument Environment variable
repository-url CI_PROJECT_URL
revision-hash CI_COMMIT_SHA
revision-message CI_COMMIT_MESSAGE
revision-author CI_COMMIT_AUTHOR
revision-branch CI_COMMIT_BRANCH
revision-tag CI_COMMIT_TAG