Bitbucket

Learn how to setup 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.yaml file. Check the following instructions for more info.

How to publish to Kyso with Bitbucket CI Pipelines

In the root directory of the repository, create abitbucket-pipelines.yml that details the actions we want to run and when:

image: node:18

pipelines:
  branches:
    main:
    - step:
        name: 'Publishing to Kyso'
        trigger: 'automatic'
        script:
          - npm install -g kyso
          - kyso login --kysoInstallUrl https://kyso.io --provider kyso --username [YOUR EMAIL] --token [YOUR ACCESS TOKEN]
          - kyso push

So now every time we make a commit to this repository, whether on the UI or from the Command Line, the above script will be run, publishing and updating our work in Kyso.

Note that this is a super simple template using the example Starter pipeline configuration, but this can be integrated into much more powerful pipeline flows.

For example, you can decide to only push specific branches or tags.

Don't see or can't figure out how to set up your desired workflow? Simply reach out to us, let us know your use case and how you want your pipeline to work, and we'll send you the documentation!!

Executing the CI Pipeline

Using our example repository from above, as we commit changes to the Bitbucket project, a Docker image is created to run our job. We can check out the pipeline logs at https://bitbucket.org/user/repository/pipelines. Clicking into one of the most recent successful merges, we 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.

Github

So, 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

Was this helpful?