Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

conda-archive/conda-gitlab-ci

Repository files navigation

Conda Gitlab CI

Travis CI build status

code coverage

Code Health

Drive Gitlab CI for conda recipe repos

  • Free software: BSD 3-clause license

Features

  • Determine changed conda recipes from either the most recent commit, or from a range of commits
  • Trigger additional build jobs to a gitlab CI server based on those changes

Usage

This package is intended to be installed on some build worker - no label is important. It computes which recipes to build based on git differences by default, but packages can also be specified manually. It then submits jobs back to the CI server for each build on potentially several worker labels.

The interface to this functionality is the cgci entry point:

usage: cgci [-h] [--all | --packages PACKAGES [PACKAGES ...]] [--steps STEPS]
            [--max-downstream MAX_DOWNSTREAM] [--git-rev GIT_REV]
            [--stop-rev STOP_REV] [--threads THREADS] [--visualize VISUALIZE]
            [--test]
            path

positional arguments:
  path

optional arguments:
  -h, --help            show this help message and exit
  --all                 Show/build all nodes in the graph, not just changed
                        ones
  --packages PACKAGES [PACKAGES ...], -p PACKAGES [PACKAGES ...]
                        Rather than determine tree from git, specify packages
                        to build
  --steps STEPS         Number of downstream steps to follow in the DAG when
                        computing what to test. Used for making sure that an
                        update does not break downstream packages. Set to -1
                        to follow the complete dependency tree.
  --max-downstream MAX_DOWNSTREAM
                        Limit the total number of downstream packages built.
                        Only applies if steps != 0.  Set to -1 for unlimited.
  --git-rev GIT_REV     start revision to examine. If stop not provided,
                        changes are THIS_VAL~1..THIS_VAL
  --stop-rev STOP_REV   stop revision to examine. When provided,changes are
                        git_rev..stop_rev
  --threads THREADS     dask scheduling threads. Effectively number of
                        parallel builds, though not all builds run on one
                        host.
  --visualize VISUALIZE
                        Output a PDF visualization of the package build graph,
                        and quit. Argument is output file name (png, pdf)
  --test                test packages (instead of building them)

The basic concept for where and how to use cgci is based around repositories of recipes. These repositories must live on the gitlab instance which is being used for CI, but can be clones or mirrors of other git repos (github?)

This tool does not care if recipes are actual folders, or git submodules. In such a repository, create a .gitlab-ci.yml file, with contents like:

You'll also need some configuration to specify your platform and version matrix. Create these folders:

  • build_platforms.d
  • test_platforms.d

In these folders, create any number of arbitrarily named .yaml files. These files are expected to have the following keys:

  • worker_label: this is the label used by Gitlab CI to identify appropriate workers for your job
  • platform: the conda platform to build on. Examples: win, osx, linux
  • arch: the architecture to build for. Examples: 32, 64, armv7l, ppc64le

Create the versions.yml file in the root of your repository:

Now, go to your repo's settings, and make sure that at least these secret environment variables are set:

Credits

This package is derived from the ProtoCI project, which played this role with Anaconda Build workers.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

About

Drive gitlab ci on repositories of conda recipes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages