Skip to content

Commit 00315d9

Browse files
shenkeyaoQuentinI
andauthored
IA1.2.5 Generate dockers for the Caff node, OP deployer, and OP batcher services (#203)
* Working devnet * Update dockers for l1 services * Fix op-proposer * Fix node js script * Remove npm from script * Install foundry * Add op-deployer path * Install dasel * Fix reshape-allocs script * Continue fixing reshape-allocs script * Continue fixing reshape-allocs script * Convert branch name * Undo branch name change * Fix typo * Fix dockerfile for l1-genesis * Update dockerfile for op-geth * More conflicts * More conflicts * Fix l2-genesis * Fix context path * Fix deployer for terraform * Fix path * More fixes and rebuild * Add preparation scripts to l2 CI * Fix l1 rpc path * Move l2-rollup command to dockerfile * Add config path in docker for op-node * Add preparation steps to op-node CI * Add l2-config to CI * Force jwt * Remove newline * Add image for batcher * Add CI for batcher * Restore servcie order --------- Co-authored-by: Artemii Gerasimovich <[email protected]>
1 parent 07b00cd commit 00315d9

File tree

8 files changed

+614
-197
lines changed

8 files changed

+614
-197
lines changed

.github/workflows/docker-images.yml

Lines changed: 259 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,46 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v4
3030

31+
- name: Install just
32+
uses: extractions/setup-just@v2
33+
34+
- name: Install Rust
35+
uses: actions-rs/toolchain@v1
36+
with:
37+
toolchain: stable
38+
override: true
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20.x
44+
45+
- name: Install Foundry
46+
uses: foundry-rs/foundry-toolchain@v1
47+
with:
48+
version: nightly
49+
50+
- name: Install dasel
51+
run: |
52+
curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
53+
sudo mv /tmp/dasel /usr/local/bin/dasel
54+
sudo chmod +x /usr/local/bin/dasel
55+
dasel --version
56+
57+
- name: Build op-deployer
58+
run: |
59+
cd op-deployer
60+
just
61+
echo "$(pwd)/bin" >> $GITHUB_PATH
62+
63+
- name: Compile contracts
64+
run: just compile-contracts
65+
66+
- name: Prepare allocations
67+
run: |
68+
cd espresso
69+
./scripts/prepare-allocs.sh
70+
3171
- name: Login to GitHub Container Registry
3272
uses: docker/login-action@v3
3373
with:
@@ -50,7 +90,7 @@ jobs:
5090
- name: Build and push L1 Geth
5191
uses: docker/build-push-action@v5
5292
with:
53-
context: espresso/docker/l1-geth
93+
context: .
5494
file: espresso/docker/l1-geth/Dockerfile
5595
platforms: linux/amd64
5696
push: true
@@ -66,6 +106,60 @@ jobs:
66106
- name: Checkout
67107
uses: actions/checkout@v4
68108

109+
- name: Install just
110+
uses: extractions/setup-just@v2
111+
112+
- name: Install Rust
113+
uses: actions-rs/toolchain@v1
114+
with:
115+
toolchain: stable
116+
override: true
117+
118+
- name: Install Foundry
119+
uses: foundry-rs/foundry-toolchain@v1
120+
with:
121+
version: nightly
122+
123+
- name: Install dasel
124+
run: |
125+
curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
126+
sudo mv /tmp/dasel /usr/local/bin/dasel
127+
sudo chmod +x /usr/local/bin/dasel
128+
129+
- name: Check for package.json
130+
id: check-package
131+
run: |
132+
if [ -f "package.json" ]; then
133+
echo "has-package=true" >> $GITHUB_OUTPUT
134+
else
135+
echo "has-package=false" >> $GITHUB_OUTPUT
136+
fi
137+
138+
- name: Setup Node.js
139+
if: steps.check-package.outputs.has-package == 'true'
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: '18'
143+
cache: 'npm'
144+
145+
- name: Install dependencies
146+
if: steps.check-package.outputs.has-package == 'true'
147+
run: npm ci
148+
149+
- name: Build op-deployer
150+
run: |
151+
cd op-deployer
152+
just
153+
echo "$(pwd)/bin" >> $GITHUB_PATH
154+
155+
- name: Compile contracts
156+
run: just compile-contracts
157+
158+
- name: Prepare allocations
159+
run: |
160+
cd espresso
161+
./scripts/prepare-allocs.sh
162+
69163
- name: Login to GitHub Container Registry
70164
uses: docker/login-action@v3
71165
with:
@@ -88,7 +182,7 @@ jobs:
88182
- name: Build and push OP Geth
89183
uses: docker/build-push-action@v5
90184
with:
91-
context: espresso/docker/op-geth
185+
context: .
92186
file: espresso/docker/op-geth/Dockerfile
93187
platforms: linux/amd64
94188
push: true
@@ -104,6 +198,66 @@ jobs:
104198
- name: Checkout
105199
uses: actions/checkout@v4
106200

201+
- name: Install just
202+
uses: extractions/setup-just@v2
203+
204+
- name: Install Rust
205+
uses: actions-rs/toolchain@v1
206+
with:
207+
toolchain: stable
208+
override: true
209+
210+
- name: Install Foundry
211+
uses: foundry-rs/foundry-toolchain@v1
212+
with:
213+
version: nightly
214+
215+
- name: Install dasel
216+
run: |
217+
curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
218+
sudo mv /tmp/dasel /usr/local/bin/dasel
219+
sudo chmod +x /usr/local/bin/dasel
220+
221+
- name: Check for package.json
222+
id: check-package
223+
run: |
224+
if [ -f "package.json" ]; then
225+
echo "has-package=true" >> $GITHUB_OUTPUT
226+
else
227+
echo "has-package=false" >> $GITHUB_OUTPUT
228+
fi
229+
230+
- name: Setup Node.js
231+
if: steps.check-package.outputs.has-package == 'true'
232+
uses: actions/setup-node@v4
233+
with:
234+
node-version: '18'
235+
cache: 'npm'
236+
237+
- name: Install dependencies
238+
if: steps.check-package.outputs.has-package == 'true'
239+
run: npm ci
240+
241+
- name: Build op-deployer
242+
run: |
243+
cd op-deployer
244+
just
245+
echo "$(pwd)/bin" >> $GITHUB_PATH
246+
247+
- name: Compile contracts
248+
run: just compile-contracts
249+
250+
- name: Prepare allocations
251+
run: |
252+
cd espresso
253+
./scripts/prepare-allocs.sh
254+
255+
- name: Create l2-config directory
256+
run: |
257+
mkdir -p espresso/deployment/l2-config
258+
echo "Created l2-config directory"
259+
ls -la espresso/deployment/
260+
107261
- name: Login to GitHub Container Registry
108262
uses: docker/login-action@v3
109263
with:
@@ -137,3 +291,106 @@ jobs:
137291
TARGET_BASE_IMAGE=alpine:3.22
138292
TARGETOS=linux
139293
TARGETARCH=amd64
294+
295+
build-op-batcher:
296+
runs-on: ubuntu-latest
297+
permissions:
298+
contents: read
299+
packages: write
300+
steps:
301+
- name: Checkout
302+
uses: actions/checkout@v4
303+
304+
- name: Install just
305+
uses: extractions/setup-just@v2
306+
307+
- name: Install Rust
308+
uses: actions-rs/toolchain@v1
309+
with:
310+
toolchain: stable
311+
override: true
312+
313+
- name: Install Foundry
314+
uses: foundry-rs/foundry-toolchain@v1
315+
with:
316+
version: nightly
317+
318+
- name: Install dasel
319+
run: |
320+
curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
321+
sudo mv /tmp/dasel /usr/local/bin/dasel
322+
sudo chmod +x /usr/local/bin/dasel
323+
324+
- name: Check for package.json
325+
id: check-package
326+
run: |
327+
if [ -f "package.json" ]; then
328+
echo "has-package=true" >> $GITHUB_OUTPUT
329+
else
330+
echo "has-package=false" >> $GITHUB_OUTPUT
331+
fi
332+
333+
- name: Setup Node.js
334+
if: steps.check-package.outputs.has-package == 'true'
335+
uses: actions/setup-node@v4
336+
with:
337+
node-version: '18'
338+
cache: 'npm'
339+
340+
- name: Install dependencies
341+
if: steps.check-package.outputs.has-package == 'true'
342+
run: npm ci
343+
344+
- name: Build op-deployer
345+
run: |
346+
cd op-deployer
347+
just
348+
echo "$(pwd)/bin" >> $GITHUB_PATH
349+
350+
- name: Compile contracts
351+
run: just compile-contracts
352+
353+
- name: Prepare allocations
354+
run: |
355+
cd espresso
356+
./scripts/prepare-allocs.sh
357+
358+
- name: Copy config for op-batcher
359+
run: |
360+
mkdir -p packages/contracts-bedrock/lib/superchain-registry/ops/testdata/monorepo
361+
# Copy any required config files here, or create placeholder
362+
echo "Config prepared for op-batcher"
363+
364+
- name: Login to GitHub Container Registry
365+
uses: docker/login-action@v3
366+
with:
367+
registry: ${{ env.REGISTRY }}
368+
username: ${{ github.actor }}
369+
password: ${{ secrets.GITHUB_TOKEN }}
370+
371+
- name: Extract metadata
372+
id: meta
373+
uses: docker/metadata-action@v5
374+
with:
375+
images: ${{ env.IMAGE_PREFIX }}/op-batcher
376+
tags: |
377+
type=ref,event=branch
378+
type=ref,event=pr
379+
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
380+
type=raw,value=latest,enable={{is_default_branch}}
381+
type=raw,value=pr-${{ github.event.number }},enable=${{ github.event_name == 'pull_request' }}
382+
383+
- name: Build and push OP Batcher
384+
uses: docker/build-push-action@v5
385+
with:
386+
context: .
387+
file: espresso/docker/op-stack/Dockerfile
388+
target: op-batcher-target
389+
platforms: linux/amd64
390+
push: true
391+
tags: ${{ steps.meta.outputs.tags }}
392+
labels: ${{ steps.meta.outputs.labels }}
393+
build-args: |
394+
TARGET_BASE_IMAGE=alpine:3.22
395+
TARGETOS=linux
396+
TARGETARCH=amd64

0 commit comments

Comments
 (0)