Skip to content

Commit

Permalink
Revert "Merge pull request #8242 from ethereum-optimism/go-docker-tar…
Browse files Browse the repository at this point in the history
…gets"

This reverts commit c12a946, reversing
changes made to caa9d27.
  • Loading branch information
trianglesphere committed Nov 28, 2023
1 parent 3dc4bff commit d972c46
Show file tree
Hide file tree
Showing 18 changed files with 219 additions and 154 deletions.
49 changes: 44 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,10 +1098,12 @@ jobs:
command: |
IMAGE_BASE_PREFIX="us-docker.pkg.dev/oplabs-tools-artifacts/images"
# Load from previous docker-build job
docker load < "/tmp/workspace/op-stack-go.tar"
docker load < "/tmp/workspace/op-node.tar"
docker load < "/tmp/workspace/op-proposer.tar"
docker load < "/tmp/workspace/op-batcher.tar"
# rename to the tags that the docker-compose of the devnet expects
docker tag "$IMAGE_BASE_PREFIX/op-stack-go:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op-stack-go:devnet"
docker tag "$IMAGE_BASE_PREFIX/op-node:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op-node:devnet"
docker tag "$IMAGE_BASE_PREFIX/op-proposer:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op-proposer:devnet"
docker tag "$IMAGE_BASE_PREFIX/op-batcher:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op-batcher:devnet"
Expand Down Expand Up @@ -1537,35 +1539,46 @@ workflows:
- op-e2e-HTTP-tests
- op-e2e-ext-geth-tests
- op-service-rethdb-tests
- docker-build: # just to warm up the cache (other jobs run in parallel)
name: op-stack-go-docker-build
docker_name: op-stack-go
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
save_image_tag: <<pipeline.git.revision>> # for devnet later
- docker-build:
name: op-node-docker-build
docker_name: op-node
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: ['op-stack-go-docker-build']
save_image_tag: <<pipeline.git.revision>> # for devnet later
- docker-build:
name: op-batcher-docker-build
docker_name: op-batcher
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: ['op-stack-go-docker-build']
save_image_tag: <<pipeline.git.revision>> # for devnet later
- docker-build:
name: op-program-docker-build
docker_name: op-program
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: ['op-stack-go-docker-build']
save_image_tag: <<pipeline.git.revision>> # for devnet later
- docker-build:
name: op-proposer-docker-build
docker_name: op-proposer
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: ['op-stack-go-docker-build']
save_image_tag: <<pipeline.git.revision>> # for devnet later
- docker-build:
name: op-challenger-docker-build
docker_name: op-challenger
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: ['op-stack-go-docker-build']
save_image_tag: <<pipeline.git.revision>> # for devnet later
- docker-build:
name: op-heartbeat-docker-build
docker_name: op-heartbeat
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: ['op-stack-go-docker-build']
save_image_tag: <<pipeline.git.revision>> # for devnet later
- cannon-prestate:
requires: ["op-stack-go-lint"]
Expand Down Expand Up @@ -1601,6 +1614,18 @@ workflows:
only: /^(proxyd|chain-mon|indexer|ci-builder|ufm-[a-z0-9\-]*|op-[a-z0-9\-]*)\/v.*/
branches:
ignore: /.*/
- docker-build: # just to warm up the cache (other jobs run in parallel)
name: op-stack-go-docker-build-release
filters:
tags:
only: /^(proxyd|chain-mon|indexer|ci-builder|ufm-[a-z0-9\-]*|op-[a-z0-9\-]*)\/v.*/
branches:
ignore: /.*/
docker_name: op-stack-go
docker_tags: <<pipeline.git.revision>>
platforms: "linux/amd64,linux/arm64"
requires:
- hold
- docker-build:
name: op-heartbeat-release
filters:
Expand All @@ -1610,7 +1635,7 @@ workflows:
ignore: /.*/
docker_name: op-heartbeat
docker_tags: <<pipeline.git.revision>>
requires: ['hold']
requires: ['op-stack-go-docker-build-release']
platforms: "linux/amd64,linux/arm64"
publish: true
release: true
Expand All @@ -1625,7 +1650,7 @@ workflows:
ignore: /.*/
docker_name: op-node
docker_tags: <<pipeline.git.revision>>
requires: ['hold']
requires: ['op-stack-go-docker-build-release']
platforms: "linux/amd64,linux/arm64"
publish: true
release: true
Expand All @@ -1640,7 +1665,7 @@ workflows:
ignore: /.*/
docker_name: op-batcher
docker_tags: <<pipeline.git.revision>>
requires: ['hold']
requires: ['op-stack-go-docker-build-release']
platforms: "linux/amd64,linux/arm64"
publish: true
release: true
Expand All @@ -1655,7 +1680,7 @@ workflows:
ignore: /.*/
docker_name: op-proposer
docker_tags: <<pipeline.git.revision>>
requires: ['hold']
requires: ['op-stack-go-docker-build-release']
platforms: "linux/amd64,linux/arm64"
publish: true
release: true
Expand All @@ -1670,7 +1695,7 @@ workflows:
ignore: /.*/
docker_name: op-challenger
docker_tags: <<pipeline.git.revision>>
requires: ['hold']
requires: ['op-stack-go-docker-build-release']
platforms: "linux/amd64,linux/arm64"
publish: true
release: true
Expand Down Expand Up @@ -1798,10 +1823,19 @@ workflows:
when:
equal: [ build_hourly, <<pipeline.schedule.name>> ]
jobs:
- docker-build: # just to warm up the cache (other jobs run in parallel)
name: op-stack-go-docker-build-publish
docker_name: op-stack-go
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
platforms: "linux/amd64,linux/arm64"
context:
- oplabs-gcr
- slack
- docker-build:
name: op-node-docker-publish
docker_name: op-node
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: [ 'op-stack-go-docker-build-publish' ]
platforms: "linux/amd64,linux/arm64"
publish: true
context:
Expand All @@ -1811,6 +1845,7 @@ workflows:
name: op-batcher-docker-publish
docker_name: op-batcher
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: [ 'op-stack-go-docker-build-publish' ]
platforms: "linux/amd64,linux/arm64"
publish: true
context:
Expand All @@ -1820,6 +1855,7 @@ workflows:
name: op-program-docker-publish
docker_name: op-program
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: [ 'op-stack-go-docker-build-publish' ]
platforms: "linux/amd64,linux/arm64"
publish: true
context:
Expand All @@ -1829,6 +1865,7 @@ workflows:
name: op-proposer-docker-publish
docker_name: op-proposer
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: [ 'op-stack-go-docker-build-publish' ]
platforms: "linux/amd64,linux/arm64"
publish: true
context:
Expand All @@ -1838,6 +1875,7 @@ workflows:
name: op-challenger-docker-publish
docker_name: op-challenger
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: [ 'op-stack-go-docker-build-publish' ]
platforms: "linux/amd64,linux/arm64"
publish: true
context:
Expand All @@ -1847,6 +1885,7 @@ workflows:
name: op-heartbeat-docker-publish
docker_name: op-heartbeat
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: [ 'op-stack-go-docker-build-publish' ]
platforms: "linux/amd64,linux/arm64"
publish: true
context:
Expand Down
125 changes: 46 additions & 79 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ variable "GIT_DATE" {
default = "0"
}

// The default version to embed in the built images.
// During CI release builds this is set to <<pipeline.git.tag>>
variable "GIT_VERSION" {
default = "v0.0.0"
default = "docker" // original default as set in proxyd file, not used by full go stack, yet
}

variable "IMAGE_TAGS" {
Expand All @@ -29,127 +27,96 @@ variable "PLATFORMS" {
// Only a specify a single platform when `--load` ing into docker.
// Multi-platform is supported when outputting to disk or pushing to a registry.
// Multi-platform builds can be tested locally with: --set="*.output=type=image,push=false"
default = ""
default = "linux/amd64"
}

// Each of the services can have a customized version, but defaults to the global specified version.
variable "OP_NODE_VERSION" {
default = "${GIT_VERSION}"
}

variable "OP_BATCHER_VERSION" {
default = "${GIT_VERSION}"
}

variable "OP_PROPOSER_VERSION" {
default = "${GIT_VERSION}"
}

variable "OP_CHALLENGER_VERSION" {
default = "${GIT_VERSION}"
}

variable OP_HEARTBEAT_VERSION {
default = "${GIT_VERSION}"
}

variable OP_PROGRAM_VERSION {
default = "${GIT_VERSION}"
}

variable CANNON_VERSION {
default = "${GIT_VERSION}"
}

target "op-node" {
target "op-stack-go" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_NODE_VERSION = "${OP_NODE_VERSION}"
}
target = "op-node-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-stack-go:${tag}"]
}

