From 9048b484d96e1db47cf1953b14d676cab0a6635e Mon Sep 17 00:00:00 2001 From: Yin Guanhao Date: Wed, 19 Jul 2023 16:35:47 +0800 Subject: [PATCH 1/5] Prepare for godwoken update --- .github/workflows/docker-publish.yml | 3 ++- Dockerfile.fast | 25 ++++++++----------------- Makefile | 2 +- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1e69957..faa6972 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -18,7 +18,8 @@ env: jobs: docker-build-push: - runs-on: ubuntu-latest + # Same as image base + runs-on: ubuntu-20.04 # Map the meta step outputs to this job outputs outputs: image_name: ${{ steps.result.outputs.image_name }} diff --git a/Dockerfile.fast b/Dockerfile.fast index 930a99a..6f02c42 100644 --- a/Dockerfile.fast +++ b/Dockerfile.fast @@ -1,10 +1,8 @@ -FROM ubuntu:21.04 +FROM ubuntu:20.04 RUN mkdir -p /scripts/godwoken-scripts \ && mkdir -p /scripts/godwoken-polyjuice \ - && mkdir -p /scripts/clerkb \ - && mkdir /ckb \ - && mkdir /ckb-indexer + && mkdir -p /scripts/clerkb RUN apt-get update \ && apt-get dist-upgrade -y \ @@ -12,21 +10,14 @@ RUN apt-get update \ && apt-get clean \ && echo 'Finished installing OS updates' -# ckb -RUN cd /ckb \ - && curl -LO https://github.com/nervosnetwork/ckb/releases/download/v0.101.7/ckb_v0.101.7_x86_64-unknown-linux-gnu.tar.gz \ - && tar xzf ckb_v0.101.7_x86_64-unknown-linux-gnu.tar.gz \ - && cp ckb_v0.101.7_x86_64-unknown-linux-gnu/ckb /bin/ckb \ - && cp ckb_v0.101.7_x86_64-unknown-linux-gnu/ckb-cli /bin/ckb-cli \ +# Install ckb and ckb-cli. +RUN mkdir -p /ckb && cd /ckb \ + && curl -LO https://github.com/nervosnetwork/ckb/releases/download/v0.111.0-rc8/ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable.tar.gz \ + && tar xzf ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable.tar.gz \ + && cp ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable/ckb /bin/ \ + && cp ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable/ckb-cli /bin/ \ && rm -rf /ckb -# ckb-indexer -RUN cd /ckb-indexer \ - && curl -LO https://github.com/nervosnetwork/ckb-indexer/releases/download/v0.3.2/ckb-indexer-0.3.2-linux.zip \ - && unzip ckb-indexer-0.3.2-linux.zip && tar xzf ckb-indexer-linux-x86_64.tar.gz \ - && cp /ckb-indexer/ckb-indexer /bin/ckb-indexer \ - && rm -rf /ckb-indexer - # /scripts/clerkb COPY build/clerkb/build/debug/poa /scripts/clerkb/ COPY build/clerkb/build/debug/state /scripts/clerkb/ diff --git a/Makefile b/Makefile index 154208c..9836a27 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ POLYJUICE_REPO := https://github.com/nervosnetwork/godwoken-polyjuice.git CLERKB_REPO := https://github.com/nervosnetwork/clerkb.git # components tags -GODWOKEN_REF := v0.10.7 # https://github.com/nervosnetwork/godwoken/releases/tag/v0.10.7 +GODWOKEN_REF := refs/pull/1084/merge GODWOKEN_SCRIPTS_REF := v0.9.0 # https://github.com/nervosnetwork/godwoken-scripts/releases/tag/v0.9.0 POLYJUICE_REF := 0.8.14 # https://github.com/nervosnetwork/godwoken-polyjuice/releases/tag/0.8.14 CLERKB_REF := v0.4.0 From a207eb3bc0972e65a2d9bccfa2a647d11cdd873c Mon Sep 17 00:00:00 2001 From: Yin Guanhao Date: Wed, 19 Jul 2023 16:46:15 +0800 Subject: [PATCH 2/5] Skip building godwoken-scripts for now --- .github/workflows/docker-publish.yml | 29 ++++++++++++++-------------- Dockerfile.fast | 12 +++++++----- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index faa6972..634b287 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -98,20 +98,21 @@ jobs: working-directory: build/clerkb run: yarn && make all-via-docker - - name: Cache of component.godwoken-scripts - id: godwoken-scripts-cache - uses: actions/cache@v3 - with: - path: | - build/godwoken-scripts/build/release/* - build/godwoken-scripts/c/build/*-generator - build/godwoken-scripts/c/build/*-validator - build/godwoken-scripts/c/build/account_locks/* - key: component.godwoken-scripts-${{ steps.prepare.outputs.godwoken-scripts-sha1 }} - - name: Build godwoken-scripts - if: steps.godwoken-scripts-cache.outputs.cache-hit != 'true' - working-directory: build/godwoken-scripts - run: cd c && make && cd .. && capsule build --release --debug-output + # Skip building godwoken-scripts for now. + # - name: Cache of component.godwoken-scripts + # id: godwoken-scripts-cache + # uses: actions/cache@v3 + # with: + # path: | + # build/godwoken-scripts/build/release/* + # build/godwoken-scripts/c/build/*-generator + # build/godwoken-scripts/c/build/*-validator + # build/godwoken-scripts/c/build/account_locks/* + # key: component.godwoken-scripts-${{ steps.prepare.outputs.godwoken-scripts-sha1 }} + # - name: Build godwoken-scripts + # if: steps.godwoken-scripts-cache.outputs.cache-hit != 'true' + # working-directory: build/godwoken-scripts + # run: cd c && make && cd .. && capsule build --release --debug-output - name: Cache of component.godwoken-polyjuice id: godwoken-polyjuice-cache diff --git a/Dockerfile.fast b/Dockerfile.fast index 6f02c42..2490afc 100644 --- a/Dockerfile.fast +++ b/Dockerfile.fast @@ -22,11 +22,13 @@ RUN mkdir -p /ckb && cd /ckb \ COPY build/clerkb/build/debug/poa /scripts/clerkb/ COPY build/clerkb/build/debug/state /scripts/clerkb/ -# /scripts/godwoken-scripts -COPY build/godwoken-scripts/build/release/* /scripts/godwoken-scripts/ -COPY build/godwoken-scripts/c/build/*-generator /scripts/godwoken-scripts/ -COPY build/godwoken-scripts/c/build/*-validator /scripts/godwoken-scripts/ -COPY build/godwoken-scripts/c/build/account_locks/* /scripts/godwoken-scripts/ +# Copy from previous image because godwoken-scripts cannot be built as is. +COPY --from=ghcr.io/nervosnetwork/godwoken-prebuilds:v0.10.7 /scripts/godwoken-scripts /scripts/godwoken-scripts +# # /scripts/godwoken-scripts +# COPY build/godwoken-scripts/build/release/* /scripts/godwoken-scripts/ +# COPY build/godwoken-scripts/c/build/*-generator /scripts/godwoken-scripts/ +# COPY build/godwoken-scripts/c/build/*-validator /scripts/godwoken-scripts/ +# COPY build/godwoken-scripts/c/build/account_locks/* /scripts/godwoken-scripts/ # /scripts/godwoken-polyjuice COPY build/godwoken-polyjuice/build/*generator* /scripts/godwoken-polyjuice/ From 5ee9507434c0e822c738b77e419c84360e6fa884 Mon Sep 17 00:00:00 2001 From: Yin Guanhao Date: Wed, 19 Jul 2023 23:21:04 +0800 Subject: [PATCH 3/5] Fix workflow and use thin LTO, PORTABLE --- .github/workflows/docker-publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 634b287..56accf1 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -147,7 +147,11 @@ jobs: - name: Build godwoken if: steps.godwoken-cache.outputs.cache-hit != 'true' working-directory: build/godwoken - run: rustup component add rustfmt && CARGO_PROFILE_RELEASE_LTO=true cargo build --release + env: + # For ckb-rocksdb. + PORTABLE: true + CARGO_PROFILE_RELEASE_LTO: thin + run: rustup component add rustfmt && cargo build --release # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action @@ -210,7 +214,6 @@ jobs: docker run --rm ${{ env.IMAGE }} gw-tools --version docker run --rm ${{ env.IMAGE }} ckb --version docker run --rm ${{ env.IMAGE }} ckb-cli --version - docker run --rm ${{ env.IMAGE }} ckb-indexer --version docker run --rm ${{ env.IMAGE }} find /scripts -type f -exec sha1sum {} \; - name: Record image info to the outputs of this jobs From 4096a06deb3cc9024278e33ee788145259ff9d57 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:07:30 +0000 Subject: [PATCH 4/5] Build Godwoken 0.11.0 https://github.com/godwokenrises/godwoken/tree/v0.11.0 --- .github/workflows/docker-publish.yml | 31 ++++++++++++++-------------- Dockerfile.fast | 16 +++++++------- Makefile | 2 +- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 56accf1..458a1f7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -5,9 +5,9 @@ on: # schedule: # - cron: '22 3 * * *' push: - branches: [ main, 'v0.10*', '0.10*' ] + branches: [ main, 'v0.11*', '0.11*' ] # Publish semver tags as releases. - tags: [ 'v*.*.*', '0.10.*', '1.*' ] + tags: [ 'v*.*.*', '0.11.*', '1.*' ] env: # Use docker.io for Docker Hub if empty @@ -98,7 +98,7 @@ jobs: working-directory: build/clerkb run: yarn && make all-via-docker - # Skip building godwoken-scripts for now. + # Skip building godwoken-scripts because Godwoken v0 is in maintenance mode with no change. # - name: Cache of component.godwoken-scripts # id: godwoken-scripts-cache # uses: actions/cache@v3 @@ -114,18 +114,19 @@ jobs: # working-directory: build/godwoken-scripts # run: cd c && make && cd .. && capsule build --release --debug-output - - name: Cache of component.godwoken-polyjuice - id: godwoken-polyjuice-cache - uses: actions/cache@v3 - with: - path: | - build/godwoken-polyjuice/build/*generator* - build/godwoken-polyjuice/build/*validator* - key: component.godwoken-polyjuice-${{ steps.prepare.outputs.godwoken-polyjuice-sha1 }} - - name: Build godwoken-polyjuice - if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true' - working-directory: build/godwoken-polyjuice - run: make all-via-docker + # Skip building godwoken-polyjuice because Godwoken v0 is in maintenance mode with no change. + # - name: Cache of component.godwoken-polyjuice + # id: godwoken-polyjuice-cache + # uses: actions/cache@v3 + # with: + # path: | + # build/godwoken-polyjuice/build/*generator* + # build/godwoken-polyjuice/build/*validator* + # key: component.godwoken-polyjuice-${{ steps.prepare.outputs.godwoken-polyjuice-sha1 }} + # - name: Build godwoken-polyjuice + # if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true' + # working-directory: build/godwoken-polyjuice + # run: make all-via-docker - name: Cache of component.godwoken id: godwoken-cache diff --git a/Dockerfile.fast b/Dockerfile.fast index 2490afc..42c9735 100644 --- a/Dockerfile.fast +++ b/Dockerfile.fast @@ -12,10 +12,10 @@ RUN apt-get update \ # Install ckb and ckb-cli. RUN mkdir -p /ckb && cd /ckb \ - && curl -LO https://github.com/nervosnetwork/ckb/releases/download/v0.111.0-rc8/ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable.tar.gz \ - && tar xzf ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable.tar.gz \ - && cp ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable/ckb /bin/ \ - && cp ckb_v0.111.0-rc8_x86_64-unknown-linux-gnu-portable/ckb-cli /bin/ \ + && curl -LO https://github.com/nervosnetwork/ckb/releases/download/v0.111.0/ckb_v0.111.0_x86_64-unknown-linux-gnu-portable.tar.gz \ + && tar xzf ckb_v0.111.0_x86_64-unknown-linux-gnu-portable.tar.gz \ + && cp ckb_v0.111.0_x86_64-unknown-linux-gnu-portable/ckb /bin/ \ + && cp ckb_v0.111.0_x86_64-unknown-linux-gnu-portable/ckb-cli /bin/ \ && rm -rf /ckb # /scripts/clerkb @@ -24,15 +24,17 @@ COPY build/clerkb/build/debug/state /scripts/clerkb/ # Copy from previous image because godwoken-scripts cannot be built as is. COPY --from=ghcr.io/nervosnetwork/godwoken-prebuilds:v0.10.7 /scripts/godwoken-scripts /scripts/godwoken-scripts -# # /scripts/godwoken-scripts +# /scripts/godwoken-scripts # COPY build/godwoken-scripts/build/release/* /scripts/godwoken-scripts/ # COPY build/godwoken-scripts/c/build/*-generator /scripts/godwoken-scripts/ # COPY build/godwoken-scripts/c/build/*-validator /scripts/godwoken-scripts/ # COPY build/godwoken-scripts/c/build/account_locks/* /scripts/godwoken-scripts/ +# Copy from previous image because godwoken-scripts cannot be built as is. +COPY --from=ghcr.io/nervosnetwork/godwoken-prebuilds:v0.10.7 /scripts/godwoken-polyjuice /scripts/godwoken-polyjuice # /scripts/godwoken-polyjuice -COPY build/godwoken-polyjuice/build/*generator* /scripts/godwoken-polyjuice/ -COPY build/godwoken-polyjuice/build/*validator* /scripts/godwoken-polyjuice/ +# COPY build/godwoken-polyjuice/build/*generator* /scripts/godwoken-polyjuice/ +# COPY build/godwoken-polyjuice/build/*validator* /scripts/godwoken-polyjuice/ # godwoken COPY build/godwoken/target/release/godwoken /bin/godwoken diff --git a/Makefile b/Makefile index 9836a27..c5476f6 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ POLYJUICE_REPO := https://github.com/nervosnetwork/godwoken-polyjuice.git CLERKB_REPO := https://github.com/nervosnetwork/clerkb.git # components tags -GODWOKEN_REF := refs/pull/1084/merge +GODWOKEN_REF := v0.11.0 # https://github.com/godwokenrises/godwoken/tree/v0.11.0 GODWOKEN_SCRIPTS_REF := v0.9.0 # https://github.com/nervosnetwork/godwoken-scripts/releases/tag/v0.9.0 POLYJUICE_REF := 0.8.14 # https://github.com/nervosnetwork/godwoken-polyjuice/releases/tag/0.8.14 CLERKB_REF := v0.4.0 From 9296f39b127c5e90da2ca17ecb3911ab7c9f4dd0 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:54:32 +0000 Subject: [PATCH 5/5] chore(deps): bump github-action packages --- .github/workflows/docker-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 458a1f7..6aceb07 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions/cache@v3 with: @@ -65,7 +65,7 @@ jobs: # GitHub automatically creates a unique GITHUB_TOKEN secret to use in this workflow. - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.ref_type != 'tag' && github.repository_owner || secrets.DOCKERHUB_USERNAME }} @@ -186,7 +186,7 @@ jobs: # https://github.com/docker/build-push-action - name: Build and push Docker image to ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }} if: ${{ github.ref_type != 'tag' }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: Dockerfile.fast @@ -198,7 +198,7 @@ jobs: # only for new tag - name: Build and push Docker image to https://hub.docker.com/r/nervos/godwoken-prebuilds if: ${{ github.repository_owner == 'nervosnetwork' && startsWith(github.ref, 'refs/tags') }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: Dockerfile.fast