Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/ci/images/ci_wait_for_ci_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

push_pull_remove_images::check_if_github_registry_wait_for_image_enabled

build_image::configure_github_docker_registry
build_image::configure_docker_registry

export AIRFLOW_CI_IMAGE_NAME="${BRANCH_NAME}-python${PYTHON_MAJOR_MINOR_VERSION}-ci"

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/images/ci_wait_for_prod_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

push_pull_remove_images::check_if_github_registry_wait_for_image_enabled

build_image::configure_github_docker_registry
build_image::configure_docker_registry

export AIRFLOW_PROD_IMAGE_NAME="${BRANCH_NAME}-python${PYTHON_MAJOR_MINOR_VERSION}"
start_end::group_start "Waiting for ${AIRFLOW_PROD_IMAGE_NAME} image to appear"
Expand Down
17 changes: 10 additions & 7 deletions scripts/ci/libraries/_build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ function build_images::get_docker_image_names() {
# either GITHUB_TOKEN or CONTAINER_REGISTRY_TOKEN depending on the registry.
# In case Personal Access token is not set, skip logging in
# Also enable experimental features of docker (we need `docker manifest` command)
function build_image::configure_github_docker_registry() {
function build_image::configure_docker_registry() {
if [[ ${USE_GITHUB_REGISTRY} == "true" ]]; then
start_end::group_start "Determine GitHub Registry token used and login if needed"
start_end::group_start "Determine GitHub Registry token"
local token=""
if [[ "${GITHUB_REGISTRY}" == "ghcr.io" ]]; then
# For now ghcr.io can only authenticate using Personal Access Token with package access scope.
Expand All @@ -482,6 +482,8 @@ function build_image::configure_github_docker_registry() {
echo
exit 1
fi
start_end::group_end
start_end::group_start "Logging in to GitHub Registry"
if [[ -z "${token}" ]] ; then
verbosity::print_info
verbosity::print_info "Skip logging in to GitHub Registry. No Token available!"
Expand All @@ -495,13 +497,14 @@ function build_image::configure_github_docker_registry() {
else
verbosity::print_info "Skip Login to GitHub Registry ${GITHUB_REGISTRY} as token is missing"
fi
verbosity::print_info "Make sure experimental docker features are enabled"
start_end::group_end

start_end::group_start "Make sure experimental docker features are enabled"
local new_config
new_config=$(jq '.experimental = "enabled"' "${HOME}/.docker/config.json")
echo "${new_config}" > "${HOME}/.docker/config.json"
verbosity::print_info "Docker config after change:"
verbosity::print_info "${new_config}"
start_end::group_end

fi
}

Expand All @@ -521,7 +524,7 @@ function build_images::prepare_ci_build() {
export AIRFLOW_IMAGE="${AIRFLOW_CI_IMAGE}"
readonly AIRFLOW_IMAGE

build_image::configure_github_docker_registry
build_image::configure_docker_registry
sanity_checks::go_to_airflow_sources
permissions::fix_group_permissions
}
Expand Down Expand Up @@ -844,7 +847,7 @@ function build_images::prepare_prod_build() {
export AIRFLOW_IMAGE="${AIRFLOW_PROD_IMAGE}"
readonly AIRFLOW_IMAGE

build_image::configure_github_docker_registry
build_image::configure_docker_registry
AIRFLOW_BRANCH_FOR_PYPI_PRELOADING="${BRANCH_NAME}"
sanity_checks::go_to_airflow_sources
}
Expand Down