Skip to content

Commit

Permalink
skip jobs (polkadot builder workflow)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Azovtsev committed Feb 3, 2025
1 parent e4449c9 commit 57f3a93
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 16 deletions.
45 changes: 35 additions & 10 deletions .github/workflows/zombie-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,28 +80,41 @@ jobs:
env:
PLATFORM: ${{ matrix.platform }}
steps:
- name: "Сheck if polkadot_builder is required"
run: |
if [ "${{ github.event.inputs.polkadot_builder }}" != "true" ]; then
echo "Polkadot Builder is not required"
echo "skip=true" >> $GITHUB_ENV
fi
- name: Checkout repository
if: env.skip != 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch master branch
if: env.skip != 'true'
run: git fetch origin master:master

- name : "Authenticate with Google Cloud"
if: env.skip != 'true'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}

- name: "Set up Cloud SDK"
if: env.skip != 'true'
uses: 'google-github-actions/setup-gcloud@v2'

- name: "Configure Docker for GCR"
if: env.skip != 'true'
run: |
gcloud auth configure-docker --quiet
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet
- name: "Check if image tag exists using Makefile"
if: env.skip != 'true'
id: check-tag
working-directory: ./zombienet/docker
run: |
Expand All @@ -112,11 +125,11 @@ jobs:
- name: "Build Polkadot Builder"
working-directory: ./zombienet/docker
if: env.exists == 'false' || github.event.inputs.polkadot_builder == 'true'
if: env.exists == 'false' || env.skip != 'true'
run: make polkadot_builder && make polkadot_builder_push

- name: "Versions Info"
if: always()
if: always() && env.skip != 'true'
working-directory: ./zombienet/docker
run: |
make polkadot_builder_image_info
Expand All @@ -126,28 +139,41 @@ jobs:
timeout-minutes: 60
needs: [build_polkadot_builder]
steps:
- name: "Сheck if polkadot_builder is required"
run: |
if [ "${{ github.event.inputs.polkadot_builder }}" != "true" ]; then
echo "Polkadot Builder is not required"
echo "skip=true" >> $GITHUB_ENV
fi
- name: Checkout repository
if: env.skip != 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch master branch
if: env.skip != 'true'
run: git fetch origin master:master

- name : "Authenticate with Google Cloud"
if: env.skip != 'true'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}

- name: "Set up Cloud SDK"
if: env.skip != 'true'
uses: 'google-github-actions/setup-gcloud@v2'

- name: "Configure Docker for GCR"
if: env.skip != 'true'
run: |
gcloud auth configure-docker --quiet
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet
- name: "Check if image tag exists using Makefile"
if: env.skip != 'true'
id: check-tag
working-directory: ./zombienet/docker
run: |
Expand All @@ -158,17 +184,18 @@ jobs:
- name: "Build Polkadot Builder"
working-directory: ./zombienet/docker
if: env.exists == 'false' || github.event.inputs.polkadot_builder == 'true'
if: env.exists == 'false' || env.skip != 'true'
run: make polkadot_builder_push_manifest

- name: "Versions Info"
if: always()
if: always() && env.skip != 'true'
working-directory: ./zombienet/docker
run: |
make polkadot_builder_image_info

building_binaries:
if: github.event.inputs.polkadot_binaries == 'true'
runs-on: [ self-hosted, qdrvm-arm64 ]
# runs-on: ${{ matrix.os }}
# strategy:
Expand All @@ -192,10 +219,10 @@ jobs:
- name: Fetch master branch
run: git fetch origin master:master

- uses: actions/cache@v4
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ runner.os }}-rust-${{ env.CACHE_VERSION }}
# - uses: actions/cache@v4
# with:
# path: ${{ env.CACHE_PATHS }}
# key: ${{ runner.os }}-rust-${{ env.CACHE_VERSION }}

- name: "Authenticate with Google Cloud"
uses: 'google-github-actions/auth@v2'
Expand All @@ -211,12 +238,10 @@ jobs:
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet
- name: "Build target"
if: github.event.inputs.polkadot_binaries == 'true'
working-directory: ./zombienet/docker
run: make polkadot_binary

- name: "Push Polkadot APT Package"
if: github.event.inputs.polkadot_binaries == 'true'
working-directory: ./zombienet/docker
run: make upload_apt_package

Expand Down
10 changes: 6 additions & 4 deletions zombienet/docker/Makefile.include/polkadot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docker_run: set_versions docker_start_clean
docker run -d --name $(POLKADOT_BUILD_CONTAINER_NAME) \
--platform $(PLATFORM) \
--entrypoint "/bin/bash" \
--user root \
-e RUSTC_WRAPPER=sccache \
-e SCCACHE_GCS_RW_MODE=READ_WRITE \
-e SCCACHE_VERSION=$(SCCACHE_VERSION) \
Expand All @@ -61,15 +62,16 @@ docker_run: set_versions docker_start_clean
-e ARCHITECTURE=$(ARCHITECTURE) \
-e POLKADOT_SDK_RELEASE=$(POLKADOT_SDK_RELEASE) \
-v $(GOOGLE_APPLICATION_CREDENTIALS):$(IN_DOCKER_WORKING_DIR)/.gcp/google_creds.json \
-v ./$(DOCKER_BUILD_DIR_NAME)/polkadot_binary:/tmp/polkadot_binary \
-v ./$(DOCKER_BUILD_DIR_NAME)/cargo/registry:$(IN_DOCKER_WORKING_DIR)/.cargo/registry/ \
-v ./$(DOCKER_BUILD_DIR_NAME)/cargo/git:$(IN_DOCKER_WORKING_DIR)/.cargo/git/ \
-v ./build_apt_package.sh:$(IN_DOCKER_WORKING_DIR)/build_apt_package.sh \
-v ./$(DOCKER_BUILD_DIR_NAME)/home:$(IN_DOCKER_WORKING_DIR) \
-v ./$(DOCKER_BUILD_DIR_NAME)/tmp:/tmp/ \
-v ./build_apt_package.sh:$(IN_DOCKER_WORKING_DIR)/build_apt_package.sh \
$(DOCKER_REGISTRY_PATH)polkadot_builder:$(BUILDER_LATEST_TAG) \
-c "tail -f /dev/null"

# -v ./$(DOCKER_BUILD_DIR_NAME)/cargo/registry:$(IN_DOCKER_WORKING_DIR)/.cargo/registry/ \
# -v ./$(DOCKER_BUILD_DIR_NAME)/cargo/git:$(IN_DOCKER_WORKING_DIR)/.cargo/git/ \
# -v ./$(DOCKER_BUILD_DIR_NAME)/polkadot_binary:/tmp/polkadot_binary \
docker_exec: set_versions
docker exec -t $(POLKADOT_BUILD_CONTAINER_NAME) /bin/bash -c \
"git config --global --add safe.directory \"*\" ; \
Expand Down
4 changes: 2 additions & 2 deletions zombienet/docker/Makefile.include/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ GOOGLE_APPLICATION_CREDENTIALS ?=
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)
USER_ID = 5555 #$(shell id -u)
GROUP_ID = 5555 #$(shell id -g)
USER_ID = 5555
GROUP_ID = 5555

# polkadot_builder Variables
POLKADOT_SDK_TAG ?=
Expand Down

0 comments on commit 57f3a93

Please sign in to comment.