mirror of
https://github.com/logos-co/nomos-node.git
synced 2026-08-27 09:31:10 +00:00
chore(circuits): Remove legacy circuits related machinery (#3020)
This commit is contained in:
@@ -13,18 +13,6 @@ description: Set up Cargo Cache for Rust projects
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Compute LBC cache path
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||
echo "LBC_CACHE=$HOME/Library/Caches/logos/blockchain" >> "$GITHUB_ENV"
|
||||
elif [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
echo "LBC_CACHE path not defined yet for Windows runners" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "LBC_CACHE=${XDG_CACHE_HOME:-$HOME/.cache}/logos/blockchain" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Set up Cargo cache (main)
|
||||
id: setup-main
|
||||
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
||||
@@ -37,7 +25,6 @@ runs:
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
${{ env.LBC_CACHE }}
|
||||
target/debug/.fingerprint/
|
||||
target/debug/build/
|
||||
target/debug/deps/
|
||||
@@ -63,7 +50,6 @@ runs:
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
${{ env.LBC_CACHE }}
|
||||
target/debug/.fingerprint/
|
||||
target/debug/build/
|
||||
target/debug/deps/
|
||||
|
||||
@@ -13,18 +13,6 @@ description: Update Cargo Cache for Rust projects
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Compute LBC cache path
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||
echo "LBC_CACHE=$HOME/Library/Caches/logos/blockchain" >> "$GITHUB_ENV"
|
||||
elif [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
echo "LBC_CACHE path not defined yet for Windows runners" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "LBC_CACHE=${XDG_CACHE_HOME:-$HOME/.cache}/logos/blockchain" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Log cache directory sizes
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -32,8 +20,6 @@ runs:
|
||||
du -sh ~/.cargo/registry/index/ 2>/dev/null || echo " index: not found"
|
||||
du -sh ~/.cargo/registry/cache/ 2>/dev/null || echo " cache: not found"
|
||||
du -sh ~/.cargo/git/db/ 2>/dev/null || echo " git/db: not found"
|
||||
echo "=== Logos circuit cache ==="
|
||||
du -sh "$LBC_CACHE" 2>/dev/null || echo " logos/blockchain: not found"
|
||||
echo "=== target/debug ==="
|
||||
du -sh target/debug/.fingerprint/ 2>/dev/null || echo " .fingerprint: not found"
|
||||
du -sh target/debug/build/ 2>/dev/null || echo " build: not found"
|
||||
@@ -47,7 +33,6 @@ runs:
|
||||
~/.cargo/registry/index/ \
|
||||
~/.cargo/registry/cache/ \
|
||||
~/.cargo/git/db/ \
|
||||
"$LBC_CACHE" \
|
||||
target/debug/.fingerprint/ \
|
||||
target/debug/build/ \
|
||||
target/debug/deps/ \
|
||||
@@ -68,7 +53,6 @@ runs:
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
${{ env.LBC_CACHE }}
|
||||
target/debug/.fingerprint/
|
||||
target/debug/build/
|
||||
target/debug/deps/
|
||||
@@ -91,7 +75,6 @@ runs:
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
${{ env.LBC_CACHE }}
|
||||
target/debug/.fingerprint/
|
||||
target/debug/build/
|
||||
target/debug/deps/
|
||||
|
||||
@@ -134,16 +134,6 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # Version 4.2.2
|
||||
|
||||
- name: Purge old circuits
|
||||
run: |
|
||||
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
||||
rm -rf ~/.cache/logos/blockchain/
|
||||
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||
rm -rf ~/Library/Caches/logos/blockchain/
|
||||
else
|
||||
echo "Unsupported OS: $RUNNER_OS"
|
||||
fi
|
||||
|
||||
# Prune before any builds.
|
||||
- name: Prune disk space (cache-aware, self-hosted)
|
||||
uses: ./.github/actions/prune-disk-space
|
||||
|
||||
@@ -71,11 +71,6 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
# Set environment variables for circuits path - expand $HOME first since GitHub Actions env: blocks don't expand
|
||||
# shell variables
|
||||
- name: Set circuits path environment variable (new)
|
||||
run: echo "LOGOS_BLOCKCHAIN_CIRCUITS=$HOME/.logos-blockchain-circuits" >> $GITHUB_ENV
|
||||
|
||||
# Prune before any builds.
|
||||
- name: Prune disk space (cache-aware, self-hosted)
|
||||
uses: ./.github/actions/prune-disk-space
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# Ignore warnings about sensitive information as this is test data.
|
||||
|
||||
ARG LB_NODE_VERSION=0.1.3
|
||||
ARG LB_CIRCUITS_VERSION=v0.5.1
|
||||
|
||||
# ===========================
|
||||
# BUILD IMAGE
|
||||
@@ -12,13 +11,11 @@ ARG LB_CIRCUITS_VERSION=v0.5.1
|
||||
FROM alpine:latest AS builder
|
||||
|
||||
ARG LB_NODE_VERSION
|
||||
ARG LB_CIRCUITS_VERSION
|
||||
|
||||
WORKDIR /logos-blockchain
|
||||
COPY . .
|
||||
|
||||
RUN apk add --no-cache curl bash
|
||||
RUN scripts/setup-logos-blockchain-circuits.sh "$LB_CIRCUITS_VERSION" "linux-$(uname -m)"
|
||||
RUN scripts/setup-logos-blockchain-node.sh "$LB_NODE_VERSION" "linux-$(uname -m)"
|
||||
|
||||
# ===========================
|
||||
@@ -36,11 +33,6 @@ LABEL maintainer="augustinas@status.im" \
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends curl yq && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copies the entire cache dir.
|
||||
# We only need the circuits, but this is currently much simpler than just copying the circuits subdir.
|
||||
# This might be addressed later, after the circuits directories structure is standardised.
|
||||
RUN mkdir -p /home/runner/.cache/logos/blockchain/
|
||||
COPY --from=builder /opt/circuits /home/runner/.cache/logos/blockchain/
|
||||
COPY --from=builder /usr/local/bin/logos-blockchain-node /usr/local/bin/logos-blockchain-node
|
||||
|
||||
EXPOSE 3000 8080 9000 60000
|
||||
|
||||
+1
-11
@@ -2,9 +2,6 @@
|
||||
# check=skip=SecretsUsedInArgOrEnv
|
||||
# Ignore warnings about sensitive information as this is test data.
|
||||
|
||||
# Cache directory used by the circuits. Not meant to be overridden.
|
||||
ARG LB_CACHE=/root/.cache/logos/blockchain
|
||||
|
||||
# ===========================
|
||||
# BUILD IMAGE
|
||||
# ===========================
|
||||
@@ -26,7 +23,7 @@ WORKDIR /logos-blockchain/deployment/l2-sequencer-archival-demo/webapp
|
||||
RUN bun install --frozen-lockfile
|
||||
RUN VITE_SEQUENCER_URL=/api/sequencer VITE_ARCHIVER_URL=/api/archiver bun run build
|
||||
|
||||
# Build Rust Binaries & Circuits
|
||||
# Build Rust Binaries
|
||||
WORKDIR /logos-blockchain
|
||||
RUN cargo build --locked --release
|
||||
|
||||
@@ -35,8 +32,6 @@ RUN cargo build --locked --release
|
||||
# ===========================
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ARG LB_CACHE
|
||||
|
||||
LABEL maintainer="augustinas@status.im" \
|
||||
source="https://github.com/logos-blockchain/logos-blockchain" \
|
||||
description="Logos Blockchain node and other binaries image"
|
||||
@@ -46,11 +41,6 @@ RUN apt-get update && apt-get install -yq \
|
||||
python3 python3-pip curl git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copies the entire cache dir.
|
||||
# We only need the circuits, but this is currently much simpler than just copying the circuits subdir.
|
||||
# This might be addressed later, after the circuits directories structure is standardised.
|
||||
COPY --from=builder $LB_CACHE $LB_CACHE
|
||||
|
||||
# Copy Binaries
|
||||
COPY --from=builder /logos-blockchain/target/release/logos-blockchain-node /usr/bin/
|
||||
COPY --from=builder /logos-blockchain/target/release/logos-blockchain-cfgsync-server /usr/bin/
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
VERSION="${1:-0.5.1}"
|
||||
PLATFORM="${2:-linux-x86_64}"
|
||||
OUT_PATH="${3:-/opt/circuits}"
|
||||
|
||||
REPO="logos-blockchain/logos-blockchain-circuits"
|
||||
ARTIFACT_PREFIX="logos-blockchain-circuits"
|
||||
|
||||
ARTIFACT_NAME="${ARTIFACT_PREFIX}-${VERSION}-${PLATFORM}"
|
||||
ARTIFACT_TAR_GZ="${ARTIFACT_NAME}.tar.gz"
|
||||
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${VERSION}/${ARTIFACT_TAR_GZ}"
|
||||
TMP_FILE="/tmp/${ARTIFACT_TAR_GZ}"
|
||||
|
||||
echo "Installing Logos Circuits $VERSION ($PLATFORM) to $OUT_PATH."
|
||||
echo ">> Downloading: $DOWNLOAD_URL"
|
||||
|
||||
if ! curl -Lfo "$TMP_FILE" "$DOWNLOAD_URL"; then
|
||||
echo "Download failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$OUT_PATH"
|
||||
tar -xzf "$TMP_FILE" -C "$OUT_PATH"
|
||||
rm "$TMP_FILE"
|
||||
@@ -1,9 +1,6 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# check=skip=SecretsUsedInArgOrEnv
|
||||
|
||||
# Cache directory used by the circuits. Not meant to be overridden.
|
||||
ARG LB_CACHE=/root/.cache/logos/blockchain
|
||||
|
||||
FROM rust:1.96.0-slim-bookworm AS cfgsync-builder
|
||||
|
||||
WORKDIR /logos-blockchain-testing
|
||||
@@ -19,8 +16,6 @@ RUN cargo build --locked --release \
|
||||
|
||||
FROM rust:1.96.0-slim-bookworm AS builder
|
||||
|
||||
ARG LB_CACHE
|
||||
|
||||
WORKDIR /workspace
|
||||
COPY . .
|
||||
COPY --from=logos_blockchain_testing . /logos-blockchain-testing
|
||||
@@ -40,12 +35,6 @@ RUN apt-get update && apt-get install -yq \
|
||||
libstdc++6 libssl3 ca-certificates curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ARG LB_CACHE
|
||||
|
||||
# Copies the entire cache dir.
|
||||
# We only need the circuits, but this is currently much simpler than just copying the circuits subdir.
|
||||
# This might be addressed later, after the circuits directories structure is standardised.
|
||||
COPY --from=builder $LB_CACHE $LB_CACHE
|
||||
COPY --from=builder /workspace/target/release/logos-blockchain-node /usr/bin/logos-blockchain-node
|
||||
COPY --from=cfgsync-builder /logos-blockchain-testing/target/release/cfgsync-client /usr/bin/cfgsync-client
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
STACK_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)"
|
||||
REPO_ROOT="$(cd "${STACK_DIR}/../../../.." && pwd)"
|
||||
TESTING_ROOT="$(cd "${REPO_ROOT}/../logos-blockchain-testing" && pwd)"
|
||||
CIRCUITS_DIR="${LOGOS_BLOCKCHAIN_CIRCUITS:-$HOME/.logos-blockchain-circuits}"
|
||||
CIRCUITS_VERSION_FILE="${CIRCUITS_DIR}/VERSION"
|
||||
|
||||
IMAGE_TAG="${1:-logos-blockchain-node-testing:local}"
|
||||
FORCE_REBUILD="${LOGOS_FORCE_IMAGE_REBUILD:-0}"
|
||||
@@ -21,29 +19,10 @@ if [[ "${FORCE_REBUILD}" != "1" ]] && docker image inspect "${IMAGE_TAG}" >/dev/
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ ! -d "${CIRCUITS_DIR}" ]]; then
|
||||
echo "Circuits directory not found: ${CIRCUITS_DIR}" >&2
|
||||
echo "Set LOGOS_BLOCKCHAIN_CIRCUITS or install circuits into ~/.logos-blockchain-circuits" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "${CIRCUITS_VERSION_FILE}" ]]; then
|
||||
echo "Circuits version file not found: ${CIRCUITS_VERSION_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CIRCUITS_VERSION="$(tr -d '[:space:]' < "${CIRCUITS_VERSION_FILE}")"
|
||||
|
||||
if [[ -z "${CIRCUITS_VERSION}" ]]; then
|
||||
echo "Circuits version file is empty: ${CIRCUITS_VERSION_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building node image ${IMAGE_TAG} from ${STACK_DIR}/Dockerfile.node"
|
||||
docker buildx build \
|
||||
--load \
|
||||
--pull \
|
||||
--build-arg "LOGOS_CIRCUITS_VERSION=${CIRCUITS_VERSION}" \
|
||||
--build-context "logos_blockchain_testing=${TESTING_ROOT}" \
|
||||
-f "${STACK_DIR}/Dockerfile.node" \
|
||||
-t "${IMAGE_TAG}" \
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
use std::{
|
||||
env,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use std::{env, path::Path};
|
||||
|
||||
use anyhow::anyhow;
|
||||
use testing_framework_core::scenario::DynError;
|
||||
@@ -79,13 +76,11 @@ pub(super) fn build_cfgsync_container_spec(
|
||||
image: &str,
|
||||
platform: Option<String>,
|
||||
) -> DockerConfigServerSpec {
|
||||
let mut mounts = vec![DockerVolumeMount::read_only(
|
||||
let mounts = vec![DockerVolumeMount::read_only(
|
||||
testnet_dir.to_path_buf(),
|
||||
"/etc/logos".to_owned(),
|
||||
)];
|
||||
let mut env = Vec::new();
|
||||
|
||||
maybe_add_circuits_mount(&mut mounts, &mut env);
|
||||
let env: Vec<(String, String)> = Vec::new();
|
||||
|
||||
DockerConfigServerSpec::new(
|
||||
container_name.to_owned(),
|
||||
@@ -120,29 +115,6 @@ pub(super) fn resolve_bootstrap_image() -> (String, Option<String>) {
|
||||
(image, platform)
|
||||
}
|
||||
|
||||
fn maybe_add_circuits_mount(mounts: &mut Vec<DockerVolumeMount>, env: &mut Vec<(String, String)>) {
|
||||
let circuits_dir = env::var("LBC_ROOT_DIR_DOCKER")
|
||||
.ok()
|
||||
.or_else(|| env::var("LBC_ROOT_DIR").ok());
|
||||
|
||||
let Some(circuits_dir) = circuits_dir else {
|
||||
return;
|
||||
};
|
||||
|
||||
let host_path = PathBuf::from(&circuits_dir);
|
||||
if !host_path.exists() {
|
||||
return;
|
||||
}
|
||||
|
||||
let resolved_host_path = host_path.canonicalize().unwrap_or(host_path);
|
||||
env.push(("LOGOS_BLOCKCHAIN_CIRCUITS".to_owned(), circuits_dir.clone()));
|
||||
|
||||
mounts.push(DockerVolumeMount::read_only(
|
||||
resolved_host_path,
|
||||
circuits_dir,
|
||||
));
|
||||
}
|
||||
|
||||
fn base_volumes() -> Vec<String> {
|
||||
let mut volumes = vec!["./stack:/etc/logos".into()];
|
||||
if let Some(host_log_dir) = repository_root()
|
||||
|
||||
Reference in New Issue
Block a user