Skip to content

Commit 54bc763

Browse files
authored
feat(ci): add GitHub workflow for building and deploying vibehouse do… (#330)
…cker image This commit introduces a new GitHub Actions workflow to automate the building, multi-platform pushing, and manifest creation for the vibehouse Docker image. This is necessary to integrate vibehouse into the automated image build and deployment pipeline, matching the setup for other existing repositories. It adds configuration to: - Define inputs for specifying source repository, ref, tags, and build arguments. - Prepare matrix of target platforms using existing actions. - Build and deploy for each platform. - Create and push the manifest. - Configure the manifest generation step with relevant branch and platform data.
1 parent b9ce855 commit 54bc763

5 files changed

Lines changed: 145 additions & 0 deletions

File tree

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Build vibehouse docker image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
repository:
7+
description: The source vibehouse repository to build from
8+
default: dapplion/vibehouse
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+
build_args:
21+
description: Build arguments to pass to the Docker build
22+
default: ""
23+
type: string
24+
required: false
25+
26+
jobs:
27+
prepare:
28+
runs-on: ubuntu-latest
29+
outputs:
30+
platforms: ${{ steps.setup.outputs.platforms }}
31+
target_tag: ${{ steps.tag.outputs.docker_tag }}
32+
steps:
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
- name: Prepare Matrix
35+
id: setup
36+
uses: ./.github/actions/prepare
37+
with:
38+
client: 'vibehouse'
39+
- name: Generate target tag
40+
id: tag
41+
uses: ./.github/actions/docker-tag
42+
with:
43+
input: ${{ inputs.docker_tag || inputs.ref }}
44+
repository: ${{ inputs.repository }}
45+
upstream_repository: dapplion/vibehouse
46+
docker_tag: ${{ inputs.docker_tag }}
47+
deploy:
48+
needs:
49+
- prepare
50+
runs-on: ${{ matrix.runner }}
51+
continue-on-error: true
52+
strategy:
53+
matrix:
54+
include: ${{fromJson(needs.prepare.outputs.platforms)}}
55+
outputs:
56+
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
57+
steps:
58+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
59+
- uses: ./.github/actions/install-deps
60+
with:
61+
repository: ${{ inputs.repository }}
62+
- uses: ./.github/actions/deploy
63+
id: deploy
64+
with:
65+
source_repository: ${{ inputs.repository }}
66+
source_ref: ${{ inputs.ref }}
67+
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
68+
target_repository: ethpandaops/vibehouse
69+
target_dockerfile: ./vibehouse/Dockerfile
70+
platform: ${{ matrix.platform }}
71+
build_args: ${{ inputs.build_args }}
72+
73+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
74+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
75+
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
76+
GOPROXY: "${{ vars.GOPROXY }}"
77+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
78+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
79+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
80+
81+
- name: Set job output
82+
id: set_output
83+
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
84+
shell: bash
85+
manifest:
86+
needs:
87+
- prepare
88+
- deploy
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
92+
- uses: ./.github/actions/manifest
93+
with:
94+
source_repository: ${{ inputs.repository }}
95+
source_ref: ${{ inputs.ref }}
96+
target_tag: ${{ needs.prepare.outputs.target_tag }}
97+
target_repository: ethpandaops/vibehouse
98+
platforms: ${{ needs.prepare.outputs.platforms }}
99+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
100+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
101+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
102+
git_commit_hash: ${{ needs.deploy.outputs.git_commit_hash }}
103+
104+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
105+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
106+
notify:
107+
name: Discord Notification
108+
runs-on: ubuntu-latest
109+
needs:
110+
- prepare
111+
- deploy
112+
- manifest
113+
if: failure()
114+
steps:
115+
- name: Notify
116+
uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1
117+
with:
118+
github-token: ${{ secrets.github_token }}
119+
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}

branches.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ lighthouse:
7575
michaelsproul/lighthouse:
7676
- database-epbs-devnet-0
7777

78+
vibehouse:
79+
branches:
80+
- main
81+
7882
lodestar:
7983
branches:
8084
- stable

generate_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'ethrex': 'lambdaclass/ethrex',
1313
'geth': 'ethereum/go-ethereum',
1414
'lighthouse': 'sigp/lighthouse',
15+
'vibehouse': 'dapplion/vibehouse',
1516
'nimbus-eth2': 'status-im/nimbus-eth2',
1617
'nimbus-validator-client': 'status-im/nimbus-eth2',
1718
'nimbus-eth1': 'status-im/nimbus-eth1',

platforms.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ geth:
1818
lighthouse:
1919
- linux/amd64
2020
- linux/arm64
21+
vibehouse:
22+
- linux/amd64
23+
- linux/arm64
2124
lodestar:
2225
- linux/amd64
2326
- linux/arm64

vibehouse/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM rust:1.88-bullseye AS builder
2+
RUN apt-get clean && apt-get update && apt-get -y upgrade && apt-get install -y cmake clang libclang-dev protobuf-compiler
3+
COPY . vibehouse
4+
ARG FEATURES=gnosis,spec-minimal,slasher-lmdb
5+
ARG PROFILE=release
6+
ARG CARGO_USE_GIT_CLI=true
7+
ENV FEATURES=$FEATURES
8+
ENV PROFILE=$PROFILE
9+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=$CARGO_USE_GIT_CLI
10+
RUN cd vibehouse && make
11+
12+
FROM ubuntu:22.04
13+
RUN apt-get clean && apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
14+
libssl-dev \
15+
ca-certificates \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
COPY --from=builder /usr/local/cargo/bin/vibehouse /usr/local/bin/vibehouse

0 commit comments

Comments
 (0)