Skip to content

Commit f640c72

Browse files
authored
Merge branch 'master' into chore/default-prysm-build-go
2 parents e437874 + d4389c4 commit f640c72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+361
-841
lines changed

.github/actions/deploy/action.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ inputs:
4141
type: string
4242
default: go
4343
required: false
44+
harbor_registry:
45+
description: Harbor registry to push the images to
46+
type: string
47+
default: ''
4448
# Secrets
4549
DOCKER_USERNAME:
4650
required: true
@@ -50,6 +54,10 @@ inputs:
5054
required: true
5155
GOPROXY:
5256
required: false
57+
HARBOR_USERNAME:
58+
required: true
59+
HARBOR_PASSWORD:
60+
required: true
5361

5462
outputs:
5563
git_commit_hash:
@@ -102,6 +110,13 @@ runs:
102110
with:
103111
username: ${{ inputs.DOCKER_USERNAME }}
104112
password: ${{ inputs.DOCKER_PASSWORD }}
113+
- name: Login to harbor registry
114+
if: ${{ inputs.harbor_registry != '' }}
115+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
116+
with:
117+
registry: ${{ inputs.harbor_registry }}
118+
username: ${{ inputs.HARBOR_USERNAME }}
119+
password: ${{ inputs.HARBOR_PASSWORD }}
105120
########################
106121
# Build script case
107122
#######################
@@ -154,7 +169,11 @@ runs:
154169
# two tags;
155170
# - $target_tag
156171
# - $target_tag-commit
157-
tags: ${{ inputs.target_repository }}:${{ inputs.target_tag }}-${{ steps.git_commit_hash.outputs.git_commit_hash }},${{ inputs.target_repository }}:${{ inputs.target_tag }}
172+
tags: |
173+
${{ inputs.target_repository }}:${{ inputs.target_tag }}-${{ steps.git_commit_hash.outputs.git_commit_hash }}
174+
${{ inputs.target_repository }}:${{ inputs.target_tag }}
175+
${{ inputs.harbor_registry != '' && format('{0}/{1}:{2}-{3}', inputs.harbor_registry, inputs.target_repository, inputs.target_tag, steps.git_commit_hash.outputs.git_commit_hash) || '' }}
176+
${{ inputs.harbor_registry != '' && format('{0}/{1}:{2}', inputs.harbor_registry, inputs.target_repository, inputs.target_tag) || '' }}
158177
push: true
159178
platforms: ${{ inputs.platform }}
160179
build-args: ${{ inputs.build_args }}
@@ -171,4 +190,4 @@ runs:
171190
tags:
172191
${{ inputs.target_repository }}:${{ inputs.target_tag }}
173192
${{ inputs.target_repository }}:${{ inputs.target_tag }}-${{ steps.git_commit_hash.outputs.git_commit_hash }}
174-
EOF
193+
EOF

.github/actions/manifest/action.yml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -92,46 +92,9 @@ runs:
9292
with:
9393
username: ${{ inputs.DOCKER_USERNAME }}
9494
password: ${{ inputs.DOCKER_PASSWORD }}
95-
- name: Create and push manifest images
95+
96+
- name: Create and push manifest images to dockerhub
9697
shell: bash
9798
run: |
9899
docker buildx imagetools create --dry-run -t ${{ inputs.target_repository }}:${{ inputs.target_tag }} -t ${{ inputs.target_repository }}:${{ inputs.target_tag }}-${{ inputs.git_commit_hash }} ${{ steps.generate_images_list.outputs.images }}
99100
docker buildx imagetools create -t ${{ inputs.target_repository }}:${{ inputs.target_tag }} -t ${{ inputs.target_repository }}:${{ inputs.target_tag }}-${{ inputs.git_commit_hash }} ${{ steps.generate_images_list.outputs.images }}
100-
101-
- name: Login to harbor registry
102-
if: ${{ inputs.harbor_registry != '' }}
103-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
104-
with:
105-
registry: ${{ inputs.harbor_registry }}
106-
username: ${{ inputs.HARBOR_USERNAME }}
107-
password: ${{ inputs.HARBOR_PASSWORD }}
108-
109-
- name: Create and push manifest images for other registry
110-
if: ${{ inputs.harbor_registry != '' }}
111-
shell: bash
112-
run: |
113-
images="${{ steps.generate_images_list.outputs.tags }}"
114-
for image in $images; do
115-
target_tag=$(echo "${{ inputs.harbor_registry }}$image" | sed -E 's/^\s*.*:\/\///g')
116-
echo "Checking if $image is available on Docker Hub..."
117-
retries=10
118-
delay=30
119-
until [[ $retries -le 0 ]]; do
120-
if docker manifest inspect $image > /dev/null 2>&1; then
121-
echo "$image is available on Docker Hub."
122-
echo "Copying $image to $target_tag"
123-
docker buildx imagetools create --dry-run -t $target_tag $image
124-
docker buildx imagetools create -t $target_tag $image
125-
break
126-
else
127-
echo "$image is not yet available on Docker Hub. Retrying in $delay seconds..."
128-
sleep $delay
129-
((retries--))
130-
fi
131-
done
132-
if [[ $retries -le 0 ]]; then
133-
echo "Failed to find $image on Docker Hub after multiple attempts."
134-
echo "Skipping $image"
135-
continue
136-
fi
137-
done

