Skip to content

Commit d24875f

Browse files
committed
Merge remote-tracking branch 'origin/unstable' into tree-states
2 parents cd23c89 + 69c39ad commit d24875f

File tree

77 files changed

+1992
-1132
lines changed

Some content is hidden

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

77 files changed

+1992
-1132
lines changed

.github/workflows/docker.yml

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ env:
1717
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
1818
IMAGE_NAME: ${{ github.repository_owner}}/lighthouse
1919
LCLI_IMAGE_NAME: ${{ github.repository_owner }}/lcli
20+
# Enable self-hosted runners for the sigp repo only.
21+
SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/lighthouse' }}
2022

2123
jobs:
2224
# Extract the VERSION which is either `latest` or `vX.Y.Z`, and the VERSION_SUFFIX
@@ -48,7 +50,8 @@ jobs:
4850
VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }}
4951
build-docker-single-arch:
5052
name: build-docker-${{ matrix.binary }}${{ matrix.features.version_suffix }}
51-
runs-on: ubuntu-22.04
53+
# Use self-hosted runners only on the sigp repo.
54+
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release"]') || 'ubuntu-22.04' }}
5255
strategy:
5356
matrix:
5457
# FIXME(sproul) re-enable ARM builds
@@ -63,14 +66,13 @@ jobs:
6366

6467
needs: [extract-version]
6568
env:
66-
# We need to enable experimental docker features in order to use `docker buildx`
67-
DOCKER_CLI_EXPERIMENTAL: enabled
6869
VERSION: ${{ needs.extract-version.outputs.VERSION }}
6970
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
7071
FEATURE_SUFFIX: ${{ matrix.features.version_suffix }}
7172
steps:
7273
- uses: actions/checkout@v3
7374
- name: Update Rust
75+
if: env.SELF_HOSTED_RUNNERS == 'false'
7476
run: rustup update stable
7577
- name: Dockerhub login
7678
run: |
@@ -79,16 +81,14 @@ jobs:
7981
run: |
8082
cargo install cross
8183
env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ matrix.features.env }} make build-${{ matrix.binary }}
84+
- name: Make bin dir
85+
run: mkdir ./bin
8286
- name: Move cross-built binary into Docker scope (if ARM)
8387
if: startsWith(matrix.binary, 'aarch64')
84-
run: |
85-
mkdir ./bin;
86-
mv ./target/aarch64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin;
88+
run: mv ./target/aarch64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin
8789
- name: Move cross-built binary into Docker scope (if x86_64)
8890
if: startsWith(matrix.binary, 'x86_64')
89-
run: |
90-
mkdir ./bin;
91-
mv ./target/x86_64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin;
91+
run: mv ./target/x86_64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin
9292
- name: Map aarch64 to arm64 short arch
9393
if: startsWith(matrix.binary, 'aarch64')
9494
run: echo "SHORT_ARCH=arm64" >> $GITHUB_ENV
@@ -98,17 +98,24 @@ jobs:
9898
- name: Set modernity suffix
9999
if: endsWith(matrix.binary, '-portable') != true
100100
run: echo "MODERNITY_SUFFIX=-modern" >> $GITHUB_ENV;
101-
# Install dependencies for emulation. Have to create a new builder to pick up emulation support.
102-
- name: Build Dockerfile and push
103-
run: |
104-
docker run --privileged --rm tonistiigi/binfmt --install ${SHORT_ARCH}
105-
docker buildx create --use --name cross-builder
106-
docker buildx build \
107-
--platform=linux/${SHORT_ARCH} \
108-
--file ./Dockerfile.cross . \
109-
--tag ${IMAGE_NAME}:${VERSION}-${SHORT_ARCH}${VERSION_SUFFIX}${MODERNITY_SUFFIX}${FEATURE_SUFFIX} \
110-
--provenance=false \
111-
--push
101+
102+
- name: Install QEMU
103+
if: env.SELF_HOSTED_RUNNERS == 'false'
104+
run: sudo apt-get update && sudo apt-get install -y qemu-user-static
105+
106+
- name: Set up Docker Buildx
107+
if: env.SELF_HOSTED_RUNNERS == 'false'
108+
uses: docker/setup-buildx-action@v2
109+
110+
- name: Build and push
111+
uses: docker/build-push-action@v4
112+
with:
113+
file: ./Dockerfile.cross
114+
context: .
115+
platforms: linux/${{ env.SHORT_ARCH }}
116+
push: true
117+
tags: ${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}${{ env.MODERNITY_SUFFIX }}${{ env.FEATURE_SUFFIX }}
118+
112119
build-docker-multiarch:
113120
name: build-docker-multiarch${{ matrix.modernity }}
114121
runs-on: ubuntu-22.04
@@ -117,21 +124,23 @@ jobs:
117124
matrix:
118125
modernity: ["", "-modern"]
119126
env:
120-
# We need to enable experimental docker features in order to use `docker manifest`
121-
DOCKER_CLI_EXPERIMENTAL: enabled
122127
VERSION: ${{ needs.extract-version.outputs.VERSION }}
123128
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
124129
steps:
130+
- name: Set up Docker Buildx
131+
uses: docker/setup-buildx-action@v2
132+
125133
- name: Dockerhub login
126134
run: |
127135
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
136+
128137
- name: Create and push multiarch manifest
129138
# FIXME(sproul): Fix ARM builds and put this back
130-
# --amend ${IMAGE_NAME}:${VERSION}-arm64${VERSION_SUFFIX}${{ matrix.modernity }} \
139+
# ${IMAGE_NAME}:${VERSION}-arm64${VERSION_SUFFIX}${{ matrix.modernity }} \
131140
run: |
132-
docker manifest create ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}${{ matrix.modernity }} \
133-
--amend ${IMAGE_NAME}:${VERSION}-amd64${VERSION_SUFFIX}${{ matrix.modernity }};
134-
docker manifest push ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}${{ matrix.modernity }}
141+
docker buildx imagetools create -t ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}${{ matrix.modernity }} \
142+
${IMAGE_NAME}:${VERSION}-amd64${VERSION_SUFFIX}${{ matrix.modernity }};
143+
135144
build-docker-lcli:
136145
runs-on: ubuntu-22.04
137146
needs: [extract-version]

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ jobs:
3737
x86_64-windows-portable]
3838
include:
3939
- arch: x86_64-unknown-linux-gnu
40-
platform: ubuntu-latest
40+
runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release", "large"]') || 'ubuntu-latest' }}
4141
profile: maxperf
4242
- arch: x86_64-unknown-linux-gnu-portable
43-
platform: ubuntu-latest
43+
runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release", "large"]') || 'ubuntu-latest' }}
4444
profile: maxperf
4545
- arch: x86_64-apple-darwin
46-
platform: macos-latest
46+
runner: macos-latest
4747
profile: maxperf
4848
- arch: x86_64-apple-darwin-portable
49-
platform: macos-latest
49+
runner: macos-latest
5050
profile: maxperf
5151
- arch: x86_64-windows
52-
platform: windows-2019
52+
runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "release"]') || 'windows-2019' }}
5353
profile: maxperf
5454
- arch: x86_64-windows-portable
55-
platform: windows-2019
55+
runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "release"]') || 'windows-2019' }}
5656
profile: maxperf
5757

