Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tech Debt] Remove the orchestrator and rewrite the examples #3945

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
16 changes: 5 additions & 11 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
.git
/target/tmp
/target/release*
/target/debug
/target/x86_64-unknown-linux-musl/release*/build
/target/x86_64-unknown-linux-musl/release*/deps
/target/x86_64-unknown-linux-musl/release*/incremental
!/target/x86_64-unknown-linux-musl/release*/examples/
!/target/release*/examples/
!/target/release-lto/examples/
!/target/release*/benchmark_client
Dockerfile*
target/*
!target/release/examples/cdn-broker
!target/release/examples/cdn-marshal
!target/release/examples/coordinator
!target/release/examples/single-validator
43 changes: 43 additions & 0 deletions .github/workflows/build-and-push-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Examples

on:
push:
branches:
- "main"


jobs:
build-and-push-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- name: Install Rust
uses: mkroening/rust-toolchain-toml@main

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
shared-key: "build-release"
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Build examples
run: cargo build --examples --release

- name: Build dockerfiles
run: |
docker build . -f crates/examples/Dockerfiles/cdn-marshal.Dockerfile -t ghcr.io/espressosystems/hotshot/cdn-marshal:main
docker build . -f crates/examples/Dockerfiles/cdn-broker.Dockerfile -t ghcr.io/espressosystems/hotshot/cdn-broker:main
docker build . -f crates/examples/Dockerfiles/coordinator.Dockerfile -t ghcr.io/espressosystems/hotshot/coordinator:main
docker build . -f crates/examples/Dockerfiles/single-validator.Dockerfile -t ghcr.io/espressosystems/hotshot/single-validator:main

- name: Push dockerfiles
run: |
docker push ghcr.io/espressosystems/hotshot/cdn-marshal:main
docker push ghcr.io/espressosystems/hotshot/cdn-broker:main
docker push ghcr.io/espressosystems/hotshot/coordinator:main
docker push ghcr.io/espressosystems/hotshot/single-validator:main


235 changes: 0 additions & 235 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,239 +52,4 @@ jobs:
env:
RUST_BACKTRACE: full

test-examples:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- name: Install Rust
uses: mkroening/rust-toolchain-toml@main

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
shared-key: "examples"
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}

- uses: taiki-e/install-action@just

- name: Test examples
run: |
just example all-push-cdn -- --config_file ./crates/orchestrator/run-config.toml
timeout-minutes: 20

build-release:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- name: Install Rust
uses: mkroening/rust-toolchain-toml@main

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
shared-key: "build-release"
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}

- uses: taiki-e/install-action@just

- name: Build examples in release mode
run: just build_release --examples --package hotshot-examples --no-default-features

- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: binaries-amd64
path: |
target/release/examples/counter
target/release/examples/multi-validator-libp2p
target/release/examples/validator-libp2p
target/release/examples/validator-combined
target/release/examples/validator-push-cdn
target/release/examples/orchestrator
target/release/examples/cdn-broker
target/release/examples/cdn-marshal

build-arm-release:
strategy:
fail-fast: false
runs-on: buildjet-4vcpu-ubuntu-2204-arm
if: ${{ github.ref == 'refs/heads/main' }}
container: ghcr.io/espressosystems/devops-rust:stable
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
shared-key: "build-arm-release"
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Build examples in release mode
run: just build_release --examples --package hotshot-examples --no-default-features

- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: binaries-aarch64
path: |
target/release/examples/counter
target/release/examples/multi-validator-libp2p
target/release/examples/validator-libp2p
target/release/examples/validator-combined
target/release/examples/validator-push-cdn
target/release/examples/orchestrator
target/release/examples/cdn-broker
target/release/examples/cdn-marshal

build-dockers:
strategy:
fail-fast: false
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [build-release, build-arm-release, test]
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Docker BuildKit (buildx)
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Repo
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download AMD executables
uses: actions/download-artifact@v4
with:
name: binaries-amd64
path: target/amd64/release/examples

- name: Download ARM executables
uses: actions/download-artifact@v4
with:
name: binaries-aarch64
path: target/arm64/release/examples

- name: Generate validator-libp2p docker metadata
uses: docker/metadata-action@v5
id: validator-libp2p
with:
images: ghcr.io/espressosystems/hotshot/validator-libp2p

- name: Generate validator-combined docker metadata
uses: docker/metadata-action@v5
id: validator-combined
with:
images: ghcr.io/espressosystems/hotshot/validator-combined

- name: Generate validator-push-cdn docker metadata
uses: docker/metadata-action@v5
id: validator-push-cdn
with:
images: ghcr.io/espressosystems/hotshot/validator-push-cdn

- name: Generate orchestrator docker metadata
uses: docker/metadata-action@v5
id: orchestrator
with:
images: ghcr.io/espressosystems/hotshot/orchestrator

- name: Generate cdn-broker docker metadata
uses: docker/metadata-action@v5
id: cdn-broker
with:
images: ghcr.io/espressosystems/hotshot/cdn-broker

- name: Generate cdn-marshal docker metadata
uses: docker/metadata-action@v5
id: cdn-marshal
with:
images: ghcr.io/espressosystems/hotshot/cdn-marshal

- name: Build and push validator-libp2p docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/validator-libp2p.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.validator-libp2p.outputs.tags }}
labels: ${{ steps.validator-libp2p.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push validator-combined docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/validator-combined.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.validator-combined.outputs.tags }}
labels: ${{ steps.validator-combined.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push validator-push-cdn docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/validator-cdn.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.validator-push-cdn.outputs.tags }}
labels: ${{ steps.validator-push-cdn.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push orchestrator docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/orchestrator.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.orchestrator.outputs.tags }}
labels: ${{ steps.orchestrator.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push cdn-broker docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/cdn-broker.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.cdn-broker.outputs.tags }}
labels: ${{ steps.cdn-broker.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push cdn-marshal docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/cdn-marshal.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.cdn-marshal.outputs.tags }}
labels: ${{ steps.cdn-marshal.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 0 additions & 1 deletion .github/workflows/test-sequencer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
hotshot-signature-key = { path = "${GITHUB_WORKSPACE}/hotshot/crates/hotshot-signature-key" }
hotshot-stake-table = { path = "${GITHUB_WORKSPACE}/hotshot/crates/hotshot-stake-table" }
hotshot-state-prover = { path = "${GITHUB_WORKSPACE}/hotshot/crates/hotshot-state-prover" }
hotshot-orchestrator = { path = "${GITHUB_WORKSPACE}/hotshot/crates/orchestrator" }
hotshot-web-server = { path = "${GITHUB_WORKSPACE}/hotshot/crates/web_server" }
hotshot-task-impls = { path = "${GITHUB_WORKSPACE}/hotshot/crates/task-impls" }
hotshot-testing = { path = "${GITHUB_WORKSPACE}/hotshot/crates/testing" }
Expand Down
45 changes: 0 additions & 45 deletions CHANGELOG.md

This file was deleted.

Loading
Loading