Skip to content

Latest commit

 

History

History
74 lines (59 loc) · 3.52 KB

03_github_variables.md

File metadata and controls

74 lines (59 loc) · 3.52 KB

Table of Contents generated with DocToc

GitHub Registry Variables

Our CI uses GitHub Registry to pull and push images to/from by default. Those variables are set automatically by GitHub Actions when you run Airflow workflows in your fork, so they should automatically use your own repository as GitHub Registry to build and keep the images as build image cache.

The variables are automatically set in GitHub actions

Variable Default Comment
GITHUB_REPOSITORY apache/airflow Prefix of the image. It indicates which registry from GitHub to use.
CONSTRAINTS_GITHUB_REPOSITORY apache/airflow Repository where constraints are stored
GITHUB_USERNAME Username to use to login to GitHub
GITHUB_TOKEN Token to use to login to GitHub. Only used when pushing images on CI.

The Variables beginning with GITHUB_ cannot be overridden in GitHub Actions by the workflow. Those variables are set by GitHub Actions automatically and they are immutable. Therefore if you want to override them in your own CI workflow and use breeze, you need to pass the values by corresponding breeze flags --github-repository, --github-token rather than by setting them as environment variables in your workflow. Unless you want to keep your own copy of constraints in orphaned constraints-* branches, the CONSTRAINTS_GITHUB_REPOSITORY should remain apache/airflow, regardless in which repository the CI job is run.

One of the variables you might want to override in your own GitHub Actions workflow when using breeze is --github-repository - you might want to force it to apache/airflow, because then the cache from apache/airflow repository will be used and your builds will be much faster.

Example command to build your CI image efficiently in your own CI workflow:

# GITHUB_REPOSITORY is set automatically in Github Actions so we need to override it with flag
#
breeze ci-image build --github-repository apache/airflow --python 3.10
docker tag ghcr.io/apache/airflow/main/ci/python3.10 your-image-name:tag

Read next about Static checks