Skip to content

Commit f9acb55

Browse files
authored
fix(tools): bring back arm64 target (#235)
* fix(tools): bring back arm64 target compile rocksdb in static mode * bump docker container version * add changelog * build separately * setup QEMU * add PORTABLE flag * install shared * add libbz2-dev * remove -jN * bring back -j4 * separate Dockerfile for arm64 * remove librocksdb-dev * setup qemu
1 parent 2d98c2d commit f9acb55

File tree

5 files changed

+46
-9
lines changed

5 files changed

+46
-9
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `[docker]` Bring back `arm64` build target
2+
([\#234](https://github.com/cometbft/cometbft-db/issues/234))

.github/workflows/ci.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Check if Docker image exists
2121
id: check
2222
run: |
23-
if docker manifest inspect cometbft/cometbft-db-testing:v1.0.2 &>/dev/null; then
23+
if docker manifest inspect cometbft/cometbft-db-testing:v1.0.3 &>/dev/null; then
2424
echo "exists=true" >> $GITHUB_OUTPUT
2525
else
2626
echo "exists=false" >> $GITHUB_OUTPUT
@@ -30,7 +30,7 @@ jobs:
3030
needs: check-container
3131
if: needs.check-container.outputs.exists == 'true'
3232
runs-on: ubuntu-latest
33-
container: cometbft/cometbft-db-testing:v1.0.2
33+
container: cometbft/cometbft-db-testing:v1.0.3
3434
steps:
3535
- uses: actions/checkout@v4
3636

@@ -61,12 +61,23 @@ jobs:
6161
with:
6262
driver: docker
6363

64-
- name: Build Docker image
64+
- name: Set up QEMU
65+
uses: docker/setup-qemu-action@v3
66+
67+
- name: Build Docker image (arm64) to ensure it works
68+
uses: docker/build-push-action@v6
69+
with:
70+
context: ./tools
71+
file: ./tools/Dockerfile.arm64
72+
platforms: linux/arm64
73+
74+
- name: Build Docker image (amd64) to be used in the next step
6575
uses: docker/build-push-action@v6
6676
with:
6777
context: ./tools
6878
file: ./tools/Dockerfile
6979
tags: "cometbft/cometbft-db-testing:latest"
80+
platforms: linux/amd64
7081
load: true
7182

7283
- name: test & coverage report creation

.github/workflows/docker.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
username: ${{ secrets.DOCKERHUB_USERNAME }}
4040
password: ${{ secrets.DOCKERHUB_TOKEN }}
4141

42-
- name: Publish to Docker Hub
42+
- name: Publish to Docker Hub (amd64)
4343
uses: docker/build-push-action@v6
4444
with:
4545
context: ./tools
@@ -49,3 +49,14 @@ jobs:
4949
tags: |
5050
cometbft/cometbft-db-testing:latest
5151
cometbft/cometbft-db-testing:${{ github.event.inputs.refName }}
52+
53+
- name: Publish to Docker Hub (arm64)
54+
uses: docker/build-push-action@v6
55+
with:
56+
context: ./tools
57+
file: ./tools/Dockerfile.arm64
58+
platforms: linux/arm64
59+
push: true
60+
tags: |
61+
cometbft/cometbft-db-testing:latest
62+
cometbft/cometbft-db-testing:${{ github.event.inputs.refName }}

tools/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,24 @@
1010
# PLEASE BUMP THE VERSION OF THE IMAGE IN `.github/workflows/ci.yml` WHEN YOU
1111
# MODIFY THIS FILE.
1212

13-
FROM golang:1.23.5 AS build
13+
FROM golang:1.23.5
1414

1515
ENV LD_LIBRARY_PATH=/usr/local/lib
1616

1717
RUN apt update \
1818
&& apt install -y \
1919
libbz2-dev libgflags-dev libsnappy-dev libzstd-dev zlib1g-dev liblz4-dev \
20-
make tar wget build-essential \
20+
make tar wget build-essential g++ cmake \
2121
libleveldb-dev libleveldb1d
2222

23-
FROM build AS install
2423
ARG ROCKSDB=9.8.4
2524

26-
# Install Rocksdb
25+
# Install RocksDB
2726
RUN \
2827
wget -q https://github.com/facebook/rocksdb/archive/refs/tags/v${ROCKSDB}.tar.gz \
2928
&& tar -zxf v${ROCKSDB}.tar.gz \
3029
&& cd rocksdb-${ROCKSDB} \
3130
&& DEBUG_LEVEL=0 make -j4 shared_lib \
3231
&& make install-shared \
33-
&& ldconfig \
3432
&& cd .. \
3533
&& rm -rf v${ROCKSDB}.tar.gz rocksdb-${ROCKSDB}

tools/Dockerfile.arm64

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file defines the container image used to build and test tm-db in CI.
2+
# The CI workflows use the latest tag of cometbft/cometbft-db-testing built
3+
# from these settings.
4+
#
5+
# The jobs defined in the Build & Push workflow will build and update the image
6+
# when changes to this file are merged. If you have other changes that require
7+
# updates here, merge the changes here first and let the image get updated (or
8+
# push a new version manually) before PRs that depend on them.
9+
10+
# PLEASE BUMP THE VERSION OF THE IMAGE IN `.github/workflows/ci.yml` WHEN YOU
11+
# MODIFY THIS FILE.
12+
13+
FROM golang:1.23.5
14+
15+
RUN apt update && apt install -y libleveldb-dev libleveldb1d

0 commit comments

Comments
 (0)