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: ...@@ -1631,6 +1631,10 @@ workflows:
name: op-service-tests name: op-service-tests
module: op-service module: op-service
requires: ["go-mod-download"] requires: ["go-mod-download"]
- go-test:
name: op-supervisor-tests
module: op-supervisor
requires: ["go-mod-download"]
- go-e2e-test: - go-e2e-test:
name: op-e2e-HTTP-tests<< matrix.variant >> name: op-e2e-HTTP-tests<< matrix.variant >>
matrix: matrix:
...@@ -1686,6 +1690,7 @@ workflows: ...@@ -1686,6 +1690,7 @@ workflows:
- op-program-tests - op-program-tests
- op-program-compat - op-program-compat
- op-service-tests - op-service-tests
- op-supervisor-tests
- op-service-rethdb-tests - op-service-rethdb-tests
- op-e2e-HTTP-tests - op-e2e-HTTP-tests
- op-e2e-fault-proof-tests - op-e2e-fault-proof-tests
...@@ -1735,6 +1740,11 @@ workflows: ...@@ -1735,6 +1740,11 @@ workflows:
docker_name: da-server docker_name: da-server
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>> docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
save_image_tag: <<pipeline.git.revision>> # for devnet later 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: - cannon-prestate:
requires: requires:
- go-mod-download - go-mod-download
...@@ -1950,6 +1960,26 @@ workflows: ...@@ -1950,6 +1960,26 @@ workflows:
- oplabs-gcr-release - oplabs-gcr-release
requires: requires:
- hold - 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: - docker-build:
name: chain-mon-docker-release name: chain-mon-docker-release
filters: filters:
...@@ -2136,6 +2166,15 @@ workflows: ...@@ -2136,6 +2166,15 @@ workflows:
context: context:
- oplabs-gcr - oplabs-gcr
- slack - 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: - docker-build:
name: chain-mon-docker-publish name: chain-mon-docker-publish
docker_name: chain-mon docker_name: chain-mon
......
...@@ -37,7 +37,7 @@ golang-docker: ...@@ -37,7 +37,7 @@ golang-docker:
--progress plain \ --progress plain \
--load \ --load \
-f docker-bake.hcl \ -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 .PHONY: golang-docker
docker-builder-clean: docker-builder-clean:
......
...@@ -61,6 +61,10 @@ variable "OP_PROGRAM_VERSION" { ...@@ -61,6 +61,10 @@ variable "OP_PROGRAM_VERSION" {
default = "${GIT_VERSION}" default = "${GIT_VERSION}"
} }
variable "OP_SUPERVISOR_VERSION" {
default = "${GIT_VERSION}"
}
variable "CANNON_VERSION" { variable "CANNON_VERSION" {
default = "${GIT_VERSION}" default = "${GIT_VERSION}"
} }
...@@ -186,6 +190,19 @@ target "op-program" { ...@@ -186,6 +190,19 @@ target "op-program" {
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-program:${tag}"] 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" { target "cannon" {
dockerfile = "ops/docker/op-stack-go/Dockerfile" dockerfile = "ops/docker/op-stack-go/Dockerfile"
context = "." 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 ...@@ -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 \ 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 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 FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE as cannon-target
COPY --from=cannon-builder /app/cannon/bin/cannon /usr/local/bin/ COPY --from=cannon-builder /app/cannon/bin/cannon /usr/local/bin/
CMD ["cannon"] CMD ["cannon"]
...@@ -157,3 +162,7 @@ CMD ["op-conductor"] ...@@ -157,3 +162,7 @@ CMD ["op-conductor"]
FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE as da-server-target FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE as da-server-target
COPY --from=da-server-builder /app/op-plasma/bin/da-server /usr/local/bin/ COPY --from=da-server-builder /app/op-plasma/bin/da-server /usr/local/bin/
CMD ["da-server"] 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 @@ ...@@ -17,6 +17,7 @@
!/op-program !/op-program
!/op-proposer !/op-proposer
!/op-service !/op-service
!/op-supervisor
!/op-wheel !/op-wheel
!/op-plasma !/op-plasma
!/go.mod !/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