Skip to content

Commit

Permalink
op-supervisor: Add op-supervisor build to CI (#10985)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajsutton authored Jun 24, 2024
1 parent 1cf5239 commit 8894075
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,10 @@ workflows:
name: op-service-tests
module: op-service
requires: ["go-mod-download"]
- go-test:
name: op-supervisor-tests
module: op-supervisor
requires: ["go-mod-download"]
- go-e2e-test:
name: op-e2e-HTTP-tests<< matrix.variant >>
matrix:
Expand Down Expand Up @@ -1686,6 +1690,7 @@ workflows:
- op-program-tests
- op-program-compat
- op-service-tests
- op-supervisor-tests
- op-service-rethdb-tests
- op-e2e-HTTP-tests
- op-e2e-fault-proof-tests
Expand Down Expand Up @@ -1735,6 +1740,11 @@ workflows:
docker_name: da-server
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
save_image_tag: <<pipeline.git.revision>> # for devnet later
- docker-build:
name: op-supervisor-docker-build
docker_name: op-supervisor
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
# op-supervisor is not (yet) part of the devnet, we don't save it
- cannon-prestate:
requires:
- go-mod-download
Expand Down Expand Up @@ -1950,6 +1960,26 @@ workflows:
- oplabs-gcr-release
requires:
- hold
- docker-build:
name: op-supervisor-docker-release
filters:
tags:
only: /^op-supervisor\/v.*/
branches:
ignore: /.*/
docker_name: op-supervisor
docker_tags: <<pipeline.git.revision>>
requires: ['hold']
platforms: "linux/amd64,linux/arm64"
publish: true
release: true
context:
- oplabs-gcr-release
- check-cross-platform:
name: op-supervisor-cross-platform
op_component: op-supervisor
requires:
- op-supervisor-docker-release
- docker-build:
name: chain-mon-docker-release
filters:
Expand Down Expand Up @@ -2136,6 +2166,15 @@ workflows:
context:
- oplabs-gcr
- slack
- docker-build:
name: op-supervisor-docker-publish
docker_name: op-supervisor
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
platforms: "linux/amd64,linux/arm64"
publish: true
context:
- oplabs-gcr
- slack
- docker-build:
name: chain-mon-docker-publish
docker_name: chain-mon
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ golang-docker:
--progress plain \
--load \
-f docker-bake.hcl \
op-node op-batcher op-proposer op-challenger op-dispute-mon
op-node op-batcher op-proposer op-challenger op-dispute-mon op-supervisor
.PHONY: golang-docker

docker-builder-clean:
Expand Down
17 changes: 17 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ variable "OP_PROGRAM_VERSION" {
default = "${GIT_VERSION}"
}

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

variable "CANNON_VERSION" {
default = "${GIT_VERSION}"
}
Expand Down Expand Up @@ -186,6 +190,19 @@ target "op-program" {
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-program:${tag}"]
}

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

target "cannon" {
dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "."
Expand Down
1 change: 1 addition & 0 deletions op-supervisor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
24 changes: 24 additions & 0 deletions op-supervisor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
GITCOMMIT ?= $(shell git rev-parse HEAD)
GITDATE ?= $(shell git show -s --format='%ct')
VERSION ?= v0.0.0

LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGSSTRING +=-X main.Meta=$(VERSION_META)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"


op-supervisor:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-supervisor ./cmd

clean:
rm bin/op-supervisor

test:
go test -v ./...

.PHONY: \
op-supervisor \
clean \
test
9 changes: 9 additions & 0 deletions ops/docker/op-stack-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ FROM --platform=$BUILDPLATFORM builder as da-server-builder
RUN --mount=type=cache,target=/root/.cache/go-build cd op-plasma && make da-server \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE

FROM --platform=$BUILDPLATFORM builder as op-supervisor-builder
ARG OP_SUPERVISOR_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-supervisor && make op-supervisor \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_SUPERVISOR_VERSION"

FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE as cannon-target
COPY --from=cannon-builder /app/cannon/bin/cannon /usr/local/bin/
CMD ["cannon"]
Expand Down Expand Up @@ -157,3 +162,7 @@ CMD ["op-conductor"]
FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE as da-server-target
COPY --from=da-server-builder /app/op-plasma/bin/da-server /usr/local/bin/
CMD ["da-server"]

FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE as op-supervisor-target
COPY --from=op-supervisor-builder /app/op-supervisor/bin/op-supervisor /usr/local/bin/
ENTRYPOINT ["op-supervisor"]
1 change: 1 addition & 0 deletions ops/docker/op-stack-go/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
!/op-program
!/op-proposer
!/op-service
!/op-supervisor
!/op-wheel
!/op-plasma
!/go.mod
Expand Down

0 comments on commit 8894075

Please sign in to comment.