Skip to content

Commit 12ca40e

Browse files
A0-4614: attach chain bootstrapper to release (#1964)
# Description What needs to be done? * In push to main workflow, we should store as well chain-bootstrapper binary * In release changed workflow, we should attach production chain bootstrapper Why? * For us devs doing release preparation tests - now for 14 release I need to build it manually which is error-prone * Community transparency - generating runtime is now decoupled from aleph-node Also, `profile` input was removed from store artifacts action, since it was not used with `test` anywhere. ## Type of change - New feature (non-breaking change which adds functionality) ## Testing * https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/14106515515 PASS
1 parent edc559c commit 12ca40e

File tree

3 files changed

+56
-34
lines changed

3 files changed

+56
-34
lines changed

.github/actions/store-node-and-runtime/action.yml renamed to .github/actions/store-artifacts-in-s3/action.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
name: Store node and runtime
3-
description: This workflow stores test or release version of aleph-node and aleph-runtime in S3, in
4-
a given bucket
2+
name: Store build artifacts in S3
3+
description: This workflow stores production version of CI build artifacts in S3
54
inputs:
65
aleph-node-artifact-name:
76
required: true
87
description: 'Name of artifact aleph-node binary'
98
aleph-runtime-artifact-name:
109
required: true
1110
description: 'Name of artifact aleph-runtime'
12-
profile:
11+
chain-bootstrapper-artifact-name:
1312
required: true
14-
description: 'test or production'
13+
description: 'Name of artifact chain-bootstrapper'
1514
aws-access-key-id:
1615
required: true
1716
description: 'AWS Access Key ID to be used when storing artifacts'
@@ -25,14 +24,6 @@ inputs:
2524
runs:
2625
using: "composite"
2726
steps:
28-
- name: Validate workflow inputs
29-
shell: bash
30-
run: |
31-
if [[ '${{ inputs.profile }}' != 'test' && '${{ inputs.profile }}' != 'production' ]]; then
32-
echo 'Error: inputs.profile should be either test or production!'
33-
exit 1
34-
fi
35-
3627
- name: Checkout aleph-node source code
3728
uses: actions/checkout@v4
3829

@@ -52,6 +43,12 @@ runs:
5243
name: ${{ inputs.aleph-runtime-artifact-name }}
5344
path: target
5445

46+
- name: Download chain-bootstrapper from GH artifacts
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: ${{ inputs.chain-bootstrapper-artifact-name }}
50+
path: target
51+
5552
- name: Configure AWS credentials for S3 AWS
5653
uses: aws-actions/configure-aws-credentials@v4
5754
env:
@@ -72,19 +69,31 @@ runs:
7269
source-filename: aleph-node
7370
s3-bucket-path:
7471
# yamllint disable-line rule:line-length
75-
builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/aleph-${{ inputs.profile }}-node
72+
builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/aleph-production-node
7673
s3-bucket-filename:
77-
aleph-${{ inputs.profile }}-node-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
74+
aleph-production-node-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
7875
s3-bucket-name: ${{ inputs.aws-bucket }}
7976

8077
- name: Copy runtime to S3 AWS bucket
81-
uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v1
78+
uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v7
8279
with:
8380
source-path: target
8481
source-filename: aleph_runtime.compact.compressed.wasm
8582
s3-bucket-path:
8683
# yamllint disable-line rule:line-length
87-
builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/aleph-${{ inputs.profile }}-runtime
84+
builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/aleph-production-runtime
85+
s3-bucket-filename:
86+
aleph-production-runtime-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
87+
s3-bucket-name: ${{ inputs.aws-bucket }}
88+
89+
- name: Copy chain-bootstrapper to S3 AWS bucket
90+
uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v7
91+
with:
92+
source-path: target
93+
source-filename: chain-bootstrapper
94+
s3-bucket-path:
95+
# yamllint disable-line rule:line-length
96+
builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/chain-bootstrapper-production
8897
s3-bucket-filename:
89-
aleph-${{ inputs.profile }}-runtime-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
98+
chain-bootstrapper-production-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
9099
s3-bucket-name: ${{ inputs.aws-bucket }}

.github/workflows/on-main-or-release-branch-commit.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
ecr-chain-bootstrapper-repo: ${{ vars.ECR_CHAIN_BOOTSTRAPPER_REPO }}
4040
test-binary: 'false'
4141

42-
build-chain-bootstrapper:
42+
build-production-chain-bootstrapper:
4343
needs: [check-vars-and-secrets]
4444
name: Build chain-bootstrapper
4545
uses: ./.github/workflows/_build-chain-bootstrapper.yml
@@ -49,17 +49,17 @@ jobs:
4949

5050
push-chain-bootstrapper-image-to-ecr:
5151
needs:
52-
- build-chain-bootstrapper
52+
- build-production-chain-bootstrapper
5353
- get-full-docker-image-path
5454
name: Push chain-bootstrapper docker image to ECR
5555
uses: ./.github/workflows/_push-image-to-ecr.yml
5656
secrets: inherit
5757
with:
58-
binary-artifact-name: ${{ needs.build-chain-bootstrapper.outputs.artifact-name-binary }}
59-
# yamllint disable-line rule:line-length
58+
# yamllint disable rule:line-length
59+
binary-artifact-name: ${{ needs.build-production-chain-bootstrapper.outputs.artifact-name-binary }}
6060
docker-image-name: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image }}
61-
# yamllint disable-line rule:line-length
6261
docker-image-name-latest: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image-latest }}
62+
# yamllint enable rule:line-length
6363
binary-name: chain-bootstrapper
6464
docker-file-path: ./bin/chain-bootstrapper/Dockerfile
6565

@@ -90,24 +90,25 @@ jobs:
9090
needs: [build-production-runtime]
9191
uses: ./.github/workflows/_check-runtime-determimism.yml
9292

93-
store-production-node-and-runtime-in-mainnet-s3:
94-
name: Store production node and runtime in Mainnet bucket
93+
store-ci-artifacts-in-mainnet-s3:
94+
name: Store CI artifacts in Mainnet bucket
9595
runs-on: ubuntu-20.04
9696
needs:
9797
- build-production-aleph-node
9898
- build-production-runtime
99+
- build-production-chain-bootstrapper
99100
steps:
100101
- name: Checkout aleph-node source code
101102
uses: actions/checkout@v4
102103

103104
- name: Store production node and runtime
104-
uses: ./.github/actions/store-node-and-runtime
105+
uses: ./.github/actions/store-artifacts-in-s3
105106
with:
106-
profile: production
107-
# yamllint disable-line rule:line-length
107+
# yamllint disable rule:line-length
108108
aleph-node-artifact-name: ${{ needs.build-production-aleph-node.outputs.artifact-name-binary }}
109-
# yamllint disable-line rule:line-length
110109
aleph-runtime-artifact-name: ${{ needs.build-production-runtime.outputs.aleph-runtime-artifact-name }}
110+
chain-bootstrapper-artifact-name: ${{ needs.build-production-chain-bootstrapper.outputs.artifact-name-binary }}
111+
# yamllint enable rule:line-length
111112
aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
112113
aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
113114
aws-bucket: ${{ secrets.CI_MAINNET_S3BUCKET_NAME }}

.github/workflows/on-release.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Upload runtime and binary to GitHub Release
2+
name: Upload CI artifacts to GitHub Release
33

44
on:
55
release:
@@ -17,9 +17,9 @@ jobs:
1717
uses: ./.github/workflows/_check-vars-and-secrets.yml
1818
secrets: inherit
1919

20-
add-runtime-and-binary-to-release:
20+
add-ci-artifacts-to-release:
2121
needs: [check-vars-and-secrets]
22-
name: Add runtime and binary to release
22+
name: Add CI artifacts to the release
2323
runs-on: ubuntu-20.04
2424
steps:
2525
- name: Checkout source code
@@ -58,6 +58,17 @@ jobs:
5858
aws s3 cp '${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }}' \
5959
'aleph-node-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz'
6060
61+
- name: Download chain-bootstrapper binary from S3 bucket
62+
shell: bash
63+
env:
64+
# yamllint disable-line rule:line-length
65+
S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/chain-bootstrapper-production
66+
# yamllint disable-line rule:line-length
67+
S3BUCKET_FILE: chain-bootstrapper-production-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
68+
run: |
69+
aws s3 cp '${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }}' \
70+
'chain-bootstrapper-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz'
71+
6172
- name: Generate release artifacts checksum (SHA256)
6273
uses: jmgilman/actions-generate-checksum@v1
6374
with:
@@ -66,18 +77,19 @@ jobs:
6677
patterns: |
6778
*.tar.gz
6879
69-
- name: Add runtime and binary to the release
80+
- name: Add CI artifacts to the release
7081
uses: softprops/action-gh-release@v2
7182
with:
7283
files: |
7384
checksums-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz.SHA256.txt
7485
aleph-runtime-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
7586
aleph-node-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz
87+
chain-bootstrapper-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz
7688
7789
slack:
7890
name: Slack notification
7991
runs-on: ubuntu-20.04
80-
needs: [add-runtime-and-binary-to-release]
92+
needs: [add-ci-artifacts-to-release]
8193
if: always()
8294
steps:
8395
- name: Send Slack message

0 commit comments

Comments
 (0)