Publishing your worker on Arkindex¶
Publication process¶
While workers may be run locally, they are usually written to launch on an Arkindex instance. A worker version on Arkindex is basically a configuration and a URL towards a Docker image, used at runtime during processes. The worker template includes an automatic publication process towards any Arkindex instance.
How it works¶
The template implements a new CI job, publish-worker
, at the last stage of the pipeline. When every job of the previous stages have passed, this one will try to publish a new worker version, using the newly built Docker image, on every Arkindex instance specified by the ARKINDEX_INSTANCE
variable. The publication is done using the Arkindex CLI tool.
Warning
If you change the docker_image_tag
positional argument value, it might not be in sync with the tag produced during the docker-build
job. Make sure these match to link the version with the right Docker image.
Note
If your repository defines multiple workers, one worker version will be pushed per worker. However, there will still only be one job per instance.
Authentication in CI¶
Since the publication is done during a GitLab CI, no optional arguments are needed. There are multiple ways to authenticate to an Arkindex instance when using the CLI tool. During a GitLab CI, the best way is through a Project-level Secure File. Make sure to create one that follows the format supported by the CLI. The template expects that secure file to be named arkindex-cli.yaml
.
Specifying another instance¶
In the template, a publication to https://demo.arkindex.org (slug demo
) is presented. To publish to another instance, make sure that:
- the authentication credentials for that instance are present in the secure file,
- the slug is listed as a potential value for
ARKINDEX_INSTANCE
in thepublish-worker
job configuration.