Publish RC container images (#7556)

* WIP

* Add missing checkout

* Add debuggin

* Fix VAR name

* Bug fix

* Rework jobs

* Revert "Rework jobs"

This reverts commit 2bfa79fd3ae633c17403b838f9a5025f0f7fc3f3.

* Add cache

* Add temp default for testing

* Add missing checkout

* Fix patch

* Comment out the GPG check for now

* Rename polkadot_injected_release into a more appropriate polkadot_injected_debian

* Refactoring / renaming

* Introduce a generic image for binary injection

* Flag files to be deleted and changes to be done

* WIP

* Fix multi binaries images

* Add test build scripts

* Remove old file, add polkadot build-injected script

* Fix doc

* Fix tagging

* Add build of the injected container

* Fix for docker

* Remove the need for TTY

* Handling container publishing

* Fix owner and registry

* Fix vars

* Fix repo

* Fix var naming

* Fix case when there is no tag

* Fix case with no tag

* Handle error

* Fix spacings

* Fix tags

* Remove unnecessary grep that may fail

* Add final check

* Clean up and introduce GPG check

* Add doc

* Add doc

* Update doc/docker.md

Co-authored-by: Mira Ressel <mira@parity.io>

* type

Co-authored-by: Mira Ressel <mira@parity.io>

* Fix used VAR

* Improve doc

* ci: Update .build-push-image jobs to use the new build-injected.sh

* ci: fix path to build-injected.sh script

* Rename the release artifacts folder to prevent confusion due to a similar folder in the gitlab CI

* ci: check out polkadot repo in .build-push-image

This seems far cleaner than copying the entire scripts/ folder into our
job artifacts.

* feat(build-injected.sh): make PROJECT_ROOT configurable

This lets us avoid a dependency on git in our CI image.

* ci: build injected images with buildah

* ci: pass full image names to zombienet

* Add missing ignore

---------

Co-authored-by: Mira Ressel <mira@parity.io>
This commit is contained in:
Chevdor
2023-08-11 15:28:39 +02:00
committed by GitHub
parent cf66819a19
commit 693a29da1a
35 changed files with 663 additions and 325 deletions
@@ -39,7 +39,6 @@ build-linux-stable:
- echo -n ${CI_JOB_ID} > ./artifacts/BUILD_LINUX_JOB_ID
- RELEASE_VERSION=$(./artifacts/polkadot -V | awk '{print $2}'| awk -F "-" '{print $1}')
- echo -n "v${RELEASE_VERSION}" > ./artifacts/BUILD_RELEASE_VERSION
- cp -r scripts/* ./artifacts
build-test-collators:
stage: build
@@ -64,7 +63,6 @@ build-test-collators:
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- echo "undying-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r ./scripts/* ./artifacts
build-malus:
stage: build
@@ -88,7 +86,6 @@ build-malus:
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r ./scripts/* ./artifacts
build-staking-miner:
stage: build
@@ -110,7 +107,6 @@ build-staking-miner:
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "staking-miner = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r ./scripts/* ./artifacts
build-rustdoc:
stage: build
+19 -35
View File
@@ -19,20 +19,16 @@ publish-polkadot-debug-image:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
variables:
CI_IMAGE: ${BUILDAH_IMAGE}
GIT_STRATEGY: none
DOCKER_USER: ${PARITYPR_USER}
DOCKER_PASS: ${PARITYPR_PASS}
# scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile
DOCKERFILE: ci/dockerfiles/polkadot_injected_debug.Dockerfile
IMAGE_NAME: docker.io/paritypr/polkadot-debug
IMAGE_NAME: "polkadot-debug"
BINARY: "polkadot,polkadot-execute-worker,polkadot-prepare-worker"
needs:
- job: build-linux-stable
artifacts: true
after_script:
- !reference [.build-push-image, after_script]
# pass artifacts to the zombienet-tests job
# https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
- echo "PARACHAINS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/parachains.env
- echo "PARACHAINS_IMAGE_NAME=${IMAGE}" > ./artifacts/parachains.env
- echo "PARACHAINS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/parachains.env
artifacts:
reports:
@@ -48,20 +44,15 @@ publish-test-collators-image:
- .build-push-image
- .zombienet-refs
variables:
CI_IMAGE: ${BUILDAH_IMAGE}
GIT_STRATEGY: none
DOCKER_USER: ${PARITYPR_USER}
DOCKER_PASS: ${PARITYPR_PASS}
# scripts/ci/dockerfiles/collator_injected.Dockerfile
DOCKERFILE: ci/dockerfiles/collator_injected.Dockerfile
IMAGE_NAME: docker.io/paritypr/colander
IMAGE_NAME: "colander"
BINARY: "adder-collator,undying-collator"
needs:
- job: build-test-collators
artifacts: true
after_script:
- buildah logout --all
- !reference [.build-push-image, after_script]
# pass artifacts to the zombienet-tests job
- echo "COLLATOR_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/collator.env
- echo "COLLATOR_IMAGE_NAME=${IMAGE}" > ./artifacts/collator.env
- echo "COLLATOR_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/collator.env
artifacts:
reports:
@@ -76,20 +67,15 @@ publish-malus-image:
- .build-push-image
- .zombienet-refs
variables:
CI_IMAGE: ${BUILDAH_IMAGE}
GIT_STRATEGY: none
DOCKER_USER: ${PARITYPR_USER}
DOCKER_PASS: ${PARITYPR_PASS}
# scripts/ci/dockerfiles/malus_injected.Dockerfile
DOCKERFILE: ci/dockerfiles/malus_injected.Dockerfile
IMAGE_NAME: docker.io/paritypr/malus
IMAGE_NAME: "malus"
BINARY: "malus,polkadot-execute-worker,polkadot-prepare-worker"
needs:
- job: build-malus
artifacts: true
after_script:
- buildah logout "$IMAGE_NAME"
- !reference [.build-push-image, after_script]
# pass artifacts to the zombienet-tests job
- echo "MALUS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/malus.env
- echo "MALUS_IMAGE_NAME=${IMAGE}" > ./artifacts/malus.env
- echo "MALUS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/malus.env
artifacts:
reports:
@@ -103,13 +89,11 @@ publish-staking-miner-image:
- .build-push-image
- .publish-refs
variables:
CI_IMAGE: ${BUILDAH_IMAGE}
# scripts/ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile
DOCKERFILE: ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile
IMAGE_NAME: docker.io/paritytech/staking-miner
GIT_STRATEGY: none
DOCKER_USER: ${Docker_Hub_User_Parity}
DOCKER_PASS: ${Docker_Hub_Pass_Parity}
IMAGE_NAME: "staking-miner"
BINARY: "staking-miner"
DOCKER_OWNER: "paritytech"
DOCKER_USER: "${Docker_Hub_User_Parity}"
DOCKER_PASS: "${Docker_Hub_Pass_Parity}"
needs:
- job: build-staking-miner
artifacts: true
@@ -122,11 +106,11 @@ publish-polkadot-image-description:
DOCKER_PASSWORD: ${Docker_Hub_Pass_Parity}
DOCKERHUB_REPOSITORY: parity/polkadot
SHORT_DESCRIPTION: "Polkadot Official Docker Image"
README_FILEPATH: $CI_PROJECT_DIR/scripts/ci/dockerfiles/polkadot_Dockerfile.README.md
README_FILEPATH: $CI_PROJECT_DIR/scripts/ci/dockerfiles/polkadot/polkadot_Dockerfile.README.md
rules:
- if: $CI_COMMIT_REF_NAME == "master"
changes:
- scripts/ci/dockerfiles/polkadot_Dockerfile.README.md
- scripts/ci/dockerfiles/polkadot/polkadot_Dockerfile.README.md
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
script: