Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6cda2cd4
Commit
6cda2cd4
authored
Oct 09, 2021
by
Matthew Slipper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce Docker layer caching
parent
ad4b432f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
122 additions
and
21 deletions
+122
-21
ext-test-snx.yml
.github/workflows/ext-test-snx.yml
+26
-2
integration.yml
.github/workflows/integration.yml
+29
-2
sync-tests.yml
.github/workflows/sync-tests.yml
+27
-2
Dockerfile.batch-submitter
ops/docker/Dockerfile.batch-submitter
+2
-1
Dockerfile.data-transport-layer
ops/docker/Dockerfile.data-transport-layer
+2
-1
Dockerfile.deployer
ops/docker/Dockerfile.deployer
+2
-1
Dockerfile.integration-tests
ops/docker/Dockerfile.integration-tests
+2
-1
Dockerfile.message-relayer
ops/docker/Dockerfile.message-relayer
+2
-1
build-ci.sh
ops/scripts/build-ci.sh
+30
-10
No files found.
.github/workflows/ext-test-snx.yml
View file @
6cda2cd4
...
@@ -5,6 +5,11 @@ on: workflow_dispatch
...
@@ -5,6 +5,11 @@ on: workflow_dispatch
jobs
:
jobs
:
integration
:
integration
:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
services
:
registry
:
image
:
registry:2
ports
:
-
5000:5000
env
:
env
:
DOCKER_BUILDKIT
:
1
DOCKER_BUILDKIT
:
1
COMPOSE_DOCKER_CLI_BUILD
:
1
COMPOSE_DOCKER_CLI_BUILD
:
1
...
@@ -28,9 +33,23 @@ jobs:
...
@@ -28,9 +33,23 @@ jobs:
restore-keys
:
|
restore-keys
:
|
${{ runner.os }}-yarn-
${{ runner.os }}-yarn-
-
uses
:
actions/cache@v2
name
:
Set up layer cache
with
:
path
:
/tmp/.buildx-cache
key
:
${{ runner.os }}-buildx-1-${{ github.sha }}
restore-keys
:
|
${{ runner.os }}-buildx-1-
-
uses
:
docker/setup-buildx-action@master
name
:
Set up Docker Buildx
id
:
buildx
with
:
version
:
latest
driver-opts
:
image=moby/buildkit:master,network=host
-
name
:
Build the services
-
name
:
Build the services
working-directory
:
./ops
run
:
./ops/scripts/build-ci.sh
run
:
./scripts/build-ci.sh
-
name
:
Bring the stack up
-
name
:
Bring the stack up
working-directory
:
./ops
working-directory
:
./ops
...
@@ -63,3 +82,8 @@ jobs:
...
@@ -63,3 +82,8 @@ jobs:
with
:
with
:
name
:
logs.tgz
name
:
logs.tgz
path
:
./logs.tgz
path
:
./logs.tgz
-
name
:
Move cache
run
:
|
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
.github/workflows/integration.yml
View file @
6cda2cd4
...
@@ -13,6 +13,11 @@ on:
...
@@ -13,6 +13,11 @@ on:
jobs
:
jobs
:
integration
:
integration
:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
services
:
registry
:
image
:
registry:2
ports
:
-
5000:5000
env
:
env
:
DOCKER_BUILDKIT
:
1
DOCKER_BUILDKIT
:
1
COMPOSE_DOCKER_CLI_BUILD
:
1
COMPOSE_DOCKER_CLI_BUILD
:
1
...
@@ -32,9 +37,23 @@ jobs:
...
@@ -32,9 +37,23 @@ jobs:
restore-keys
:
|
restore-keys
:
|
${{ runner.os }}-yarn-
${{ runner.os }}-yarn-
-
uses
:
actions/cache@v2
name
:
Set up layer cache
with
:
path
:
/tmp/.buildx-cache
key
:
${{ runner.os }}-buildx-1-${{ github.sha }}
restore-keys
:
|
${{ runner.os }}-buildx-1-
-
uses
:
docker/setup-buildx-action@master
name
:
Set up Docker Buildx
id
:
buildx
with
:
version
:
latest
driver-opts
:
image=moby/buildkit:master,network=host
-
name
:
Build the services
-
name
:
Build the services
working-directory
:
./ops
run
:
./ops/scripts/build-ci.sh
run
:
./scripts/build-ci.sh
-
name
:
Bring the stack up
-
name
:
Bring the stack up
working-directory
:
./ops
working-directory
:
./ops
...
@@ -67,3 +86,11 @@ jobs:
...
@@ -67,3 +86,11 @@ jobs:
with
:
with
:
name
:
logs.tgz
name
:
logs.tgz
path
:
./logs.tgz
path
:
./logs.tgz
# Needed to address the following bugs:
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
-
name
:
Move cache
run
:
|
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
.github/workflows/sync-tests.yml
View file @
6cda2cd4
...
@@ -5,6 +5,11 @@ on: workflow_dispatch
...
@@ -5,6 +5,11 @@ on: workflow_dispatch
jobs
:
jobs
:
integration-sync-test
:
integration-sync-test
:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
services
:
registry
:
image
:
registry:2
ports
:
-
5000:5000
env
:
env
:
DOCKER_BUILDKIT
:
1
DOCKER_BUILDKIT
:
1
COMPOSE_DOCKER_CLI_BUILD
:
1
COMPOSE_DOCKER_CLI_BUILD
:
1
...
@@ -22,9 +27,24 @@ jobs:
...
@@ -22,9 +27,24 @@ jobs:
key
:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key
:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys
:
|
restore-keys
:
|
${{ runner.os }}-yarn-
${{ runner.os }}-yarn-
-
uses
:
actions/cache@v2
name
:
Set up layer cache
with
:
path
:
/tmp/.buildx-cache
key
:
${{ runner.os }}-buildx-1-${{ github.sha }}
restore-keys
:
|
${{ runner.os }}-buildx-1-
-
uses
:
docker/setup-buildx-action@master
name
:
Set up Docker Buildx
id
:
buildx
with
:
version
:
latest
driver-opts
:
image=moby/buildkit:master,network=host
-
name
:
Build the services
-
name
:
Build the services
working-directory
:
./ops
run
:
./ops/scripts/build-ci.sh
run
:
./scripts/build-ci.sh
-
name
:
Bring the stack up
-
name
:
Bring the stack up
working-directory
:
./ops
working-directory
:
./ops
...
@@ -54,3 +74,8 @@ jobs:
...
@@ -54,3 +74,8 @@ jobs:
with
:
with
:
name
:
logs.tgz
name
:
logs.tgz
path
:
./logs.tgz
path
:
./logs.tgz
-
name
:
Move cache
run
:
|
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
ops/docker/Dockerfile.batch-submitter
View file @
6cda2cd4
FROM ethereumoptimism/builder AS builder
ARG LOCAL_REGISTRY=docker.io
FROM ${LOCAL_REGISTRY}/ethereumoptimism/builder AS builder
FROM node:14-alpine
FROM node:14-alpine
...
...
ops/docker/Dockerfile.data-transport-layer
View file @
6cda2cd4
FROM ethereumoptimism/builder AS builder
ARG LOCAL_REGISTRY=docker.io
FROM ${LOCAL_REGISTRY}/ethereumoptimism/builder AS builder
FROM node:14-alpine
FROM node:14-alpine
...
...
ops/docker/Dockerfile.deployer
View file @
6cda2cd4
FROM ethereumoptimism/builder AS builder
ARG LOCAL_REGISTRY=docker.io
FROM ${LOCAL_REGISTRY}/ethereumoptimism/builder AS builder
FROM node:14-alpine
FROM node:14-alpine
...
...
ops/docker/Dockerfile.integration-tests
View file @
6cda2cd4
FROM ethereumoptimism/builder AS builder
ARG LOCAL_REGISTRY=docker.io
FROM ${LOCAL_REGISTRY}/ethereumoptimism/builder AS builder
FROM node:14-alpine
FROM node:14-alpine
...
...
ops/docker/Dockerfile.message-relayer
View file @
6cda2cd4
FROM ethereumoptimism/builder AS builder
ARG LOCAL_REGISTRY=docker.io
FROM ${LOCAL_REGISTRY}/ethereumoptimism/builder AS builder
FROM node:14-alpine
FROM node:14-alpine
...
...
ops/scripts/build-ci.sh
View file @
6cda2cd4
# build in 2 steps
# Builds an image using Buildx. Usage:
function
build_images
()
{
# build <name> <tag> <dockerfile> <context>
docker-compose build
--parallel
--
builder l2geth l1_chain
function
build
()
{
docker-compose build
--parallel
--
deployer dtl batch_submitter relayer integration_tests
echo
"Building
$1
."
echo
"Tag:
$2
"
echo
"Dockerfile:
$3
"
echo
"Context:
$4
"
docker buildx build
--tag
"
$2
"
--build-arg
LOCAL_REGISTRY
=
localhost:5000
--cache-from
"type=local,src=/tmp/.buildx-cache/
$1
"
--cache-to
=
"type=local,dest=/tmp/.buildx-cache-new/
$1
"
--file
"
$3
"
--load
"
$4
"
&
}
}
function
build_dependencies
()
{
mkdir
-p
/tmp/.buildx-cache-new
yarn
docker buildx build
--tag
"localhost:5000/ethereumoptimism/builder:latest"
--cache-from
"type=local,src=/tmp/.buildx-cache/builder"
--cache-to
=
"type=local,mode=max,dest=/tmp/.buildx-cache-new/builder"
--file
"./ops/docker/Dockerfile.monorepo"
--push
.
&
yarn build
build l2geth
"ethereumoptimism/l2geth:latest"
"./ops/docker/Dockerfile.geth"
.
}
build l1chain
"ethereumoptimism/hardhat:latest"
"./ops/docker/hardhat/Dockerfile"
./ops/docker/hardhat
wait
# BuildX builds everything in a container when docker-container is selected as
# the backend. Unfortunately, this means that the built image must be pushed
# then re-pulled in order to make the container accessible to the Docker daemon.
# We have to use the docker-container backend since the the docker backend does
# not support cache-from and cache-to.
docker pull localhost:5000/ethereumoptimism/builder:latest
# Re-tag the local registry version of the builder so that docker-compose and
# friends can see it.
docker tag localhost:5000/ethereumoptimism/builder:latest ethereumoptimism/builder:latest
build_images &
build deployer
"ethereumoptimism/deployer:latest"
"./ops/docker/Dockerfile.deployer"
.
build_dependencies &
build dtl
"ethereumoptimism/data-transport-layer:latest"
"./ops/docker/Dockerfile.data-transport-layer"
.
build batch_submitter
"ethereumoptimism/batch-submitter:latest"
"./ops/docker/Dockerfile.batch-submitter"
.
build relayer
"ethereumoptimism/message-relayer:latest"
"./ops/docker/Dockerfile.message-relayer"
.
build integration-tests
"ethereumoptimism/integration-tests:latest"
"./ops/docker/Dockerfile.integration-tests"
.
wait
wait
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment