Skip to content

Commit 13bc011

Browse files
committed
Merge remote-tracking branch 'origin/unstable' into sync-merged-lookup
2 parents bad87b1 + 8b24880 commit 13bc011

File tree

221 files changed

+5189
-4178
lines changed

Some content is hidden

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

221 files changed

+5189
-4178
lines changed

.github/workflows/docker.yml

Lines changed: 59 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ concurrency:
1515
env:
1616
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1717
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
18-
IMAGE_NAME: ${{ github.repository_owner}}/lighthouse
19-
LCLI_IMAGE_NAME: ${{ github.repository_owner }}/lcli
2018
# Enable self-hosted runners for the sigp repo only.
2119
SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/lighthouse' }}
2220

@@ -49,27 +47,22 @@ jobs:
4947
VERSION: ${{ env.VERSION }}
5048
VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }}
5149
build-docker-single-arch:
52-
name: build-docker-${{ matrix.binary }}${{ matrix.features.version_suffix }}
50+
name: build-docker-${{ matrix.binary }}-${{ matrix.cpu_arch }}${{ matrix.features.version_suffix }}
5351
# Use self-hosted runners only on the sigp repo.
5452
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release"]') || 'ubuntu-22.04' }}
5553
strategy:
5654
matrix:
57-
binary: [aarch64,
58-
aarch64-portable,
59-
x86_64,
60-
x86_64-portable]
61-
features: [
62-
{version_suffix: "", env: "gnosis,slasher-lmdb,slasher-mdbx,jemalloc"},
63-
{version_suffix: "-dev", env: "jemalloc,spec-minimal"}
64-
]
55+
binary: [lighthouse,
56+
lcli]
57+
cpu_arch: [aarch64,
58+
x86_64]
6559
include:
6660
- profile: maxperf
6761

6862
needs: [extract-version]
6963
env:
7064
VERSION: ${{ needs.extract-version.outputs.VERSION }}
7165
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
72-
FEATURE_SUFFIX: ${{ matrix.features.version_suffix }}
7366
steps:
7467
- uses: actions/checkout@v4
7568
- name: Update Rust
@@ -78,27 +71,40 @@ jobs:
7871
- name: Dockerhub login
7972
run: |
8073
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
81-
- name: Cross build Lighthouse binary
74+
75+
- name: Sets env vars for Lighthouse
76+
if: startsWith(matrix.binary, 'lighthouse')
77+
run: |
78+
echo "CROSS_FEATURES=gnosis,spec-minimal,slasher-lmdb,jemalloc" >> $GITHUB_ENV
79+
80+
- name: Set `make` command for lighthouse
81+
if: startsWith(matrix.binary, 'lighthouse')
82+
run: |
83+
echo "MAKE_CMD=build-${{ matrix.cpu_arch }}-portable" >> $GITHUB_ENV
84+
85+
- name: Set `make` command for lcli
86+
if: startsWith(matrix.binary, 'lcli')
87+
run: |
88+
echo "MAKE_CMD=build-lcli-${{ matrix.cpu_arch }}" >> $GITHUB_ENV
89+
90+
- name: Cross build binaries
8291
run: |
8392
cargo install cross
84-
env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ matrix.features.env }} make build-${{ matrix.binary }}
93+
env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ env.CROSS_FEATURES }} make ${{ env.MAKE_CMD }}
94+
8595
- name: Make bin dir
8696
run: mkdir ./bin
87-
- name: Move cross-built binary into Docker scope (if ARM)
88-
if: startsWith(matrix.binary, 'aarch64')
89-
run: mv ./target/aarch64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin
90-
- name: Move cross-built binary into Docker scope (if x86_64)
91-
if: startsWith(matrix.binary, 'x86_64')
92-
run: mv ./target/x86_64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin
97+
98+
- name: Move cross-built binary into Docker scope
99+
run: mv ./target/${{ matrix.cpu_arch }}-unknown-linux-gnu/${{ matrix.profile }}/${{ matrix.binary }} ./bin
100+
93101
- name: Map aarch64 to arm64 short arch
94-
if: startsWith(matrix.binary, 'aarch64')
102+
if: startsWith(matrix.cpu_arch, 'aarch64')
95103
run: echo "SHORT_ARCH=arm64" >> $GITHUB_ENV
104+
96105
- name: Map x86_64 to amd64 short arch
97-
if: startsWith(matrix.binary, 'x86_64')
106+
if: startsWith(matrix.cpu_arch, 'x86_64')
98107
run: echo "SHORT_ARCH=amd64" >> $GITHUB_ENV;
99-
- name: Set modernity suffix
100-
if: endsWith(matrix.binary, '-portable') != true
101-
run: echo "MODERNITY_SUFFIX=-modern" >> $GITHUB_ENV;
102108

