Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 11 additions & 88 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v1.2.3)"
description: 'Release tag (e.g. v1.2.3)'
required: true
type: string

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
VALUE=$(python .github/workflows/release/release.py is-latest "${{ inputs.tag }}")
echo "value=$VALUE" >> $GITHUB_OUTPUT

# Builds the x64 and arm64 binaries for Linux, for all 3 crates, via the Docker builder
# Builds the x64 and arm64 binaries for Linux via the Docker builder
build-binaries-linux:
needs: [resolve-tag]
timeout-minutes: 60
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
packages: write
strategy:
matrix:
crate: [pbs, signer]
crate: [pbs, signer, commit-boost]
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
Expand All @@ -250,10 +250,10 @@ jobs:
run: |
mkdir -p ./artifacts/bin/linux_amd64
mkdir -p ./artifacts/bin/linux_arm64
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
mv ./artifacts/bin/commit-boost-${{ matrix.crate }} ./artifacts/bin/linux_amd64/commit-boost-${{ matrix.crate }}
tar -xzf ./artifacts/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_arm64/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_arm64.tar.gz -C ./artifacts/bin
mv ./artifacts/bin/commit-boost-${{ matrix.crate }} ./artifacts/bin/linux_arm64/commit-boost-${{ matrix.crate }}
tar -xzf ./artifacts/commit-boost-${{ inputs.tag }}-linux_x86-64/commit-boost-${{ inputs.tag }}-linux_x86-64.tar.gz -C ./artifacts/bin
mv ./artifacts/bin/commit-boost ./artifacts/bin/linux_amd64/commit-boost
tar -xzf ./artifacts/commit-boost-${{ inputs.tag }}-linux_arm64/commit-boost-${{ inputs.tag }}-linux_arm64.tar.gz -C ./artifacts/bin
mv ./artifacts/bin/commit-boost ./artifacts/bin/linux_arm64/commit-boost

- name: Set lowercase owner
run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
Expand Down Expand Up @@ -297,7 +297,7 @@ jobs:
uses: actions/download-artifact@v4
with:
path: ./artifacts
pattern: "commit-boost*"
pattern: "commit-boost-*"

- name: Sign all binaries with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.0.0
Expand All @@ -310,7 +310,7 @@ jobs:
name: signed-${{ inputs.tag }}
path: ./artifacts/**/*.sigstore*

# Creates a release on GitHub with the binaries
# Creates a draft release on GitHub with the binaries
finalize-release:
needs:
- build-binaries-linux
Expand All @@ -327,13 +327,7 @@ jobs:
uses: actions/download-artifact@v4
with:
path: ./artifacts
pattern: "commit-boost*"

- name: Download signatures
uses: actions/download-artifact@v4
with:
path: ./artifacts
pattern: "signatures-${{ github.ref_name }}*"
pattern: "commit-boost-*"

- name: Download signed artifacts
uses: actions/download-artifact@v4
Expand All @@ -350,75 +344,4 @@ jobs:
tag_name: ${{ inputs.tag }}
name: ${{ inputs.tag }}
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

# Fast-forwards stable (full release) or beta (RC) to the new tag.
# Runs after all artifacts are built and the draft release is created,
# so stable/beta are never touched if any part of the pipeline fails.
fast-forward-branch:
needs:
- finalize-release
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- name: Configure git
run: |
git config user.name "commit-boost-release-bot[bot]"
git config user.email "commit-boost-release-bot[bot]@users.noreply.github.com"

- name: Fast-forward beta branch (RC releases)
if: contains(github.ref_name, '-rc')
run: |
git checkout beta
git merge --ff-only "${{ github.ref_name }}"
git push origin beta

- name: Fast-forward stable branch (full releases)
if: "!contains(github.ref_name, '-rc')"
run: |
git checkout stable
git merge --ff-only "${{ github.ref_name }}"
git push origin stable

