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

Feat/first nib images #1

Merged
merged 89 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
8c8af98
Initial PR
Nov 25, 2024
8238e3a
Fixed
Nov 25, 2024
2177620
Clean up
Nov 25, 2024
91b32dd
Fixed build workflow
Nov 25, 2024
ca6d53e
Fixed Dockerfiles client versioning, build workflow regex
Nov 25, 2024
49b208d
Fixed workflow auth
Nov 25, 2024
d085a04
Improved gha workflow
Nov 25, 2024
94f1c4d
Only build changed images
Nov 25, 2024
851623f
Fixed changes list
Nov 25, 2024
454b98a
Fixed json formatting
Nov 25, 2024
9a0d556
Fixed bootstrap
Nov 25, 2024
dd418d1
Added renovate step
Nov 25, 2024
ed9135d
Improved workflow
Nov 25, 2024
16d3d55
Improved versioning
Nov 25, 2024
a87c777
JSON fixes
Nov 25, 2024
b772579
JSON fixes
Nov 25, 2024
effaf06
JSON fixes
Nov 25, 2024
d4f855e
Fixed initial versioning
Nov 25, 2024
0d2ef84
Manual versions
Nov 25, 2024
ed53435
Reth dependencies
Nov 25, 2024
e4765d1
Added versions manually
Nov 25, 2024
d059b60
Detect all changes
Nov 29, 2024
7b93220
Fixes
Dec 18, 2024
795bfd6
update to lates nib and add protocols.yaml
Dec 19, 2024
69d6549
Added lighthouse, improved deps
Dec 19, 2024
81ff549
Fixes
Dec 19, 2024
c458c91
RHAI fixes
Dec 19, 2024
48b7224
Updated erigon
Dec 20, 2024
ad60f78
CICD improvements
Dec 23, 2024
78ce482
cicd fixes
Dec 23, 2024
86928e9
Reverted
Dec 23, 2024
e72e664
Added dynamic build-context
Dec 23, 2024
c752c18
Only include our images in build-context
Dec 23, 2024
7f25713
node-base tag fix
Dec 23, 2024
db096b3
fix client tag
Dec 23, 2024
478ade0
fix node-base tag
Dec 23, 2024
ee2162b
fix image URI
Dec 23, 2024
a2d716d
Fixed image URI
Dec 23, 2024
3e6b9ff
Fixed image URIs
Dec 23, 2024
9429ead
Fixed image URIs again
Dec 23, 2024
559bd52
Fixed workflow
Dec 23, 2024
93e8135
Fixed workflow
Dec 23, 2024
23d96dc
Fixed workflow
Dec 23, 2024
344510c
Fixed workflow
Dec 23, 2024
8bcc642
Fixed workflow
Dec 23, 2024
abbc4ae
Fixed workflow
Dec 23, 2024
96b77a0
Fixed protocol Dockerfiles
Dec 23, 2024
46c27ce
Run on self hosted
Dec 23, 2024
15bdc49
Send URIs to protocol images URI
Dec 23, 2024
75e638d
Improved builds, fixes for protocol dockerfiles
Dec 23, 2024
28c8f2d
Fix matrix empty path
Dec 23, 2024
a50335c
Improved matrix of changed protocols logic
Dec 23, 2024
becd687
Dummy change for testing
Dec 23, 2024
dd8ddf4
Docs
Dec 23, 2024
8ddb6fb
Dummy change for testing
Dec 23, 2024
f671280
Improved protocol matrix, test
Dec 23, 2024
4d30b3b
Fixed workflow
Dec 23, 2024
cbbec97
Test
Dec 23, 2024
5c7fc4e
Increased workflow verbosity
Dec 23, 2024
0d5196f
Fixed matrices
Dec 23, 2024
ce9e362
Dummy change for testing
Dec 23, 2024
53670bd
Fixed dir detection
Dec 23, 2024
3c7bfd4
Dummy change for testing
Dec 23, 2024
f38494b
Simplified changed file detection, test commit
Dec 23, 2024
635ae28
Improved path matching
Dec 23, 2024
84b4a28
Improved changed file detection
Dec 23, 2024
722585d
Improvements, test
Dec 23, 2024
df60e71
Dummy change for testing
Dec 23, 2024
4b5f9f5
Improved file detections
Dec 23, 2024
dfad824
Improved file detections
Dec 23, 2024
702365f
Debugging
Dec 23, 2024
490ba72
Fixed workflow
Dec 23, 2024
a9e7ca9
Fixed workflow
Dec 23, 2024
c90b8eb
Fixed workflow
Dec 23, 2024
a5b9ce0
Fixed workflow
Dec 23, 2024
c083f6e
Fixed workflow
Dec 23, 2024
fba1f7f
Fixed workflow
Dec 23, 2024
8325e4c
Fixed workflow
Dec 23, 2024
a9ac8f3
Fixed workflow
Dec 23, 2024
2738056
Fixed workflow
Dec 23, 2024
6019a9f
Fixed workflow
Dec 23, 2024
5805fc8
Fixed workflow
Dec 23, 2024
a697949
Fixed workflow
Dec 23, 2024
ba98ef3
Fixed workflow
Dec 23, 2024
ada7d4f
Fixed workflow
Dec 23, 2024
0f76695
Fixed workflow
Dec 23, 2024
ae4a902
Fixed workflow
Dec 23, 2024
9099d79
Rennovate config
Dec 23, 2024
e52f9c5
Merge branch 'main' into feat/first-nib-images
mateipopa Dec 23, 2024
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
347 changes: 347 additions & 0 deletions .github/workflows/docker-build.yml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions clients/consensus/lighthouse/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG BASE_IMAGE=node-base:latest
FROM ghcr.io/blockjoy/${BASE_IMAGE}

