Gitlab
Learn how to setup Gitlab CI pipelines so publishing your data science work becomes automatic!!
Prerequisites
Have a Kyso account - either on kyso.io or on your company's private Kyso installation.
Create a Kyso access token - follow these instructions. Save this for later!
Ensure your directory (or folders) contains a valid
kyso.yamlfile. Check the following instructions for more info.
How to publish to Kyso with Gitlab CI Pipelines
Create a
.gitlab-ci.ymlfile in your Gitlab repository.Copy the following YAML contents into
.gitlab-ci.yml:
image: node:18
Upload to Kyso:
script:
- npm install -g kyso
- kyso login --kysoInstallUrl https://kyso.io --provider kyso --username [YOUR EMAIL] --token [YOUR ACCESS TOKEN]
- kyso pushThis means that on each new push to a tag on the repository, a CI pipeline will be generated to run the commands in our action file above.
Remember to also ensure that your metadata specs in the sub-directory YAML files, are correct:
organization: [Your Organisation Name]
team/channel: [Destination channel for each report, and this might be different for each sub-directory]
Executing the CI Pipeline
When we commit changes to the Gitlab repository, a Docker image is created to run our job. We can check out the pipeline logs at https://gitlab.com/user/repository/-/jobs/job-id and should see something like this:
Maintaining a QA process with Pull Requests
Similar to our documentation on Github Actions, we can maintain a QA process, ensuring only merged/reviewed work is pushed upstream to Kyso.
GithubSo, for example, if you work with a team of scientists, data scientists, etc.., all pushing and pulling to and from the same repository, you're going to want to control how, when and what changes get published to Kyso.
To make this workflow even more secure, it has been recommended that you add branch protection rules to your main branch!
Last updated