.github/workflows/build-push-armiarma.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
6767
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
6868
GOPROXY: "${{ vars.GOPROXY }}"
69+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
70+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
71+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
6972

7073
# This step captures the git commit hash from the deploy action for job output, which can then be
7174
# used by the manifest job. This is done to handle scenarios where there is a commit to the remote

.github/workflows/build-push-beacon-metrics-gazer.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ jobs:
6868
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
6969
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
7070
GOPROXY: "${{ vars.GOPROXY }}"
71+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
72+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
73+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
7174

7275
# This step captures the git commit hash from the deploy action for job output
7376
- name: Set job output

.github/workflows/build-push-besu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
6666
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
6767
GOPROXY: "${{ vars.GOPROXY }}"
68+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
69+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
70+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
6871

6972
# This step captures the git commit hash from the deploy action for job output
7073
- name: Set job output

.github/workflows/build-push-consensus-monitor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ jobs:
6464
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
6565
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
6666
GOPROXY: "${{ vars.GOPROXY }}"
67+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
68+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
69+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
6770

6871
# This step captures the git commit hash from the deploy action for job output
6972
- name: Set job output

.github/workflows/build-push-eleel.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363

6464
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
6565
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
66+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
67+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
68+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
6669

6770
# This step captures the git commit hash from the deploy action for job output
6871
- name: Set job output

.github/workflows/build-push-erigon.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ jobs:
6464
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
6565
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
6666
GOPROXY: "${{ vars.GOPROXY }}"
67+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
68+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
69+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
6770

6871
# This step captures the git commit hash from the deploy action for job output
6972
- name: Set job output
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Build eth-das-guardian docker image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
repository:
7+
description: The source eth-das-guardian repository to build from
8+
default: probe-lab/eth-das-guardian
9+
type: string
10+
required: true
11+
ref:
12+
description: The branch, tag or SHA to checkout and build from
13+
default: main
14+
type: string
15+
required: true
16+
docker_tag:
17+
description: Override target docker tag (defaults to the above source ref if left blank)
18+
type: string
19+
required: false
20+
21+
jobs:
22+
prepare:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
platforms: ${{ steps.setup.outputs.platforms }}
26+
target_tag: ${{ steps.tag.outputs.docker_tag }}
27+
steps:
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
- name: Prepare Matrix
30+
id: setup
31+
uses: ./.github/actions/prepare
32+
with:
33+
client: 'eth-das-guardian'
34+
- name: Generate target tag
35+
id: tag
36+
uses: ./.github/actions/docker-tag
37+
with:
38+
input: ${{ inputs.docker_tag || inputs.ref }}
39+
deploy:
40+
needs:
41+
- prepare
42+
runs-on: ${{ matrix.runner }}
43+
continue-on-error: true
44+
strategy:
45+
matrix:
46+
include: ${{fromJson(needs.prepare.outputs.platforms)}}
47+
outputs:
48+
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
49+
steps:
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
- uses: ./.github/actions/install-deps
52+
with:
53+
repository: ${{ inputs.repository }}
54+
- uses: ./.github/actions/deploy
55+
id: deploy
56+
with:
57+
source_repository: ${{ inputs.repository }}
58+
source_ref: ${{ inputs.ref }}
59+
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
60+
target_repository: ethpandaops/eth-das-guardian
61+
platform: ${{ matrix.platform }}
62+
63+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
64+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
65+
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
66+
GOPROXY: "${{ vars.GOPROXY }}"
67+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
68+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
69+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
70+
71+
# This step captures the git commit hash from the deploy action for job output
72+
- name: Set job output
73+
id: set_output
74+
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
75+
shell: bash
76+
manifest:
77+
needs:
78+
- prepare
79+
- deploy
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+
- uses: ./.github/actions/manifest
84+
with:
85+
source_repository: ${{ inputs.repository }}
86+
source_ref: ${{ inputs.ref }}
87+
target_tag: ${{ needs.prepare.outputs.target_tag }}
88+
target_repository: ethpandaops/eth-das-guardian
89+
platforms: ${{ needs.prepare.outputs.platforms }}
90+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
91+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
92+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
93+
git_commit_hash: ${{ needs.deploy.outputs.git_commit_hash }}
94+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
95+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
96+
notify:
97+
name: Discord Notification
98+
runs-on: ubuntu-latest
99+
needs:
100+
- prepare
101+
- deploy
102+
- manifest
103+
if: failure()
104+
steps:
105+
- name: Notify
106+
uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1
107+
with:
108+
github-token: ${{ secrets.github_token }}
109+
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/build-push-ethereumjs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
6666
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
6767
GOPROXY: "${{ vars.GOPROXY }}"
68+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
69+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
70+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
6871

6972
# This step captures the git commit hash from the deploy action for job output
7073
- name: Set job output

0 commit comments

Comments
 (0)