CI: Jenkins risczero setup (#770)

* Remove dep

* Use cargo as jenkins user

* Ensure that toolchain directory is setup before installation

* Debian 12 and gcc deps

* Env variables for risc zero dev mode

* Update testnet and base dockerfiles

* Env vars comments
This commit is contained in:
gusto 2024-09-26 17:00:47 +02:00 committed by GitHub
parent d83380cf02
commit a30a809ea1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 25 additions and 15 deletions

View File

@ -1,13 +1,14 @@
# BUILD IMAGE --------------------------------------------------------- # BUILD IMAGE ---------------------------------------------------------
FROM rust:1.80.0-slim-bullseye AS builder FROM rust:1.80.0-slim-bookworm AS builder
WORKDIR /nomos WORKDIR /nomos
COPY . . COPY . .
# Install dependencies needed for building RocksDB. # Install dependencies needed for building RocksDB.
RUN apt-get update && apt-get install -yq \ RUN apt-get update && apt-get install -yq \
git clang libssl-dev pkg-config protobuf-compiler git gcc g++ clang libssl-dev pkg-config \
protobuf-compiler
RUN cargo install cargo-binstall RUN cargo install cargo-binstall
RUN cargo binstall -y cargo-risczero RUN cargo binstall -y cargo-risczero

View File

@ -1,4 +1,4 @@
FROM rust:1.80.0-slim-bullseye FROM rust:1.80.0-slim-bookworm
LABEL maintainer="augustinas@status.im" \ LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \ source="https://github.com/logos-co/nomos-node" \
@ -6,16 +6,23 @@ LABEL maintainer="augustinas@status.im" \
# Dependecies for publishing documentation. # Dependecies for publishing documentation.
RUN apt-get update && apt-get install -yq \ RUN apt-get update && apt-get install -yq \
libssl-dev openssh-client git python3-pip clang \ libssl-dev openssh-client git gcc g++ \
pkg-config protobuf-compiler clang pkg-config protobuf-compiler
RUN pip install ghp-import
RUN rustup component add rustfmt clippy RUN rustup component add rustfmt clippy
RUN cargo install cargo-binstall
RUN cargo binstall -y cargo-risczero
RUN cargo risczero install
# Jenkins user needs a specific UID/GID to work. # Jenkins user needs a specific UID/GID to work.
RUN groupadd -g 1001 jenkins \ RUN groupadd -g 1001 jenkins \
&& useradd -u 1001 -g jenkins jenkins && useradd -u 1001 -g jenkins jenkins
# Create necessary directories and assign correct permissions
RUN mkdir -p /home/jenkins/.local/share/cargo-risczero/toolchains \
&& chown -R jenkins:jenkins /home/jenkins/.local \
&& mkdir -p /home/jenkins/.cargo \
&& chown -R jenkins:jenkins /home/jenkins/.cargo
USER jenkins
RUN cargo install cargo-binstall
RUN cargo binstall -y cargo-risczero
RUN cargo risczero install

View File

@ -18,10 +18,11 @@ pipeline {
} }
environment { environment {
/* Avoid cache poisoning by other jobs. */
GOCACHE = "${env.WORKSPACE_TMP}/go-build"
GOPATH = "${env.WORKSPACE_TMP}/go"
RUST_BACKTRACE = 1 RUST_BACKTRACE = 1
/* Use increased slot time in Nomos consensus */
CONSENSUS_SLOT_TIME = 5
/* Run Nomos tests in risc0 development mode */
RISC0_DEV_MODE = true
} }
options { options {

View File

@ -1,13 +1,14 @@
# BUILD IMAGE --------------------------------------------------------- # BUILD IMAGE ---------------------------------------------------------
FROM rust:1.80.0-slim-bullseye AS builder FROM rust:1.80.0-slim-bookworm AS builder
WORKDIR /nomos WORKDIR /nomos
COPY . . COPY . .
# Install dependencies needed for building RocksDB and etcd. # Install dependencies needed for building RocksDB and etcd.
RUN apt-get update && apt-get install -yq \ RUN apt-get update && apt-get install -yq \
git clang etcd-client libssl-dev pkg-config protobuf-compiler git gcc g++ clang etcd-client libssl-dev \
pkg-config protobuf-compiler
RUN cargo install cargo-binstall RUN cargo install cargo-binstall
RUN cargo binstall -y cargo-risczero RUN cargo binstall -y cargo-risczero