From 18889a97bbd141dfeb8e85b3cdeb2ac4aa3895a1 Mon Sep 17 00:00:00 2001 From: zerg-su <65297783+zerg-su@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:32:52 +0300 Subject: [PATCH] Ci/ubuntu migration (#2268) * change builder image to ubuntu * change versions in Makefile * zombie tests and runner -> ubuntu * rename kagome_builder_deb -> kagome_builder * push builder to dockerhub * build tidy from dockerhub * zombie builder custom tag * polkadot builder image -> ubuntu * add rust version to zombie tester * zombie tester version info in log fix * update custom build tags * WASMEDGE_ID update * kagome runner image fix * zombie-tester custom tag * custom zombie tester for runtime cache build * zombie tests action update * update runtime package version format --------- Co-authored-by: Kirill Azovtsev --- .github/workflows/kagome-builder-deb.yaml | 55 +++++--- .github/workflows/test.yml | 38 +++--- .github/workflows/zombie-builder.yml | 18 ++- .github/workflows/zombie-tests.yaml | 15 ++- CMakeLists.txt | 2 +- docs/source/overview/getting_started.md | 2 +- housekeeping/docker/kagome-dev/Makefile | 117 ++++++++++++++---- .../docker/kagome-dev/build_and_push.sh | 4 +- .../docker/kagome-dev/install_packages | 24 ++++ ...b.Dockerfile => kagome_builder.Dockerfile} | 26 ++-- ...eb.Dockerfile => kagome_runner.Dockerfile} | 19 +-- zombienet/docker/Makefile | 31 +++-- zombienet/docker/install_packages | 24 ++++ zombienet/docker/polkadot_builder.Dockerfile | 54 ++++---- zombienet/docker/zombie_tester.Dockerfile | 38 +++--- 15 files changed, 337 insertions(+), 130 deletions(-) create mode 100644 housekeeping/docker/kagome-dev/install_packages rename housekeeping/docker/kagome-dev/{kagome_builder_deb.Dockerfile => kagome_builder.Dockerfile} (84%) rename housekeeping/docker/kagome-dev/{minideb.Dockerfile => kagome_runner.Dockerfile} (87%) create mode 100644 zombienet/docker/install_packages diff --git a/.github/workflows/kagome-builder-deb.yaml b/.github/workflows/kagome-builder-deb.yaml index 850b722fcf..66c2c4d4e4 100644 --- a/.github/workflows/kagome-builder-deb.yaml +++ b/.github/workflows/kagome-builder-deb.yaml @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -name: Kagome Builder | Debian (Bookworm) +name: Kagome Builder | Ubuntu (24.04_LTS) on: # schedule: @@ -12,21 +12,33 @@ on: workflow_dispatch: inputs: kagome_image_rebuild: - description: 'Rebuild Kagome Builder Minideb image' + description: 'Rebuild Kagome Builder image' required: false default: 'false' type: 'boolean' runtime_cache_rebuild: - description: 'Rebuild Kagome Runtime Cache' + description: 'Rebuild Kagome Runtime cache' required: false default: 'false' type: 'boolean' + builder_latest_tag: + description: 'Custom Kagome Builder tag' + default: 'latest' + required: false + type: 'string' + zombie_tester_latest_tag: + description: 'Custom Zombie Tester tag' + default: 'latest' + required: false + type: 'string' env: DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/ + BUILDER_LATEST_TAG: ${{ github.event.inputs.builder_latest_tag || 'latest' }} + TESTER_LATEST_TAG: ${{ github.event.inputs.zombie_tester_latest_tag || 'latest' }} jobs: - build_polkadot_builder: + build_kagome_builder: runs-on: ubuntu-latest timeout-minutes: 60 steps: @@ -50,28 +62,42 @@ jobs: id: check-tag working-directory: ./housekeeping/docker/kagome-dev run: | - IMAGE_TAG=$(grep '^MINIDEB_IMAGE' Makefile | awk -F '[@:]' '{print $3}' | cut -c 1-7)_rust-$(grep '^RUST_VERSION' Makefile | sed 's/.*?= //') - KAGOME_BUILDER_DEB_IMAGE=${DOCKER_REGISTRY_PATH}kagome_builder_deb:${IMAGE_TAG} - TAG_EXISTS=$(docker manifest inspect ${KAGOME_BUILDER_DEB_IMAGE} > /dev/null 2>&1 && echo "true" || echo "false") + IMAGE_TAG=$(make builder_image_tag) + KAGOME_BUILDER_IMAGE=${DOCKER_REGISTRY_PATH}kagome_builder_deb:${IMAGE_TAG} + TAG_EXISTS=$(docker manifest inspect ${KAGOME_BUILDER_IMAGE} > /dev/null 2>&1 && echo "true" || echo "false") echo "exists=$TAG_EXISTS" >> $GITHUB_ENV - echo "kagome_builder_deb=$KAGOME_BUILDER_DEB_IMAGE" >> $GITHUB_OUTPUT + echo "kagome_builder=$KAGOME_BUILDER_IMAGE" >> $GITHUB_OUTPUT + + - name: "Build Kagome Builder" + working-directory: ./housekeeping/docker/kagome-dev + if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' + run: make kagome_builder \ + DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ + BUILDER_LATEST_TAG=${BUILDER_LATEST_TAG} - - name: "Build Polkadot Builder" + - name: "Push Kagome Builder" working-directory: ./housekeeping/docker/kagome-dev if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' - run: make kagome_builder_deb \ + run: make kagome_builder_push \ DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} - - name: "Push Polkadot Builder" + - name: "Login to Docker Hub" + uses: docker/login-action@v3 + if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: "Push Kagome Builder (DockerHub)" working-directory: ./housekeeping/docker/kagome-dev if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' - run: make kagome_builder_deb_push \ + run: make kagome_builder_push_dockerhub \ DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} - name: "Versions Info" if: always() run: | - echo "Docker Image Name: ${{ steps.check-tag.outputs.kagome_builder_deb }}" + echo "Docker Image Name: ${{ steps.check-tag.outputs.kagome_builder }}" build_kagome_runtime: runs-on: [ actions-runner-controller ] @@ -97,7 +123,8 @@ jobs: working-directory: ./housekeeping/docker/kagome-dev if: github.event.inputs.runtime_cache_rebuild == 'true' run: make runtime_cache \ - DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} + DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ + TESTER_LATEST_TAG=${{ env.TESTER_LATEST_TAG }} - name: "Push Runtime Cache" working-directory: ./housekeeping/docker/kagome-dev diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5554a10294..9adc7e5971 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,16 @@ on: options: - 'true' - 'false' + builder_latest_tag: + description: 'Custom Builder tag' + default: 'latest' + required: false + type: 'string' + zombie_tester_latest_tag: + description: 'Custom Zombie Tester tag' + default: 'latest' + required: false + type: 'string' env: BUILD_DIR: build @@ -52,6 +62,8 @@ env: DEFAULT_BUILD_TYPE: Release GIT_REF_NAME: ${{ github.ref_name }} IS_MAIN_OR_TAG: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) }} + BUILDER_LATEST_TAG: ${{ github.event.inputs.builder_latest_tag || 'latest' }} + TESTER_LATEST_TAG: ${{ github.event.inputs.zombie_tester_latest_tag || 'latest' }} jobs: @@ -205,19 +217,6 @@ jobs: if: github.ref != 'refs/heads/master' run: git fetch origin master:master || true - - name: "Authenticate with Google Cloud" - uses: 'google-github-actions/auth@v2' - with: - credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} - - - name: "Set up Cloud SDK" - uses: 'google-github-actions/setup-gcloud@v2' - - - name: "Configure Docker for GCR" - run: | - gcloud auth configure-docker --quiet - gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet - - name: "Get commit version" working-directory: ./housekeeping/docker/kagome-dev run: make get_versions @@ -242,9 +241,9 @@ jobs: working-directory: ./housekeeping/docker/kagome-dev run: make kagome_dev_docker_build_tidy \ - DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ GITHUB_HUNTER_USERNAME=${{ secrets.HUNTER_USERNAME }} \ GITHUB_HUNTER_TOKEN=${{ secrets.HUNTER_TOKEN }} \ + BUILDER_IMAGE_TAG=${{ env.BUILDER_LATEST_TAG }} \ CI="true" - name: "Cleaning cache" @@ -271,11 +270,11 @@ jobs: fail-fast: false matrix: options: - - name: "Self-hosted: Minideb: Build Debug" + - name: "Self-hosted docker: Build Debug" build_type: "Debug" - - name: "Self-hosted: Minideb: Build Release" + - name: "Self-hosted docker: Build Release" build_type: "Release" - - name: "Self-hosted: Minideb: Build RelWithDebInfo" + - name: "Self-hosted docker: Build RelWithDebInfo" build_type: "RelWithDebInfo" name: "${{ matrix.options.name }}" @@ -338,6 +337,7 @@ jobs: DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ GITHUB_HUNTER_USERNAME=${{ secrets.HUNTER_USERNAME }} \ GITHUB_HUNTER_TOKEN=${{ secrets.HUNTER_TOKEN }} \ + BUILDER_IMAGE_TAG=${{ env.BUILDER_LATEST_TAG }} \ BUILD_TYPE=${{ matrix.options.build_type }} - name: "Push Kagome APT Package" @@ -348,7 +348,7 @@ jobs: make upload_apt_package \ BUILD_TYPE=${{ matrix.options.build_type }} - - name: Set up Docker Buildx + - name: "Set up Docker Buildx" if: env.package_exist == 'False' uses: docker/setup-buildx-action@v3.6.1 @@ -500,7 +500,7 @@ jobs: - name: "Get Zombie Tester Version" run: | - ZOMBIE_TESTER_IMAGE=${DOCKER_REGISTRY_PATH}zombie_tester:latest + ZOMBIE_TESTER_IMAGE=${DOCKER_REGISTRY_PATH}zombie_tester:${{ env.TESTER_LATEST_TAG }} echo "zombie_tester_image=${ZOMBIE_TESTER_IMAGE}" echo "zombie_tester_image=${ZOMBIE_TESTER_IMAGE}" >> $GITHUB_ENV diff --git a/.github/workflows/zombie-builder.yml b/.github/workflows/zombie-builder.yml index 402a0cf776..49478f3f49 100644 --- a/.github/workflows/zombie-builder.yml +++ b/.github/workflows/zombie-builder.yml @@ -30,6 +30,16 @@ on: description: 'Custom Polkadot SDK tag' required: false type: 'string' + builder_latest_tag: + description: 'Custom Polkadot Builder tag' + default: 'latest' + required: false + type: 'string' + zombie_tester_latest_tag: + description: 'Custom Zombie Tester tag' + default: 'latest' + required: false + type: 'string' env: DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/ @@ -38,6 +48,8 @@ env: CACHE_VERSION: v001 CACHE_PATHS: ./zombienet/docker/cargo POLKADOT_SDK_TAG: ${{ github.event.inputs.polkadot_sdk_tag }} + BUILDER_LATEST_TAG: ${{ github.event.inputs.builder_latest_tag || 'latest' }} + TESTER_LATEST_TAG: ${{ github.event.inputs.zombie_tester_latest_tag || 'latest' }} jobs: build_polkadot_builder: @@ -79,6 +91,7 @@ jobs: if: env.exists == 'false' || github.event.inputs.polkadot_image_rebuild == 'true' run: make polkadot_builder \ DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} + BUILDER_LATEST_TAG=${BUILDER_LATEST_TAG} - name: "Push Polkadot Builder" working-directory: ./zombienet/docker @@ -214,16 +227,17 @@ jobs: echo "exists=$TAG_EXISTS" >> $GITHUB_ENV echo "zombie_tester_image=$ZOMBIE_TESTER_IMAGE" >> $GITHUB_OUTPUT - - name: "Build Polkadot Builder" + - name: "Build Zombie Tester" working-directory: ./zombienet/docker if: env.exists == 'false' || github.event.inputs.zombie_tester_image_rebuild == 'true' run: make zombie_tester \ DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS} \ PROJECT_ID=${{ secrets.GCP_PROJECT }} \ + TESTER_LATEST_TAG=${{ env.TESTER_LATEST_TAG }} \ POLKADOT_BINARY_PACKAGE_VERSION="${POLKADOT_BINARY_PACKAGE_VERSION}" - - name: "Push Polkadot Builder" + - name: "Push Zombie Tester" working-directory: ./zombienet/docker if: env.exists == 'false' || github.event.inputs.zombie_tester_image_rebuild == 'true' run: make zombie_tester_push \ diff --git a/.github/workflows/zombie-tests.yaml b/.github/workflows/zombie-tests.yaml index 06f30ecdb3..c45de77b9c 100644 --- a/.github/workflows/zombie-tests.yaml +++ b/.github/workflows/zombie-tests.yaml @@ -34,6 +34,16 @@ on: options: - 'true' - 'false' + builder_latest_tag: + description: 'Custom Builder tag' + default: 'latest' + required: false + type: 'string' + zombie_tester_latest_tag: + description: 'Custom Zombie Tester tag' + default: 'latest' + required: false + type: 'string' env: DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/ @@ -45,6 +55,8 @@ env: CACHE_VERSION: v01 CACHE_PATH: ./build/cache USE_CACHE: ${{ github.event.inputs.use_cache || 'true' }} + BUILDER_LATEST_TAG: ${{ github.event.inputs.builder_latest_tag || 'latest' }} + TESTER_LATEST_TAG: ${{ github.event.inputs.zombie_tester_latest_tag || 'latest' }} jobs: kagome_dev_docker_build: @@ -111,6 +123,7 @@ jobs: GITHUB_HUNTER_USERNAME=${{ secrets.HUNTER_USERNAME }} \ GITHUB_HUNTER_TOKEN=${{ secrets.HUNTER_TOKEN }} \ BUILD_TYPE=${{ github.event.inputs.build_type }} \ + BUILDER_IMAGE_TAG=${{ env.BUILDER_LATEST_TAG }} \ WERROR=${{ github.event.inputs.werror }} - name: "Push Kagome APT Package" @@ -236,7 +249,7 @@ jobs: - name: "Get Zombie Tester Version" run: | - ZOMBIE_TESTER_IMAGE=${DOCKER_REGISTRY_PATH}zombie_tester:latest + ZOMBIE_TESTER_IMAGE=${DOCKER_REGISTRY_PATH}zombie_tester:${{ env.TESTER_LATEST_TAG }} echo "zombie_tester_image=${ZOMBIE_TESTER_IMAGE}" echo "zombie_tester_image=${ZOMBIE_TESTER_IMAGE}" >> $GITHUB_ENV diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b49b488b4..7b73b223ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ set(CMAKE_TOOLCHAIN_FILE # SHA1 hash of the WasmEdge repository archive. # Required to separate cached runtimes # compiled with different WasmEdge versions. -set(WASMEDGE_ID 58aea400de9179ad3e314c7e84fd4da345b8a643) +set(WASMEDGE_ID 00c9a478de6d1d9443d7b6df5a5a488f9c84b716) include("cmake/Hunter/init.cmake") diff --git a/docs/source/overview/getting_started.md b/docs/source/overview/getting_started.md index feb35dddc1..a70ebfa551 100644 --- a/docs/source/overview/getting_started.md +++ b/docs/source/overview/getting_started.md @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0 ### Prerequisites -For now, please refer to the [Dockerfile](https://github.com/soramitsu/kagome/blob/master/housekeeping/docker/kagome-dev/minideb.Dockerfile) to get a picture of what you need for a local build-environment. +For now, please refer to the [Dockerfile](https://github.com/soramitsu/kagome/blob/master/housekeeping/docker/kagome-dev/kagome_runner.Dockerfile) to get a picture of what you need for a local build-environment. ### Clone diff --git a/housekeeping/docker/kagome-dev/Makefile b/housekeeping/docker/kagome-dev/Makefile index 9377017f61..da5bd4b2dc 100644 --- a/housekeeping/docker/kagome-dev/Makefile +++ b/housekeeping/docker/kagome-dev/Makefile @@ -1,6 +1,13 @@ # Shared Environment Variables -# bookworm (Debian 12) -MINIDEB_IMAGE ?= bitnami/minideb@sha256:6cc3baf349947d587a9cd4971e81ff3ffc0d17382f2b5b6de63d6542bff10c16 +OS_IMAGE_NAME ?= ubuntu +OS_IMAGE_TAG ?= 24.04 +OS_IMAGE_HASH ?= 99c35190e22d294cdace2783ac55effc69d32896daaa265f0bbedbcde4fbe3e5 + +# kagome_builder Variables +RUST_VERSION ?= 1.81.0 +GCC_VERSION ?= 13 +LLVM_VERSION ?= 19 + ## DOCKER_REGISTRY_PATH empty for local usage DOCKER_REGISTRY_PATH ?= DOCKERHUB_REGISTRY_PATH ?= qdrvm/kagome @@ -13,12 +20,13 @@ PACKAGE_ARCHITECTURE ?= amd64 BUILD_TYPE ?= Release # Generated versions -MINIDEB_HASH := $(subst bitnami/minideb@sha256:,,$(MINIDEB_IMAGE)) -MINIDEB_SHORT_HASH := $(shell echo $(MINIDEB_HASH) | cut -c1-7) -MINIDEB_TAG = $(MINIDEB_SHORT_HASH)_rust-$(RUST_VERSION) - -# kagome_builder_deb Variables -RUST_VERSION ?= 1.81.0 +OS_IMAGE ?= $(OS_IMAGE_NAME):$(OS_IMAGE_TAG)@sha256:$(OS_IMAGE_HASH) +OS_IMAGE_TAG_WITH_HASH := $(OS_IMAGE_TAG)@sha256:$(OS_IMAGE_HASH) +OS_IMAGE_SHORT_HASH := $(shell echo $(OS_IMAGE_HASH) | cut -c1-7) +BUILDER_IMAGE_TAG ?= $(OS_IMAGE_SHORT_HASH)_rust$(RUST_VERSION)_gcc$(GCC_VERSION)_llvm$(LLVM_VERSION) +BUILDER_LATEST_TAG ?= latest +TESTER_LATEST_TAG ?= latest +DOCKERHUB_BUILDER_PATH ?= $(DOCKERHUB_REGISTRY_PATH)_builder # kagome_dev_docker_build Variables BUILD_DIR ?= build @@ -53,18 +61,30 @@ get_versions: @echo "short_commit_hash: `git rev-parse HEAD | head -c 7`" | tee -a commit_hash.txt @echo "kagome_version: `cd $(WORKING_DIR) && ./get_version.sh`" | tee kagome_version.txt -kagome_builder_deb: +builder_image_tag: + @echo $(BUILDER_IMAGE_TAG) + +kagome_builder: docker build --platform $(PLATFORM) \ - -t $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(MINIDEB_TAG) \ - -t $(DOCKER_REGISTRY_PATH)kagome_builder_deb:latest \ - -f kagome_builder_deb.Dockerfile \ + -t $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_IMAGE_TAG) \ + -t $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_LATEST_TAG) \ + -f kagome_builder.Dockerfile \ --build-arg RUST_VERSION=$(RUST_VERSION) \ - --build-arg BASE_IMAGE=$(MINIDEB_IMAGE) \ + --build-arg GCC_VERSION=$(GCC_VERSION) \ + --build-arg LLVM_VERSION=$(LLVM_VERSION) \ + --build-arg BASE_IMAGE=$(OS_IMAGE_NAME) \ + --build-arg BASE_IMAGE_TAG=$(OS_IMAGE_TAG_WITH_HASH) \ --build-arg ARCHITECTURE=$(ARCHITECTURE) . -kagome_builder_deb_push: - docker push $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(MINIDEB_TAG) ; \ - docker push $(DOCKER_REGISTRY_PATH)kagome_builder_deb:latest +kagome_builder_push: + docker push $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_IMAGE_TAG) ; \ + docker push $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_LATEST_TAG) + +kagome_builder_push_dockerhub: + docker tag $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_IMAGE_TAG) $(DOCKERHUB_BUILDER_PATH):$(BUILDER_IMAGE_TAG) ; \ + docker tag $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_LATEST_TAG) $(DOCKERHUB_BUILDER_PATH):$(BUILDER_LATEST_TAG) ; \ + docker push $(DOCKERHUB_BUILDER_PATH):$(BUILDER_IMAGE_TAG) ; \ + docker push $(DOCKERHUB_BUILDER_PATH):$(BUILDER_LATEST_TAG) kagome_dev_docker_build: $(MAKE) get_versions @@ -94,7 +114,7 @@ kagome_dev_docker_build: -v $(CACHE_DIR)/.cargo/registry:/root/.cargo/registry \ -v $(CACHE_DIR)/.hunter:/root/.hunter \ -v $(CACHE_DIR)/.cache/ccache:/root/.cache/ccache \ - $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(MINIDEB_TAG) \ + $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_IMAGE_TAG) \ -c "tail -f /dev/null"; \ docker exec -t $$CONTAINER_NAME /bin/bash -c \ "cd /opt/kagome && \ @@ -123,7 +143,7 @@ kagome_dev_docker_build: fi; \ docker stop $$CONTAINER_NAME -kagome_dev_docker_build_tidy: +kagome_dev_docker_build_tidy_inhouse: $(MAKE) get_versions mkdir -p \ $(CACHE_DIR)/.cargo/git \ @@ -151,7 +171,55 @@ kagome_dev_docker_build_tidy: -v $(CACHE_DIR)/.cargo/registry:/root/.cargo/registry \ -v $(CACHE_DIR)/.hunter:/root/.hunter \ -v $(CACHE_DIR)/.cache/ccache:/root/.cache/ccache \ - $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(MINIDEB_TAG) \ + $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(BUILDER_IMAGE_TAG) \ + -c "tail -f /dev/null"; \ + docker exec -t $$CONTAINER_NAME /bin/bash -c \ + "clang --version && \ + cd /opt/kagome && \ + git config --global --add safe.directory /opt/kagome && \ + git config --global --add safe.directory /root/.hunter/_Base/Cache/meta && \ + source /venv/bin/activate && \ + git submodule update --init && \ + echo \"Building in $$(pwd)\" && \ + cmake . -B\"$(BUILD_DIR)\" -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=\"$(BUILD_TYPE)\" -DBACKWARD=OFF -DWERROR=$(WERROR) && \ + cmake --build \"$(BUILD_DIR)\" --target generated -- -j${BUILD_THREADS} && \ + cd /opt/kagome/ && export CI='$(CI)' && ./housekeeping/clang-tidy-diff.sh \ + " || DOCKER_EXEC_RESULT=$$? ; \ + if [ $$DOCKER_EXEC_RESULT -ne 0 ]; then \ + echo "Error: Docker exec failed with return code $$DOCKER_EXEC_RESULT"; \ + docker stop $$CONTAINER_NAME; \ + exit $$DOCKER_EXEC_RESULT; \ + fi; \ + docker stop $$CONTAINER_NAME + +kagome_dev_docker_build_tidy: + $(MAKE) get_versions + mkdir -p \ + $(CACHE_DIR)/.cargo/git \ + $(CACHE_DIR)/.cargo/registry \ + $(CACHE_DIR)/.hunter \ + $(CACHE_DIR)/.cache/ccache ; \ + CONTAINER_NAME=kagome_dev_build_$$(openssl rand -hex 6); \ + SHORT_COMMIT_HASH=$$(grep 'short_commit_hash:' commit_hash.txt | cut -d ' ' -f 2); \ + BUILD_THREADS=$$(nproc 2>/dev/null || sysctl -n hw.ncpu); \ + DOCKER_EXEC_RESULT=0 ; \ + echo "Build type: $(BUILD_TYPE)"; \ + docker run -d --name $$CONTAINER_NAME \ + --platform $(PLATFORM) \ + --entrypoint "/bin/bash" \ + -e SHORT_COMMIT_HASH=$$SHORT_COMMIT_HASH \ + -e BUILD_TYPE=$(BUILD_TYPE) \ + -e BUILD_THREADS=$$BUILD_THREADS \ + -e PACKAGE_ARCHITECTURE=$(PACKAGE_ARCHITECTURE) \ + -e GITHUB_HUNTER_USERNAME=$(GITHUB_HUNTER_USERNAME) \ + -e GITHUB_HUNTER_TOKEN=$(GITHUB_HUNTER_TOKEN) \ + -e CTEST_OUTPUT_ON_FAILURE=$(CTEST_OUTPUT_ON_FAILURE) \ + -v $$(pwd)/../../../../kagome:/opt/kagome \ + -v $(CACHE_DIR)/.cargo/git:/root/.cargo/git \ + -v $(CACHE_DIR)/.cargo/registry:/root/.cargo/registry \ + -v $(CACHE_DIR)/.hunter:/root/.hunter \ + -v $(CACHE_DIR)/.cache/ccache:/root/.cache/ccache \ + $(DOCKERHUB_BUILDER_PATH):$(BUILDER_IMAGE_TAG) \ -c "tail -f /dev/null"; \ docker exec -t $$CONTAINER_NAME /bin/bash -c \ "clang --version && \ @@ -180,7 +248,7 @@ upload_apt_package: runtime_cache: CONTAINER_NAME=kagome_dev_runtime_cache_$$(openssl rand -hex 6); \ - RUNTIME_VERSION=$$(python3 get_wasmedge_version.py)-$$(date +'%y.%m.%d'); \ + RUNTIME_VERSION=$$(date +'%y.%m.%d')-$$(python3 get_wasmedge_version.py); \ DOCKER_EXEC_RESULT=0 ; \ echo "Runtime version: $$RUNTIME_VERSION"; \ docker run -d --name $$CONTAINER_NAME \ @@ -191,7 +259,7 @@ runtime_cache: -e GOOGLE_APPLICATION_CREDENTIALS=/root/.gcp/google_creds.json \ -v $$(pwd)/../../../../kagome:/opt/kagome \ -v $(GOOGLE_APPLICATION_CREDENTIALS):/root/.gcp/google_creds.json \ - $(DOCKER_REGISTRY_PATH)zombie_tester:latest \ + $(DOCKER_REGISTRY_PATH)zombie_tester:$(TESTER_LATEST_TAG) \ -c "tail -f /dev/null"; \ docker exec -t $$CONTAINER_NAME /bin/bash -c \ "cd /opt/kagome/zombienet && \ @@ -218,7 +286,7 @@ runtime_cache: docker stop $$CONTAINER_NAME upload_apt_package_runtime: - RUNTIME_VERSION=$$(python3 get_wasmedge_version.py)-$$(date +'%y.%m.%d'); \ + RUNTIME_VERSION=$$(date +'%y.%m.%d')-$$(python3 get_wasmedge_version.py); \ echo "Runtime version: $$RUNTIME_VERSION"; \ gcloud config set artifacts/repository $(ARTIFACTS_REPO); \ gcloud config set artifacts/location $(REGION); \ @@ -241,8 +309,9 @@ kagome_image_build: -t $(DOCKER_REGISTRY_PATH)kagome_$${BUILD_TYPE_LOWER}:$${SHORT_COMMIT_HASH} \ -t $(DOCKER_REGISTRY_PATH)kagome_$${BUILD_TYPE_LOWER}:latest \ --secret id=google_creds,src=$(GOOGLE_APPLICATION_CREDENTIALS) \ - -f minideb.Dockerfile \ - --build-arg BASE_IMAGE=$(MINIDEB_IMAGE) \ + -f kagome_runner.Dockerfile \ + --build-arg BASE_IMAGE=$(OS_IMAGE_NAME) \ + --build-arg BASE_IMAGE_TAG=$(OS_IMAGE_TAG_WITH_HASH) \ --build-arg ARCHITECTURE=$(ARCHITECTURE) \ --build-arg KAGOME_PACKAGE_VERSION=$(KAGOME_PACKAGE_VERSION) \ --build-arg PROJECT_ID=$(PROJECT_ID) \ diff --git a/housekeeping/docker/kagome-dev/build_and_push.sh b/housekeeping/docker/kagome-dev/build_and_push.sh index e5ee0f9f9f..0be1ea2764 100755 --- a/housekeeping/docker/kagome-dev/build_and_push.sh +++ b/housekeeping/docker/kagome-dev/build_and_push.sh @@ -11,5 +11,5 @@ echo "Building in $(pwd)" VERSION=${VERSION:-5} TAG=qdrvm/kagome-dev:$VERSION -docker build -t ${TAG}-minideb -f minideb.Dockerfile . -docker push ${TAG}-minideb +docker build -t ${TAG}-runner -f kagome_runner.Dockerfile . +docker push ${TAG}-runner diff --git a/housekeeping/docker/kagome-dev/install_packages b/housekeeping/docker/kagome-dev/install_packages new file mode 100644 index 0000000000..c957764744 --- /dev/null +++ b/housekeeping/docker/kagome-dev/install_packages @@ -0,0 +1,24 @@ +#!/bin/sh +set -e +set -u +export DEBIAN_FRONTEND=noninteractive +n=0 +max=2 +until [ $n -gt $max ]; do + set +e + ( + apt-get update -qq && + apt-get install -y --no-install-recommends "$@" + ) + CODE=$? + set -e + if [ $CODE -eq 0 ]; then + break + fi + if [ $n -eq $max ]; then + exit $CODE + fi + echo "apt failed, retrying" + n=$(($n + 1)) +done +rm -r /var/lib/apt/lists /var/cache/apt/archives diff --git a/housekeeping/docker/kagome-dev/kagome_builder_deb.Dockerfile b/housekeeping/docker/kagome-dev/kagome_builder.Dockerfile similarity index 84% rename from housekeeping/docker/kagome-dev/kagome_builder_deb.Dockerfile rename to housekeeping/docker/kagome-dev/kagome_builder.Dockerfile index ee24636838..c91b1dcc68 100644 --- a/housekeeping/docker/kagome-dev/kagome_builder_deb.Dockerfile +++ b/housekeeping/docker/kagome-dev/kagome_builder.Dockerfile @@ -1,24 +1,29 @@ ARG AUTHOR="k.azovtsev@qdrvm.io " ARG BASE_IMAGE -ARG RUST_VERSION +ARG BASE_IMAGE_TAG ARG ARCHITECTURE=x86_64 -ARG DEBIAN_VERSION=bookworm -ARG LLVM_VERSION=19 -ARG GCC_VERSION=13 +ARG OS_REL_VERSION=noble + +ARG RUST_VERSION +ARG LLVM_VERSION +ARG GCC_VERSION -FROM ${BASE_IMAGE} +FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} ARG AUTHOR ENV AUTHOR=${AUTHOR} LABEL org.opencontainers.image.authors="${AUTHOR}" LABEL org.opencontainers.image.description="Kagome builder image" -SHELL ["/bin/bash", "-c"] +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +COPY install_packages /usr/sbin/install_packages +RUN chmod 0755 /usr/sbin/install_packages -ARG DEBIAN_VERSION -ENV DEBIAN_VERSION=${DEBIAN_VERSION} +ARG OS_REL_VERSION +ENV OS_REL_VERSION=${OS_REL_VERSION} ARG LLVM_VERSION ENV LLVM_VERSION=${LLVM_VERSION} ARG GCC_VERSION @@ -30,10 +35,9 @@ RUN install_packages \ gnupg \ wget -RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg -RUN echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain-${DEBIAN_VERSION}-${LLVM_VERSION} main" | \ +RUN wget --progress=dot:giga -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg +RUN echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${OS_REL_VERSION}/ llvm-toolchain-${OS_REL_VERSION}-${LLVM_VERSION} main" | \ tee -a /etc/apt/sources.list.d/llvm.list -RUN echo "deb http://deb.debian.org/debian/ trixie main" | tee -a /etc/apt/sources.list RUN install_packages \ build-essential \ diff --git a/housekeeping/docker/kagome-dev/minideb.Dockerfile b/housekeeping/docker/kagome-dev/kagome_runner.Dockerfile similarity index 87% rename from housekeeping/docker/kagome-dev/minideb.Dockerfile rename to housekeeping/docker/kagome-dev/kagome_runner.Dockerfile index ffbaaed3e3..be481d63c2 100644 --- a/housekeeping/docker/kagome-dev/minideb.Dockerfile +++ b/housekeeping/docker/kagome-dev/kagome_runner.Dockerfile @@ -1,6 +1,7 @@ ARG AUTHOR="k.azovtsev@qdrvm.io " ARG BASE_IMAGE +ARG BASE_IMAGE_TAG ARG PROJECT_ID @@ -9,15 +10,19 @@ ARG ARCHITECTURE=x86_64 ARG KAGOME_PACKAGE_VERSION -FROM ${BASE_IMAGE} AS base +FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS base ARG AUTHOR ENV AUTHOR=${AUTHOR} LABEL org.opencontainers.image.authors="${AUTHOR}" LABEL org.opencontainers.image.description="Kagome image" +COPY install_packages /usr/sbin/install_packages +RUN chmod 0755 /usr/sbin/install_packages + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + RUN install_packages \ - bash \ software-properties-common \ curl \ wget \ @@ -26,8 +31,6 @@ RUN install_packages \ gpg-agent \ tini -SHELL ["/bin/bash", "-c"] - # Setup enterprise repository ARG REGION @@ -65,10 +68,10 @@ RUN --mount=type=secret,id=google_creds,target=/root/.gcp/google_creds.json \ kagome-dev=${KAGOME_PACKAGE_VERSION} && \ sed -i '1s/^/#/' /etc/apt/sources.list.d/kagome.list -# temporary fix for libc6 (gcc-13) -# TODO: remove when CI swithed to trixie -RUN echo "deb http://deb.debian.org/debian/ trixie main" | tee -a /etc/apt/sources.list && apt update -RUN apt install -y libc6 libstdc++6 libgcc-s1 -t trixie +RUN install_packages \ + libc6 \ + libstdc++6 \ + libgcc-s1 CMD ["/usr/bin/tini", "--", "/bin/bash", "-c"] diff --git a/zombienet/docker/Makefile b/zombienet/docker/Makefile index 9909bfc9cf..88ec52ce3b 100644 --- a/zombienet/docker/Makefile +++ b/zombienet/docker/Makefile @@ -1,16 +1,26 @@ # Shared Environment Variables # bookworm (Debian 12) MINIDEB_IMAGE=bitnami/minideb@sha256:6cc3baf349947d587a9cd4971e81ff3ffc0d17382f2b5b6de63d6542bff10c16 +OS_IMAGE_NAME ?= ubuntu +OS_IMAGE_TAG ?= 24.04 +OS_IMAGE_HASH ?= 99c35190e22d294cdace2783ac55effc69d32896daaa265f0bbedbcde4fbe3e5 ## DOCKER_REGISTRY_PATH empty for local usage DOCKER_REGISTRY_PATH ?= GOOGLE_APPLICATION_CREDENTIALS ?= PLATFORM ?= linux/amd64 ARCHITECTURE ?= amd64 +# Generated versions +OS_IMAGE ?= $(OS_IMAGE_NAME):$(OS_IMAGE_TAG)@sha256:$(OS_IMAGE_HASH) +OS_IMAGE_TAG_WITH_HASH := $(OS_IMAGE_TAG)@sha256:$(OS_IMAGE_HASH) +OS_IMAGE_SHORT_HASH := $(shell echo $(OS_IMAGE_HASH) | cut -c1-7) + # polkadot_builder Variables POLKADOT_SDK_TAG ?= -RUST_IMAGE=rust:1.81-slim-bookworm +RUST_VERSION ?= 1.81.0 SCCACHE_VERSION ?= 0.7.4 +BUILDER_LATEST_TAG ?= latest +TESTER_LATEST_TAG ?= latest # polkadot_binary Variables SCCACHE_GCS_BUCKET ?= @@ -34,7 +44,8 @@ HOST_LOGS_PATH ?= /tmp/test_logs CONTAINER_NAME ?= zombienet-test # tests Variables -ZOMBIE_TESTER_IMAGE ?= zombie_tester:latest +ZOMBIE_TESTER_IMAGE_TAG ?= latest +ZOMBIE_TESTER_IMAGE ?= zombie_tester:$(ZOMBIE_TESTER_IMAGE_TAG) KAGOME_PACKAGE_VERSION ?= WORKING_DIR := $(shell pwd)/../../../kagome DELETE_IMAGE_AFTER_TEST ?= true @@ -101,9 +112,11 @@ polkadot_builder: POLKADOT_SDK_RELEASE=$$(grep 'polkadot_format_version:' polkadot-sdk-versions.txt | cut -d ' ' -f 2); \ docker build --platform $(PLATFORM) \ -t $(DOCKER_REGISTRY_PATH)polkadot_builder:$$POLKADOT_SDK_RELEASE \ - -t $(DOCKER_REGISTRY_PATH)polkadot_builder:latest \ + -t $(DOCKER_REGISTRY_PATH)polkadot_builder:$(BUILDER_LATEST_TAG) \ -f polkadot_builder.Dockerfile \ - --build-arg RUST_IMAGE=$(RUST_IMAGE) \ + --build-arg RUST_VERSION=$(RUST_VERSION) \ + --build-arg BASE_IMAGE=$(OS_IMAGE_NAME) \ + --build-arg BASE_IMAGE_TAG=$(OS_IMAGE_TAG_WITH_HASH) \ --build-arg SCCACHE_VERSION=$(SCCACHE_VERSION) \ --build-arg POLKADOT_SDK_RELEASE=$$POLKADOT_SDK_RELEASE . ; \ else \ @@ -114,7 +127,7 @@ polkadot_builder_push: if [ -f polkadot-sdk-versions.txt ]; then \ POLKADOT_SDK_RELEASE=$$(grep 'polkadot_format_version:' polkadot-sdk-versions.txt | cut -d ' ' -f 2); \ docker push $(DOCKER_REGISTRY_PATH)polkadot_builder:$$POLKADOT_SDK_RELEASE ; \ - docker push $(DOCKER_REGISTRY_PATH)polkadot_builder:latest ; \ + docker push $(DOCKER_REGISTRY_PATH)polkadot_builder:$(BUILDER_LATEST_TAG) ; \ else \ echo "One or more files are missing."; \ fi @@ -185,12 +198,14 @@ zombie_tester: docker build \ --platform $(PLATFORM) \ --no-cache \ - -t $(DOCKER_REGISTRY_PATH)zombie_tester:latest \ + -t $(DOCKER_REGISTRY_PATH)zombie_tester:$(TESTER_LATEST_TAG) \ -t $(DOCKER_REGISTRY_PATH)zombie_tester:$${POLKADOT_SDK_RELEASE}_$${ZOMBIENET_RELEASE} \ --secret id=google_creds,src=$(GOOGLE_APPLICATION_CREDENTIALS) \ -f zombie_tester.Dockerfile \ - --build-arg BASE_IMAGE=$(MINIDEB_IMAGE) \ + --build-arg BASE_IMAGE=$(OS_IMAGE_NAME) \ + --build-arg BASE_IMAGE_TAG=$(OS_IMAGE_TAG_WITH_HASH) \ --build-arg PROJECT_ID=$$PROJECT_ID \ + --build-arg RUST_VERSION=$(RUST_VERSION) \ --build-arg POLKADOT_BINARY_PACKAGE_VERSION="$(POLKADOT_BINARY_PACKAGE_VERSION)" \ --build-arg ZOMBIENET_RELEASE=$$ZOMBIENET_RELEASE \ --build-arg POLKADOT_SDK_RELEASE=$$POLKADOT_SDK_RELEASE . ; \ @@ -203,7 +218,7 @@ zombie_tester_push: ZOMBIENET_RELEASE=$$(grep 'short_version:' zombienet-versions.txt | cut -d ' ' -f 2); \ POLKADOT_SDK_RELEASE=$$(grep 'polkadot_format_version:' polkadot-sdk-versions.txt | cut -d ' ' -f 2); \ docker push $(DOCKER_REGISTRY_PATH)zombie_tester:$${POLKADOT_SDK_RELEASE}_$${ZOMBIENET_RELEASE} ; \ - docker push $(DOCKER_REGISTRY_PATH)zombie_tester:latest ; \ + docker push $(DOCKER_REGISTRY_PATH)zombie_tester:$(TESTER_LATEST_TAG) ; \ else \ echo "One or more files are missing."; \ fi diff --git a/zombienet/docker/install_packages b/zombienet/docker/install_packages new file mode 100644 index 0000000000..c957764744 --- /dev/null +++ b/zombienet/docker/install_packages @@ -0,0 +1,24 @@ +#!/bin/sh +set -e +set -u +export DEBIAN_FRONTEND=noninteractive +n=0 +max=2 +until [ $n -gt $max ]; do + set +e + ( + apt-get update -qq && + apt-get install -y --no-install-recommends "$@" + ) + CODE=$? + set -e + if [ $CODE -eq 0 ]; then + break + fi + if [ $n -eq $max ]; then + exit $CODE + fi + echo "apt failed, retrying" + n=$(($n + 1)) +done +rm -r /var/lib/apt/lists /var/cache/apt/archives diff --git a/zombienet/docker/polkadot_builder.Dockerfile b/zombienet/docker/polkadot_builder.Dockerfile index 6f2dec11e0..3ae7dbb468 100644 --- a/zombienet/docker/polkadot_builder.Dockerfile +++ b/zombienet/docker/polkadot_builder.Dockerfile @@ -1,12 +1,14 @@ ARG AUTHOR="k.azovtsev@qdrvm.io " +ARG BASE_IMAGE +ARG BASE_IMAGE_TAG ARG ARCHITECTURE=x86_64 -ARG SCCACHE_VERSION +ARG SCCACHE_VERSION ARG POLKADOT_SDK_RELEASE -ARG RUST_IMAGE +ARG RUST_VERSION -FROM ${RUST_IMAGE} AS polkadot-sdk-builder +FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS polkadot-sdk-builder ARG AUTHOR ENV AUTHOR=${AUTHOR} @@ -14,25 +16,33 @@ LABEL org.opencontainers.image.authors="${AUTHOR}" LABEL org.opencontainers.image.description="Polkadot SDK builder image" WORKDIR /home/nonroot/ -SHELL ["/bin/bash", "-c"] +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +COPY install_packages /usr/sbin/install_packages +RUN chmod 0755 /usr/sbin/install_packages ARG POLKADOT_SDK_RELEASE ENV POLKADOT_SDK_RELEASE=$POLKADOT_SDK_RELEASE -RUN apt-get update && \ - apt-get install --no-install-recommends --yes \ - git \ - wget \ - openssl \ - ca-certificates \ - build-essential \ - clang \ - protobuf-compiler \ - libprotobuf-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN rustup default stable && \ +RUN install_packages \ + git \ + wget \ + curl \ + openssl \ + ca-certificates \ + build-essential \ + clang \ + protobuf-compiler \ + libprotobuf-dev + +ARG RUST_VERSION +ENV RUST_VERSION=${RUST_VERSION} +ENV RUSTUP_HOME=/root/.rustup +ENV CARGO_HOME=/root/.cargo +ENV PATH="${CARGO_HOME}/bin:${PATH}" +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST_VERSION} + +RUN rustup default ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown && \ rustup component add rust-src @@ -43,10 +53,12 @@ ENV SCCACHE_VERSION=$SCCACHE_VERSION ARG ARCHITECTURE ENV ARCHITECTURE=$ARCHITECTURE +RUN mkdir -p /tmp/download + +WORKDIR /tmp/download + # Version >0.7.4 has a bug - work with GCS is broken -RUN mkdir -p /tmp/download && \ - cd /tmp/download && \ - wget -q -O sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-${ARCHITECTURE}-unknown-linux-musl.tar.gz && \ +RUN wget -q -O sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-${ARCHITECTURE}-unknown-linux-musl.tar.gz && \ tar xzf sccache.tar.gz && \ ls -la && \ mv sccache-v*/sccache /usr/local/bin/sccache && \ diff --git a/zombienet/docker/zombie_tester.Dockerfile b/zombienet/docker/zombie_tester.Dockerfile index bc71b0dd10..e8c4776a54 100644 --- a/zombienet/docker/zombie_tester.Dockerfile +++ b/zombienet/docker/zombie_tester.Dockerfile @@ -1,7 +1,8 @@ ARG AUTHOR="k.azovtsev@qdrvm.io " ARG BASE_IMAGE -ARG RUST_VERSION=1.81.0 +ARG BASE_IMAGE_TAG +ARG RUST_VERSION ARG PROJECT_ID ARG POLKADOT_BINARY_PACKAGE_VERSION @@ -12,7 +13,7 @@ ARG REGION=europe-north1 ARG ARCHITECTURE=x86_64 -FROM ${BASE_IMAGE} as zombie-tester +FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS zombie-tester ARG AUTHOR ENV AUTHOR=${AUTHOR} @@ -24,6 +25,11 @@ ENV ZOMBIENET_RELEASE=$ZOMBIENET_RELEASE ARG POLKADOT_SDK_RELEASE ENV POLKADOT_SDK_RELEASE=$POLKADOT_SDK_RELEASE +COPY install_packages /usr/sbin/install_packages +RUN chmod 0755 /usr/sbin/install_packages + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + RUN groupadd --gid 10000 nonroot && \ useradd --home-dir /home/nonroot \ --create-home \ @@ -35,14 +41,12 @@ RUN groupadd --gid 10000 nonroot && \ WORKDIR /home/nonroot/ RUN install_packages \ - bash \ wget \ nano \ ca-certificates \ gnupg2 \ curl -SHELL ["/bin/bash", "-c"] RUN mkdir -p /home/nonroot/bin @@ -99,14 +103,14 @@ RUN zombienet setup -y polkadot polkadot-parachain; \ exit $EXIT_CODE; \ fi; -RUN ./polkadot --version && \ - ./polkadot-parachain --version && \ - ./zombienet version && \ - ./polkadot-execute-worker --version && \ - ./polkadot-prepare-worker --version && \ - malus --version && \ - adder-collator --version && \ - undying-collator --version +RUN echo "Polkadot Version:" && ./polkadot --version && \ + echo "Polkadot Parachain Version:" && ./polkadot-parachain --version && \ + echo "Zombienet Version:" && ./zombienet version && \ + echo "Polkadot Execute Worker Version:" && ./polkadot-execute-worker --version && \ + echo "Polkadot Prepare Worker Version:" && ./polkadot-prepare-worker --version && \ + echo "Malus Version:" && malus --version && \ + echo "Adder Collator Version:" && adder-collator --version && \ + echo "Undying Collator Version:" && undying-collator --version RUN ln -s /home/nonroot/bin/zombienet-linux-x64 /usr/local/bin/zombienet && \ ln -s /home/nonroot/bin/polkadot /usr/local/bin/polkadot && \ @@ -127,9 +131,7 @@ RUN install_packages \ libtinfo6 \ libseccomp2 \ libatomic1 \ - ssh - -# temporary fix for libc6 (gcc-13) -# TODO: remove when CI swithed to trixie -RUN echo "deb http://deb.debian.org/debian/ trixie main" | tee -a /etc/apt/sources.list && apt update -RUN apt install -y libc6 libstdc++6 libgcc-s1 -t trixie + ssh \ + libc6 \ + libstdc++6 \ + libgcc-s1