ENV DEBIAN_FRONTEND=noninteractive

ENV LIGHTHOUSE_VERSION=v5.3.0
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true

# Install system dependencies including libclang
RUN apt-get update && \
apt-get install -y \
clang \
libclang-dev \
cmake \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Rust and required dependencies
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
. "$HOME/.cargo/env" && \
rustup default stable && \
rustup target add x86_64-unknown-linux-gnu

# Build Lighthouse
WORKDIR /root
RUN git clone https://github.com/sigp/lighthouse.git && \
cd lighthouse && \
git checkout $LIGHTHOUSE_VERSION

WORKDIR /root/lighthouse
RUN . "$HOME/.cargo/env" && cargo build --release --features portable && \
mkdir -p /root/bin && \
cp /root/lighthouse/target/release/lighthouse /root/bin/lighthouse
24 changes: 24 additions & 0 deletions clients/exec/erigon/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG BASE_IMAGE=node-base:latest
FROM ghcr.io/blockjoy/${BASE_IMAGE} as builder

ENV DEBIAN_FRONTEND=noninteractive
ENV ERIGON_VERSION=v2.60.9
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOROOT="/usr/local/go"

RUN mkdir -p /root/bin

# Clone and checkout in a separate layer
WORKDIR /root
RUN git clone --depth 1 --branch $ERIGON_VERSION https://github.com/erigontech/erigon.git

# Build erigon with Go caching
WORKDIR /root/erigon
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
make erigon && \
cp build/bin/erigon /root/bin/

# Create minimal final image
FROM ghcr.io/blockjoy/${BASE_IMAGE}
COPY --from=builder /root/bin/erigon /root/bin/erigon
39 changes: 39 additions & 0 deletions clients/exec/reth/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ARG BASE_IMAGE=node-base:latest
FROM ghcr.io/blockjoy/${BASE_IMAGE} as builder

ENV DEBIAN_FRONTEND=noninteractive
ENV RETH_VERSION=v1.1.4
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true

# Install system dependencies in a separate layer
RUN apt-get update && \
apt-get install -y \
clang \
libclang-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Rust in a separate layer
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
. "$HOME/.cargo/env" && \
rustup default stable && \
rustup target add x86_64-unknown-linux-gnu

# Clone and checkout in a separate layer
WORKDIR /root
RUN --mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/root/.cargo/registry \
git clone --depth 1 --branch $RETH_VERSION https://github.com/paradigmxyz/reth.git

# Build reth with cargo caching
WORKDIR /root/reth
RUN --mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/reth/target \
. "$HOME/.cargo/env" && \
cargo build --profile maxperf && \
mkdir -p /root/bin && \
cp target/maxperf/reth /root/bin/

# Create minimal final image
FROM ghcr.io/blockjoy/${BASE_IMAGE}
COPY --from=builder /root/bin/reth /root/bin/reth
41 changes: 41 additions & 0 deletions ethereum/ethereum-erigon/Caddyfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
admin 127.0.0.1:2019 {
}
log {
output stdout
format json
level INFO
}
acme_dns cloudflare {$CLOUDFLARE_API_KEY}
auto_https disable_redirects
storage file_system {{ data_dir }}
email [email protected]
servers {
metrics
}
}

http://{{ hostname }}{{ tld }}, https://{{ hostname }}{{ tld }}, *.blkjy.io, http:// {
log {
output stdout
}
log_append upstream_host {rp.upstream.host}
log_append upstream_port {rp.upstream.port}
log_append upstream_requests {rp.upstream.requests}
log_append upstream_max_requests {rp.upstream.max_requests}
log_append upstream_fails {rp.upstream.fails}
log_append upstream_latency {rp.upstream.latency}
log_append upstream_latency_ms {rp.upstream.latency_ms}
log_append upstream_duration_ms {rp.upstream.duration_ms}
log_append duration_ms {rp.duration_ms}
@websockets {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy 127.0.0.1:{{ rpc_port }} {
header_up Host localhost
}
reverse_proxy @websockets 127.0.0.1:{{ ws_port }} {
header_up Host localhost
}
}
26 changes: 26 additions & 0 deletions ethereum/ethereum-erigon/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG ERIGON_IMAGE=ghcr.io/blockjoy/erigon:latest
ARG LIGHTHOUSE_IMAGE=ghcr.io/blockjoy/lighthouse:latest
ARG BASE_IMAGE=ghcr.io/blockjoy/node-base:latest

FROM ${ERIGON_IMAGE} as erigon-build

FROM ${LIGHTHOUSE_IMAGE} AS lighthouse-build

FROM ${BASE_IMAGE}

ARG CLOUDFLARE_API_KEY
ARG GRAFANA_LOKI_BASICAUTH
ARG GRAFANA_PROM_BASICAUTH

ENV CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY}
ENV GRAFANA_LOKI_BASICAUTH=${GRAFANA_LOKI_BASICAUTH}
ENV GRAFANA_PROM_BASICAUTH=${GRAFANA_PROM_BASICAUTH}

RUN mkdir -p /root/bin
COPY --from=erigon-build /root/bin/erigon /root/bin/
COPY --from=lighthouse-build /root/bin/lighthouse /root/bin/

COPY Caddyfile.template /var/lib/babel/templates/Caddyfile.template
COPY erigon.rhai /var/lib/babel/plugin/
COPY main.rhai /var/lib/babel/plugin/
COPY config-alloy.template /var/lib/babel/templates/config-alloy.template
67 changes: 67 additions & 0 deletions ethereum/ethereum-erigon/babel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: 0.0.1
container_uri: docker-daemon://ethereum-erigon:latest
sku_code: ETH-ERG
org_id: null
description: Ethereum Erigon node
visibility: public
protocol_key: ethereum
variants:
- key: erigon-mainnet-full
min_cpu: 16
min_memory_mb: 65536
min_disk_gb: 5000
archive_pointers:
- pointer: !store_id ethereum-erigon-mainnet-full-v1
- key: erigon-sepolia-full
min_cpu: 4
min_memory_mb: 16000
min_disk_gb: 2000
archive_pointers:
- pointer: !store_id ethereum-erigon-sepolia-full-v1
- key: erigon-mainnet-archive
min_cpu: 16
min_memory_mb: 65536
min_disk_gb: 5000
archive_pointers:
- pointer: !store_id ethereum-erigon-mainnet-archive-v1
- key: erigon-sepolia-archive
min_cpu: 4
min_memory_mb: 16000
min_disk_gb: 2000
archive_pointers:
- pointer: !store_id ethereum-erigon-sepolia-archive-v1
firewall_config:
default_in: deny
default_out: allow
rules:
- key: Allow incoming ports TCP
description: Allow TCP inbound traffic on port 80, 443
protocol: tcp
direction: in
action: allow
ips:
- ip: 0.0.0.0/0
name: allow all traffic
ports:
- port: 80
name: HTTP port
- port: 443
name: HTTPS port
- port: 3000
name: Grafana port
- key: Allow P2P ports TCP/UDP
description: Allow inbound traffic on P2P ports
protocol: both
direction: in
action: allow
ips:
- ip: 0.0.0.0/0
name: allow all traffic
ports:
- port: 30303
name: P2P port 1
- port: 30304
name: P2P port 2
- port: 42069
name: Torrent port
properties: []
Loading