# Deletes the tag if any job in the release pipeline fails.
# This keeps the tag and release artifacts in sync — a tag should only
# exist if the full pipeline completed successfully.
# stable/beta are never touched on failure since fast-forward-branch
# only runs after finalize-release succeeds.
#
# Note: if finalize-release specifically fails, a draft release may already
# exist on GitHub pointing at the now-deleted tag and will need manual cleanup.
cleanup-on-failure:
needs:
- build-binaries-linux
- build-binaries-darwin
- sign-binaries
- build-and-push-pbs-docker
- build-and-push-signer-docker
- finalize-release
- fast-forward-branch
runs-on: ubuntu-latest
if: failure()
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}

- name: Delete tag
run: git push origin --delete ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions bin/tests/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use cb_cli::docker_init::{CB_COMPOSE_FILE, CB_ENV_FILE};
const MINIMAL_PBS_TOML: &str = r#"
chain = "Holesky"
[pbs]
docker_image = "ghcr.io/commit-boost/pbs:latest"
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
"#;

const MINIMAL_WITH_MODULE_TOML: &str = r#"
chain = "Holesky"
[pbs]
docker_image = "ghcr.io/commit-boost/pbs:latest"
docker_image = "ghcr.io/commit-boost/commit-boost:latest"

[signer.local.loader]
key_path = "/keys/keys.json"
Expand Down Expand Up @@ -127,7 +127,7 @@ fn test_init_compose_file_pbs_service_structure() {

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

// Config file must be mounted inside the container.
Expand Down
8 changes: 4 additions & 4 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ chain = "Holesky"
# Configuration for the PBS module
[pbs]
# Docker image to use for the PBS module.
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/pbs:latest
docker_image = "ghcr.io/commit-boost/pbs:latest"
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/commit-boost:latest
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
# Whether to enable the PBS module to request signatures from the Signer module (not used in the default PBS image)
# OPTIONAL, DEFAULT: false
with_signer = false
Expand Down Expand Up @@ -175,8 +175,8 @@ url = "http://0xa119589bb33ef52acbb8116832bec2b58fca590fe5c85eac5d3230b44d5bc09f
# More details on the docs (https://commit-boost.github.io/commit-boost-client/get_started/configuration/#signer-module)
[signer]
# Docker image to use for the Signer module.
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/signer:latest
docker_image = "ghcr.io/commit-boost/signer:latest"
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/commit-boost:latest
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
# Host to bind the Signer API server to
# OPTIONAL, DEFAULT: 127.0.0.1
host = "127.0.0.1"
Expand Down
9 changes: 6 additions & 3 deletions crates/cli/src/docker_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use cb_common::{
utils::random_jwt_secret,
};
use docker_compose_types::{
Compose, DependsCondition, DependsOnOptions, EnvFile, Environment, Healthcheck,
Command, Compose, DependsCondition, DependsOnOptions, EnvFile, Environment, Healthcheck,
HealthcheckTest, MapOrEmpty, NetworkSettings, Networks, Ports, Service, Services, SingleValue,
Volumes,
};
Expand Down Expand Up @@ -310,6 +310,7 @@ fn create_pbs_service(service_config: &mut ServiceCreationInfo) -> eyre::Result<
let pbs_service = Service {
container_name: Some("cb_pbs".to_owned()),
image: Some(cb_config.pbs.docker_image.clone()),
command: Some(Command::Args(vec!["pbs".to_owned()])),
ports: Ports::Short(ports),
volumes,
environment: Environment::KvPair(envs),
Expand Down Expand Up @@ -459,6 +460,7 @@ fn create_signer_service_local(
let signer_service = Service {
container_name: Some("cb_signer".to_owned()),
image: Some(signer_config.docker_image.clone()),
command: Some(Command::Args(vec!["signer".to_owned()])),
networks: Networks::Simple(signer_networks),
ports: Ports::Short(ports),
volumes,
Expand Down Expand Up @@ -586,6 +588,7 @@ fn create_signer_service_dirk(
let signer_service = Service {
container_name: Some("cb_signer".to_owned()),
image: Some(signer_config.docker_image.clone()),
command: Some(Command::Args(vec!["signer".to_owned()])),
networks: Networks::Simple(signer_networks),
ports: Ports::Short(ports),
volumes,
Expand Down Expand Up @@ -871,7 +874,7 @@ mod tests {
r#"
chain = "Holesky"
[pbs]
docker_image = "ghcr.io/commit-boost/pbs:latest"
docker_image = "ghcr.io/commit-boost/commit-boost:latest"
"#,
)
.expect("valid minimal test config")
Expand Down Expand Up @@ -1126,7 +1129,7 @@ mod tests {
let service = create_pbs_service(&mut sc)?;

assert_eq!(service.container_name.as_deref(), Some("cb_pbs"));
assert_eq!(service.image.as_deref(), Some("ghcr.io/commit-boost/pbs:latest"));
assert_eq!(service.image.as_deref(), Some("ghcr.io/commit-boost/commit-boost:latest"));
assert!(env_str(&service, CONFIG_ENV).is_some());
assert!(env_str(&service, PBS_ENDPOINT_ENV).is_some());
assert!(service.healthcheck.is_some());
Expand Down
4 changes: 2 additions & 2 deletions crates/common/src/config/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub const LOGS_DIR_DEFAULT: &str = "/var/logs/commit-boost";

///////////////////////// PBS /////////////////////////

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

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

///////////////////////// SIGNER /////////////////////////

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

/// Where the signer module should open the server
Expand Down
5 changes: 2 additions & 3 deletions docs/docs/get_started/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Commit-Boost's components are all written in [Rust](https://www.rust-lang.org/).

## Building via the Docker Builder

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.
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.

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.

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

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

- `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.
- `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.
- `build-bin <version>` can be used to create the `commit-boost` binary itself.
- `build-pbs-img <version>` and `build-signer-img <version>` can be used to create the Docker images for the PBS and Signer services, respectively.

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.

Expand Down
16 changes: 11 additions & 5 deletions docs/docs/get_started/running/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Below is a simple configuration for running only the PBS service on the Hoodi ne
chain = "Hoodi"

[pbs]
docker_image = "ghcr.io/commit-boost/pbs:v0.8.0"
docker_image = "ghcr.io/commit-boost/commit-boost:v0.8.0"
relay_check = true
wait_all_registrations = true

Expand All @@ -80,13 +80,15 @@ Run `commit-boost init --config cb-config.toml` with the above configuration, th
```
services:
cb_pbs:
command:
- pbs
healthcheck:
test: curl -f http://localhost:18550/eth/v1/builder/status
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
image: ghcr.io/commit-boost/pbs:v0.8.0
image: ghcr.io/commit-boost/commit-boost:v0.8.0
container_name: cb_pbs
ports:
- 127.0.0.1:18550:18550
Expand Down Expand Up @@ -143,7 +145,7 @@ Below is a simple configuration for running only the three modules on the Hoodi
chain = "Hoodi"

[pbs]
docker_image = "ghcr.io/commit-boost/pbs:v0.8.0"
docker_image = "ghcr.io/commit-boost/commit-boost:v0.8.0"
relay_check = true
wait_all_registrations = true

Expand Down Expand Up @@ -204,13 +206,15 @@ services:
cb_signer:
condition: service_healthy
cb_pbs:
command:
- pbs
healthcheck:
test: curl -f http://localhost:18550/eth/v1/builder/status
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
image: ghcr.io/commit-boost/pbs:latest
image: ghcr.io/commit-boost/commit-boost:latest
container_name: cb_pbs
ports:
- 127.0.0.1:18550:18550
Expand All @@ -220,13 +224,15 @@ services:
volumes:
- ./cb-config.toml:/cb-config.toml:ro
cb_signer:
command:
- signer
healthcheck:
test: curl -f http://localhost:20000/status
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
image: ghcr.io/commit-boost/signer:latest
image: ghcr.io/commit-boost/commit-boost:latest
container_name: cb_signer
ports:
- 127.0.0.1:20000:20000
Expand Down
Loading