target "op-node" {
dockerfile = "Dockerfile"
context = "./op-node"
args = {
OP_STACK_GO_BUILDER = "op-stack-go"
}
contexts = {
op-stack-go: "target:op-stack-go"
}
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-node:${tag}"]
}

target "op-batcher" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
dockerfile = "Dockerfile"
context = "./op-batcher"
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_BATCHER_VERSION = "${OP_BATCHER_VERSION}"
OP_STACK_GO_BUILDER = "op-stack-go"
}
contexts = {
op-stack-go: "target:op-stack-go"
}
target = "op-batcher-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-batcher:${tag}"]
}

target "op-proposer" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
dockerfile = "Dockerfile"
context = "./op-proposer"
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_PROPOSER_VERSION = "${OP_PROPOSER_VERSION}"
OP_STACK_GO_BUILDER = "op-stack-go"
}
contexts = {
op-stack-go: "target:op-stack-go"
}
target = "op-proposer-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-proposer:${tag}"]
}

target "op-challenger" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
dockerfile = "Dockerfile"
context = "./op-challenger"
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_CHALLENGER_VERSION = "${OP_CHALLENGER_VERSION}"
OP_STACK_GO_BUILDER = "op-stack-go"
}
contexts = {
op-stack-go: "target:op-stack-go"
}
target = "op-challenger-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-challenger:${tag}"]
}

target "op-heartbeat" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
dockerfile = "Dockerfile"
context = "./op-heartbeat"
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_HEARTBEAT_VERSION = "${OP_HEARTBEAT_VERSION}"
OP_STACK_GO_BUILDER = "op-stack-go"
}
contexts = {
op-stack-go: "target:op-stack-go"
}
target = "op-heartbeat-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-heartbeat:${tag}"]
}

target "op-program" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
dockerfile = "Dockerfile"
context = "./op-program"
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_PROGRAM_VERSION = "${OP_PROGRAM_VERSION}"
OP_STACK_GO_BUILDER = "op-stack-go"
}
target = "op-program-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-program:${tag}"]
}

target "cannon" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
args = {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
CANNON_VERSION = "${CANNON_VERSION}"
contexts = {
op-stack-go: "target:op-stack-go"
}
target = "cannon-target"
platforms = split(",", PLATFORMS)
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/cannon:${tag}"]
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-program:${tag}"]
}

target "proxyd" {
Expand Down
9 changes: 9 additions & 0 deletions op-batcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack-go:latest
FROM $OP_STACK_GO_BUILDER as builder
# See "make golang-docker" and /ops/docker/op-stack-go

FROM alpine:3.18

COPY --from=builder /usr/local/bin/op-batcher /usr/local/bin/op-batcher

CMD ["op-batcher"]
2 changes: 2 additions & 0 deletions op-batcher/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
17 changes: 17 additions & 0 deletions op-challenger/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack-go:latest
FROM $OP_STACK_GO_BUILDER as builder
# See "make golang-docker" and /ops/docker/op-stack-go

FROM alpine:3.18

# Make the bundled op-program the default cannon server
COPY --from=builder /usr/local/bin/op-program /usr/local/bin/op-program
ENV OP_CHALLENGER_CANNON_SERVER /usr/local/bin/op-program

# Make the bundled cannon the default cannon executable
COPY --from=builder /usr/local/bin/cannon /usr/local/bin/cannon
ENV OP_CHALLENGER_CANNON_BIN /usr/local/bin/cannon

COPY --from=builder /usr/local/bin/op-challenger /usr/local/bin/op-challenger

CMD ["op-challenger"]
Loading

0 comments on commit d972c46

Please sign in to comment.