58-
runs-on: ${{ matrix.platform }}
58+
runs-on: ${{ matrix.runner }}
5959
needs: extract-version
6060
steps:
6161
- name: Checkout sources

.github/workflows/test-suite.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
release-tests-ubuntu:
5959
name: release-tests-ubuntu
6060
# Use self-hosted runners only on the sigp repo.
61-
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "large"]') || 'ubuntu-latest' }}
61+
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
6262
needs: cargo-fmt
6363
steps:
6464
- uses: actions/checkout@v3
@@ -73,7 +73,7 @@ jobs:
7373
run: make test-release
7474
release-tests-windows:
7575
name: release-tests-windows
76-
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows"]') || 'windows-2019' }}
76+
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "CI"]') || 'windows-2019' }}
7777
needs: cargo-fmt
7878
steps:
7979
- uses: actions/checkout@v3
@@ -98,7 +98,7 @@ jobs:
9898
beacon-chain-tests:
9999
name: beacon-chain-tests
100100
# Use self-hosted runners only on the sigp repo.
101-
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "large"]') || 'ubuntu-latest' }}
101+
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
102102
needs: cargo-fmt
103103
steps:
104104
- uses: actions/checkout@v3
@@ -130,7 +130,7 @@ jobs:
130130
debug-tests-ubuntu:
131131
name: debug-tests-ubuntu
132132
# Use self-hosted runners only on the sigp repo.
133-
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "large"]') || 'ubuntu-latest' }}
133+
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
134134
needs: cargo-fmt
135135
steps:
136136
- uses: actions/checkout@v3
@@ -156,7 +156,7 @@ jobs:
156156
ef-tests-ubuntu:
157157
name: ef-tests-ubuntu
158158
# Use self-hosted runners only on the sigp repo.
159-
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "small"]') || 'ubuntu-latest' }}
159+
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
160160
needs: cargo-fmt
161161
steps:
162162
- uses: actions/checkout@v3

0 commit comments

Comments
 (0)