103109
- name: Install QEMU
104110
if: env.SELF_HOSTED_RUNNERS == 'false'
@@ -108,22 +114,41 @@ jobs:
108114
if: env.SELF_HOSTED_RUNNERS == 'false'
109115
uses: docker/setup-buildx-action@v3
110116

111-
- name: Build and push
117+
- name: Build and push (Lighthouse)
118+
if: startsWith(matrix.binary, 'lighthouse')
112119
uses: docker/build-push-action@v5
113120
with:
114121
file: ./Dockerfile.cross
115122
context: .
116123
platforms: linux/${{ env.SHORT_ARCH }}
117124
push: true
118-
tags: ${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}${{ env.MODERNITY_SUFFIX }}${{ env.FEATURE_SUFFIX }}
125+
tags: |
126+
${{ github.repository_owner}}/${{ matrix.binary }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}
127+
${{ github.repository_owner}}/${{ matrix.binary }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}-dev
128+
${{ github.repository_owner}}/${{ matrix.binary }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}-modern
129+
${{ github.repository_owner}}/${{ matrix.binary }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}-modern-dev
130+
131+
- name: Build and push (lcli)
132+
if: startsWith(matrix.binary, 'lcli')
133+
uses: docker/build-push-action@v5
134+
with:
135+
file: ./lcli/Dockerfile.cross
136+
context: .
137+
platforms: linux/${{ env.SHORT_ARCH }}
138+
push: true
139+
140+
tags: |
141+
${{ github.repository_owner}}/${{ matrix.binary }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}
142+
119143
120144
build-docker-multiarch:
121-
name: build-docker-multiarch${{ matrix.modernity }}
145+
name: build-docker-${{ matrix.binary }}-multiarch
122146
runs-on: ubuntu-22.04
123-
needs: [build-docker-single-arch, extract-version]
124147
strategy:
125148
matrix:
126-
modernity: ["", "-modern"]
149+
binary: [lighthouse,
150+
lcli]
151+
needs: [build-docker-single-arch, extract-version]
127152
env:
128153
VERSION: ${{ needs.extract-version.outputs.VERSION }}
129154
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
@@ -135,29 +160,9 @@ jobs:
135160
run: |
136161
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
137162
138-
- name: Create and push multiarch manifest
163+
- name: Create and push multiarch manifests
139164
run: |
140-
docker buildx imagetools create -t ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}${{ matrix.modernity }} \
141-
${IMAGE_NAME}:${VERSION}-arm64${VERSION_SUFFIX}${{ matrix.modernity }} \
142-
${IMAGE_NAME}:${VERSION}-amd64${VERSION_SUFFIX}${{ matrix.modernity }};
165+
docker buildx imagetools create -t ${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}${VERSION_SUFFIX} \
166+
${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-arm64${VERSION_SUFFIX} \
167+
${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-amd64${VERSION_SUFFIX};
143168
144-
build-docker-lcli:
145-
runs-on: ubuntu-22.04
146-
needs: [extract-version]
147-
env:
148-
VERSION: ${{ needs.extract-version.outputs.VERSION }}
149-
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
150-
steps:
151-
- uses: actions/checkout@v4
152-
- name: Dockerhub login
153-
run: |
154-
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
155-
- name: Build lcli and push
156-
uses: docker/build-push-action@v5
157-
with:
158-
build-args: |
159-
FEATURES=portable
160-
context: .
161-
push: true
162-
file: ./lcli/Dockerfile
163-
tags: ${{ env.LCLI_IMAGE_NAME }}:${{ env.VERSION }}${{ env.VERSION_SUFFIX }}

0 commit comments

Comments
 (0)