Skip to content

Commit 34ee573

Browse files
committed
Feature/commit boost default image (#464)
1 parent d37fae6 commit 34ee573

21 files changed

Lines changed: 106 additions & 282 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
VALUE=$(python .github/workflows/release/release.py is-latest "${{ inputs.tag }}")
7474
echo "value=$VALUE" >> $GITHUB_OUTPUT
7575
76-
# Builds the x64 and arm64 binaries for Linux, for all 3 crates, via the Docker builder
76+
# Builds the x64 and arm64 binaries for Linux via the Docker builder
7777
build-binaries-linux:
7878
needs: [resolve-tag]
7979
timeout-minutes: 60
@@ -230,7 +230,7 @@ jobs:
230230
packages: write
231231
strategy:
232232
matrix:
233-
crate: [pbs, signer]
233+
crate: [pbs, signer, commit-boost]
234234
runs-on: ubuntu-latest
235235
timeout-minutes: 45
236236
steps:
@@ -251,10 +251,10 @@ jobs:
251251
run: |
252252
mkdir -p ./artifacts/bin/linux_amd64
253253
mkdir -p ./artifacts/bin/linux_arm64
254-
tar -xzf ./artifacts/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_x86-64/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_x86-64.tar.gz -C ./artifacts/bin
255-
mv ./artifacts/bin/commit-boost-${{ matrix.crate }} ./artifacts/bin/linux_amd64/commit-boost-${{ matrix.crate }}
256-
tar -xzf ./artifacts/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_arm64/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_arm64.tar.gz -C ./artifacts/bin
257-
mv ./artifacts/bin/commit-boost-${{ matrix.crate }} ./artifacts/bin/linux_arm64/commit-boost-${{ matrix.crate }}
254+
tar -xzf ./artifacts/commit-boost-${{ inputs.tag }}-linux_x86-64/commit-boost-${{ inputs.tag }}-linux_x86-64.tar.gz -C ./artifacts/bin
255+
mv ./artifacts/bin/commit-boost ./artifacts/bin/linux_amd64/commit-boost
256+
tar -xzf ./artifacts/commit-boost-${{ inputs.tag }}-linux_arm64/commit-boost-${{ inputs.tag }}-linux_arm64.tar.gz -C ./artifacts/bin
257+
mv ./artifacts/bin/commit-boost ./artifacts/bin/linux_arm64/commit-boost
258258
259259
- name: Set lowercase owner
260260
run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
@@ -298,7 +298,7 @@ jobs:
298298
uses: actions/download-artifact@v4
299299
with:
300300
path: ./artifacts
301-
pattern: "commit-boost*"
301+
pattern: "commit-boost-*"
302302

303303
- name: Sign all binaries with Sigstore
304304
uses: sigstore/gh-action-sigstore-python@v3.0.0
@@ -311,7 +311,7 @@ jobs:
311311
name: signed-${{ inputs.tag }}
312312
path: ./artifacts/**/*.sigstore*
313313

314-
# Creates a release on GitHub with the binaries
314+
# Creates a draft release on GitHub with the binaries
315315
finalize-release:
316316
needs:
317317
- build-binaries-linux
@@ -328,13 +328,7 @@ jobs:
328328
uses: actions/download-artifact@v4
329329
with:
330330
path: ./artifacts
331-
pattern: "commit-boost*"
332-
333-
- name: Download signatures
334-
uses: actions/download-artifact@v4
335-
with:
336-
path: ./artifacts
337-
pattern: "signatures-${{ github.ref_name }}*"
331+
pattern: "commit-boost-*"
338332

339333
- name: Download signed artifacts
340334
uses: actions/download-artifact@v4
@@ -351,75 +345,4 @@ jobs:
351345
tag_name: ${{ inputs.tag }}
352346
name: ${{ inputs.tag }}
353347
env:
354-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
355-
356-
# Fast-forwards stable (full release) or beta (RC) to the new tag.
357-
# Runs after all artifacts are built and the draft release is created,
358-
# so stable/beta are never touched if any part of the pipeline fails.
359-
fast-forward-branch:
360-
needs:
361-
- finalize-release
362-
runs-on: ubuntu-latest
363-
steps:
364-
- uses: actions/create-github-app-token@v1
365-
id: app-token
366-
with:
367-
app-id: ${{ secrets.APP_ID }}
368-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
369-
370-
- uses: actions/checkout@v4
371-
with:
372-
fetch-depth: 0
373-
token: ${{ steps.app-token.outputs.token }}
374-
375-
- name: Configure git
376-
run: |
377-
git config user.name "commit-boost-release-bot[bot]"
378-
git config user.email "commit-boost-release-bot[bot]@users.noreply.github.com"
379-
380-
- name: Fast-forward beta branch (RC releases)
381-
if: contains(github.ref_name, '-rc')
382-
run: |
383-
git checkout beta
384-
git merge --ff-only "${{ github.ref_name }}"
385-
git push origin beta
386-
387-
- name: Fast-forward stable branch (full releases)
388-
if: "!contains(github.ref_name, '-rc')"
389-
run: |
390-
git checkout stable
391-
git merge --ff-only "${{ github.ref_name }}"
392-
git push origin stable
393-
394-
# Deletes the tag if any job in the release pipeline fails.
395-
# This keeps the tag and release artifacts in sync — a tag should only
396-
# exist if the full pipeline completed successfully.
397-
# stable/beta are never touched on failure since fast-forward-branch
398-
# only runs after finalize-release succeeds.
399-
#
400-
# Note: if finalize-release specifically fails, a draft release may already
401-
# exist on GitHub pointing at the now-deleted tag and will need manual cleanup.
402-
cleanup-on-failure:
403-
needs:
404-
- build-binaries-linux
405-
- build-binaries-darwin
406-
- sign-binaries
407-
- build-and-push-pbs-docker
408-
- build-and-push-signer-docker
409-
- finalize-release
410-
- fast-forward-branch
411-
runs-on: ubuntu-latest
412-
if: failure()
413-
steps:
414-
- uses: actions/create-github-app-token@v1
415-
id: app-token
416-
with:
417-
app-id: ${{ secrets.APP_ID }}
418-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
419-
420-
- uses: actions/checkout@v4
421-
with:
422-
token: ${{ steps.app-token.outputs.token }}
423-
424-
- name: Delete tag
425-
run: git push origin --delete ${{ github.ref_name }}
348+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releases/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Example verification flow:
7373
export REPO=Commit-Boost/commit-boost-client
7474
export VERSION=vX.Y.Z
7575
export ARCH=linux_x86-64
76-
export BIN=commit-boost-pbs
76+
export BIN=commit-boost
7777
7878
curl -L \
7979
-o "$BIN-$VERSION-$ARCH.tar.gz" \
@@ -87,7 +87,7 @@ cosign verify-blob \
8787
"$BIN-$VERSION-$ARCH.tar.gz" \
8888
--bundle "$BIN-$VERSION-$ARCH.tar.gz.sigstore.json" \
8989
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
90-
--certificate-identity="https://github.com/Commit-Boost/commit-boost-client/.github/workflows/release.yml@refs/heads/main"
90+
--certificate-identity="https://github.com/$REPO/.github/workflows/release.yml@refs/heads/main"
9191
```
9292

9393
To verify assets from a fork, replace `REPO` with the fork path, for example:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Install cosign: [cosign installation guide](https://docs.sigstore.dev/cosign/sys
4343
export REPO=Commit-Boost/commit-boost-client
4444
export VERSION=vX.Y.Z
4545
export ARCH=linux_x86-64
46-
export BIN=commit-boost-pbs
46+
export BIN=commit-boost
4747

4848
# Download the binary tarball and its signature bundle
4949
curl -L \
@@ -59,7 +59,7 @@ cosign verify-blob \
5959
"$BIN-$VERSION-$ARCH.tar.gz" \
6060
--bundle "$BIN-$VERSION-$ARCH.tar.gz.sigstore.json" \
6161
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
62-
--certificate-identity="https://github.com/Commit-Boost/commit-boost-client/.github/workflows/release.yml@refs/heads/main"
62+
--certificate-identity="https://github.com/$REPO/.github/workflows/release.yml@refs/heads/main"
6363
```
6464

6565
A successful verification prints `Verified OK`. If the binary was modified after being built by CI, verification will fail.

bin/tests/binary.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ use cb_cli::docker_init::{CB_COMPOSE_FILE, CB_ENV_FILE};
88
const MINIMAL_PBS_TOML: &str = r#"
99
chain = "Holesky"
1010
[pbs]
11-
docker_image = "ghcr.io/commit-boost/pbs:latest"
11+
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
1212
"#;
1313

1414
const MINIMAL_WITH_MODULE_TOML: &str = r#"
1515
chain = "Holesky"
1616
[pbs]
17-
docker_image = "ghcr.io/commit-boost/pbs:latest"
17+
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
1818
1919
[signer.local.loader]
2020
key_path = "/keys/keys.json"
@@ -127,7 +127,7 @@ fn test_init_compose_file_pbs_service_structure() {
127127

128128
let pbs = &compose["services"]["cb_pbs"];
129129
assert!(!pbs.is_null(), "cb_pbs service must exist");
130-
assert_eq!(pbs["image"].as_str(), Some("ghcr.io/commit-boost/pbs:latest"), "image");
130+
assert_eq!(pbs["image"].as_str(), Some("ghcr.io/commit-boost/commit-boost:latest"), "image");
131131
assert_eq!(pbs["container_name"].as_str(), Some("cb_pbs"), "container_name");
132132

133133
// Config file must be mounted inside the container.

config.example.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ chain = "Holesky"
1010
# Configuration for the PBS module
1111
[pbs]
1212
# Docker image to use for the PBS module.
13-
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/pbs:latest
14-
docker_image = "ghcr.io/commit-boost/pbs:latest"
13+
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/commit-boost:latest
14+
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
1515
# Whether to enable the PBS module to request signatures from the Signer module (not used in the default PBS image)
1616
# OPTIONAL, DEFAULT: false
1717
with_signer = false
@@ -175,8 +175,8 @@ url = "http://0xa119589bb33ef52acbb8116832bec2b58fca590fe5c85eac5d3230b44d5bc09f
175175
# More details on the docs (https://commit-boost.github.io/commit-boost-client/get_started/configuration/#signer-module)
176176
[signer]
177177
# Docker image to use for the Signer module.
178-
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/signer:latest
179-
docker_image = "ghcr.io/commit-boost/signer:latest"
178+
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/commit-boost:latest
179+
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
180180
# Host to bind the Signer API server to
181181
# OPTIONAL, DEFAULT: 127.0.0.1
182182
host = "127.0.0.1"

crates/cli/src/docker_init.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use cb_common::{
2424
utils::random_jwt_secret,
2525
};
2626
use docker_compose_types::{
27-
Compose, DependsCondition, DependsOnOptions, EnvFile, Environment, Healthcheck,
27+
Command, Compose, DependsCondition, DependsOnOptions, EnvFile, Environment, Healthcheck,
2828
HealthcheckTest, MapOrEmpty, NetworkSettings, Networks, Ports, Service, Services, SingleValue,
2929
Volumes,
3030
};
@@ -310,6 +310,7 @@ fn create_pbs_service(service_config: &mut ServiceCreationInfo) -> eyre::Result<
310310
let pbs_service = Service {
311311
container_name: Some("cb_pbs".to_owned()),
312312
image: Some(cb_config.pbs.docker_image.clone()),
313+
command: Some(Command::Args(vec!["pbs".to_owned()])),
313314
ports: Ports::Short(ports),
314315
volumes,
315316
environment: Environment::KvPair(envs),
@@ -459,6 +460,7 @@ fn create_signer_service_local(
459460
let signer_service = Service {
460461
container_name: Some("cb_signer".to_owned()),
461462
image: Some(signer_config.docker_image.clone()),
463+
command: Some(Command::Args(vec!["signer".to_owned()])),
462464
networks: Networks::Simple(signer_networks),
463465
ports: Ports::Short(ports),
464466
volumes,
@@ -586,6 +588,7 @@ fn create_signer_service_dirk(
586588
let signer_service = Service {
587589
container_name: Some("cb_signer".to_owned()),
588590
image: Some(signer_config.docker_image.clone()),
591+
command: Some(Command::Args(vec!["signer".to_owned()])),
589592
networks: Networks::Simple(signer_networks),
590593
ports: Ports::Short(ports),
591594
volumes,
@@ -871,7 +874,7 @@ mod tests {
871874
r#"
872875
chain = "Holesky"
873876
[pbs]
874-
docker_image = "ghcr.io/commit-boost/pbs:latest"
877+
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
875878
"#,
876879
)
877880
.expect("valid minimal test config")
@@ -1126,7 +1129,7 @@ mod tests {
11261129
let service = create_pbs_service(&mut sc)?;
11271130

11281131
assert_eq!(service.container_name.as_deref(), Some("cb_pbs"));
1129-
assert_eq!(service.image.as_deref(), Some("ghcr.io/commit-boost/pbs:latest"));
1132+
assert_eq!(service.image.as_deref(), Some("ghcr.io/commit-boost/commit-boost:latest"));
11301133
assert!(env_str(&service, CONFIG_ENV).is_some());
11311134
assert!(env_str(&service, PBS_ENDPOINT_ENV).is_some());
11321135
assert!(service.healthcheck.is_some());

crates/common/src/config/constants.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ pub const METRICS_PORT_ENV: &str = "CB_METRICS_PORT";
1414
pub const LOGS_DIR_ENV: &str = "CB_LOGS_DIR";
1515
pub const LOGS_DIR_DEFAULT: &str = "/var/logs/commit-boost";
1616

17+
/// Default Docker image
18+
pub const COMMIT_BOOST_IMAGE_DEFAULT: &str = "ghcr.io/commit-boost/commit-boost:latest";
19+
1720
///////////////////////// PBS /////////////////////////
1821

19-
pub const PBS_IMAGE_DEFAULT: &str = "ghcr.io/commit-boost/pbs:latest";
2022
pub const PBS_SERVICE_NAME: &str = "pbs";
2123

2224
/// Where to receive BuilderAPI calls from beacon node
@@ -26,7 +28,6 @@ pub const MUX_PATH_ENV: &str = "CB_MUX_PATH";
2628

2729
///////////////////////// SIGNER /////////////////////////
2830

29-
pub const SIGNER_IMAGE_DEFAULT: &str = "ghcr.io/commit-boost/signer:latest";
3031
pub const SIGNER_SERVICE_NAME: &str = "signer";
3132

3233
/// Where the signer module should open the server

crates/common/src/config/pbs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use super::{
2323
use crate::{
2424
commit::client::SignerClient,
2525
config::{
26-
CONFIG_ENV, MODULE_JWT_ENV, MuxKeysLoader, PBS_IMAGE_DEFAULT, PBS_SERVICE_NAME, PbsMuxes,
27-
SIGNER_TLS_CERTIFICATE_NAME, SIGNER_TLS_CERTIFICATES_PATH_ENV, SIGNER_URL_ENV,
26+
COMMIT_BOOST_IMAGE_DEFAULT, CONFIG_ENV, MODULE_JWT_ENV, MuxKeysLoader, PBS_SERVICE_NAME,
27+
PbsMuxes, SIGNER_TLS_CERTIFICATE_NAME, SIGNER_TLS_CERTIFICATES_PATH_ENV, SIGNER_URL_ENV,
2828
SignerConfig, TlsMode, load_env_var, load_file_from_env,
2929
},
3030
pbs::{
@@ -257,7 +257,7 @@ pub struct PbsModuleConfig {
257257
}
258258

259259
fn default_pbs() -> String {
260-
PBS_IMAGE_DEFAULT.to_string()
260+
COMMIT_BOOST_IMAGE_DEFAULT.to_string()
261261
}
262262

263263
/// Loads the default pbs config, i.e. with no signer client or custom data

crates/common/src/config/signer.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use super::{
2222
};
2323
use crate::{
2424
config::{
25-
DIRK_CA_CERT_ENV, DIRK_CERT_ENV, DIRK_DIR_SECRETS_ENV, DIRK_KEY_ENV, SIGNER_IMAGE_DEFAULT,
25+
COMMIT_BOOST_IMAGE_DEFAULT, DIRK_CA_CERT_ENV, DIRK_CERT_ENV, DIRK_DIR_SECRETS_ENV,
26+
DIRK_KEY_ENV,
2627
},
2728
signer::{ProxyStore, SignerLoader},
2829
types::{Chain, ModuleId},
@@ -164,7 +165,7 @@ impl SignerConfig {
164165
}
165166

166167
fn default_signer_image() -> String {
167-
SIGNER_IMAGE_DEFAULT.to_string()
168+
COMMIT_BOOST_IMAGE_DEFAULT.to_string()
168169
}
169170

170171
fn default_tls_mode() -> TlsMode {
@@ -424,7 +425,10 @@ mod tests {
424425
use alloy::primitives::{Uint, b256};
425426

426427
use super::*;
427-
use crate::config::{LogsSettings, ModuleKind, PbsConfig, StaticModuleConfig, StaticPbsConfig};
428+
use crate::config::{
429+
COMMIT_BOOST_IMAGE_DEFAULT, LogsSettings, ModuleKind, PbsConfig, StaticModuleConfig,
430+
StaticPbsConfig,
431+
};
428432

429433
// Wrapper needed because TOML requires a top-level struct (can't serialize
430434
// a bare enum).
@@ -437,7 +441,7 @@ mod tests {
437441
SignerConfig {
438442
host: Ipv4Addr::LOCALHOST,
439443
port: 20000,
440-
docker_image: SIGNER_IMAGE_DEFAULT.to_string(),
444+
docker_image: COMMIT_BOOST_IMAGE_DEFAULT.to_string(),
441445
jwt_auth_fail_limit: 3,
442446
jwt_auth_fail_timeout_seconds: 300,
443447
tls_mode,
@@ -851,7 +855,7 @@ mod tests {
851855
cfg.signer = Some(SignerConfig {
852856
host: Ipv4Addr::new(127, 0, 0, 1),
853857
port: 20000,
854-
docker_image: SIGNER_IMAGE_DEFAULT.to_string(),
858+
docker_image: COMMIT_BOOST_IMAGE_DEFAULT.to_string(),
855859
jwt_auth_fail_limit: 3,
856860
jwt_auth_fail_timeout_seconds: 300,
857861
tls_mode: TlsMode::Insecure,

docs/docs/get_started/building.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Commit-Boost's components are all written in [Rust](https://www.rust-lang.org/).
44

55
## Building via the Docker Builder
66

7-
For convenience, Commit-Boost has Dockerized the build environment for Linux `x64` and `arm64` platforms. It utilizes Docker's powerful [buildx](https://docs.docker.com/reference/cli/docker/buildx/) system. All of the prerequisites, cross-compilation tooling, and configuration are handled by the builder image. If you would like to build the CLI, PBS module, or Signer binaries and Docker images from source, you are welcome to use the Docker builder process.
7+
For convenience, Commit-Boost has Dockerized the build environment for Linux `x64` and `arm64` platforms. It utilizes Docker's powerful [buildx](https://docs.docker.com/reference/cli/docker/buildx/) system. All of the prerequisites, cross-compilation tooling, and configuration are handled by the builder image. If you would like to build the Commit-Boost binary and Docker image from source, you are welcome to use the Docker builder process.
88

99
To use the builder, you will need to have [Docker Engine](https://docs.docker.com/engine/install/) installed on your system. Please follow the instructions to install it first.
1010

@@ -18,9 +18,8 @@ Use `just --list` to show all of the actions - there are many. The `justfile` pr
1818

1919
Below is a brief summary of the relevant ones for building the Commit-Boost artifacts:
2020

21-
- `build-all <version>` will build the `commit-boost` binary for your local system architecture. It will also create Docker images called `commit-boost/pbs:<version>` and `commit-boost/signer:<version>` and load them into your local Docker registry for use.
21+
- `build-all <version>` builds the `commit-boost` binary to `./build/<version>` and creates a Docker image called `commit-boost/commit-boost:<version>` (a unified image that bundles all subcommands), loading it into your local Docker registry.
2222
- `build-bin <version>` can be used to create the `commit-boost` binary itself.
23-
- `build-pbs-img <version>` and `build-signer-img <version>` can be used to create the Docker images for the PBS and Signer services, respectively.
2423

2524
The `version` provided will be used to house the output binaries in `./build/<version>`, and act as the version tag for the Docker images when they're added to your local system or uploaded to your local Docker repository. For example, using `$(git rev-parse --short HEAD)` will set the version to the current commit hash.
2625

0 commit comments

Comments
 (0)