Commit 8894075c authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

op-supervisor: Add op-supervisor build to CI (#10985)

parent 1cf5239c
......@@ -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:
......@@ -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
......@@ -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
......@@ -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:
......@@ -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
......
......@@ -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:
......
......@@ -61,6 +61,10 @@ variable "OP_PROGRAM_VERSION" {
default = "${GIT_VERSION}"
}
variable "OP_SUPERVISOR_VERSION" {
default = "${GIT_VERSION}"
}
variable "CANNON_VERSION" {
default = "${GIT_VERSION}"
}
......@@ -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 = "."
......
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
......@@ -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"]
......@@ -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"]
......@@ -17,6 +17,7 @@
!/op-program
!/op-proposer
!/op-service
!/op-supervisor
!/op-wheel
!/op-plasma
!/go.mod
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment