Commit 94eba471 authored by refcell's avatar refcell Committed by GitHub

feat(op-dispute-mon): CI Dispute Monitor Wiring (#9365)

* feat(op-dispute-mon): ci wiring and docker

* fix: missing top-level makefile target:

* fix: missing dockerignore for op-dispute-mon
parent c756a9ed
......@@ -1508,6 +1508,10 @@ workflows:
name: op-challenger-tests
module: op-challenger
requires: ["go-mod-download"]
- go-test:
name: op-dispute-mon-tests
module: op-dispute-mon
requires: ["go-mod-download"]
- go-test:
name: op-conductor-tests
module: op-conductor
......@@ -1569,6 +1573,7 @@ workflows:
- op-node-tests
- op-proposer-tests
- op-challenger-tests
- op-dispute-mon-tests
- op-conductor-tests
- op-program-tests
- op-program-compat
......@@ -1612,6 +1617,12 @@ workflows:
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-dispute-mon-docker-build
docker_name: op-dispute-mon
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-conductor-docker-build
docker_name: op-conductor
......@@ -1991,6 +2002,16 @@ workflows:
context:
- oplabs-gcr
- slack
- docker-build:
name: op-dispute-mon-docker-publish
docker_name: op-dispute-mon
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
requires: [ 'op-stack-go-docker-build-publish' ]
platforms: "linux/amd64,linux/arm64"
publish: true
context:
- oplabs-gcr
- slack
- docker-build:
name: op-conductor-docker-publish
docker_name: op-conductor
......
......@@ -82,6 +82,10 @@ op-challenger:
make -C ./op-challenger op-challenger
.PHONY: op-challenger
op-dispute-mon:
make -C ./op-dispute-mon op-dispute-mon
.PHONY: op-dispute-mon
op-program:
make -C ./op-program op-program
.PHONY: op-program
......
......@@ -93,6 +93,19 @@ target "op-challenger" {
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-challenger:${tag}"]
}
target "op-dispute-mon" {
dockerfile = "Dockerfile"
context = "./op-dispute-mon"
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-dispute-mon:${tag}"]
}
target "op-conductor" {
dockerfile = "Dockerfile"
context = "./op-conductor"
......
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-dispute-mon /usr/local/bin/op-dispute-mon
CMD ["op-dispute-mon"]
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
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)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
op-dispute-mon:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-dispute-mon ./cmd
.PHONY: op-dispute-mon
clean:
rm bin/op-dispute-mon
.PHONY: clean
test:
go test -v ./...
.PHONY: test
......@@ -31,6 +31,7 @@ ARG OP_WHEEL_VERSION=v0.0.0
ARG OP_NODE_VERSION=v0.0.0
ARG OP_CHALLENGER_VERSION=v0.0.0
ARG OP_DISPUTE_MON_VERSION=v0.0.0
ARG OP_BATCHER_VERSION=v0.0.0
ARG OP_PROPOSER_VERSION=v0.0.0
ARG OP_CONDUCTOR_VERSION=v0.0.0
......@@ -62,6 +63,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build cd op-node && make op-node
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_NODE_VERSION"
RUN --mount=type=cache,target=/root/.cache/go-build cd op-challenger && make op-challenger \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_CHALLENGER_VERSION"
RUN --mount=type=cache,target=/root/.cache/go-build cd op-dispute-mon && make op-dispute-mon \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_DISPUTE_MON_VERSION"
RUN --mount=type=cache,target=/root/.cache/go-build cd op-batcher && make op-batcher \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_BATCHER_VERSION"
RUN --mount=type=cache,target=/root/.cache/go-build cd op-proposer && make op-proposer \
......@@ -80,8 +83,7 @@ COPY --from=builder /app/op-wheel/bin/op-wheel /usr/local/bin/
COPY --from=builder /app/op-node/bin/op-node /usr/local/bin/
COPY --from=builder /app/op-challenger/bin/op-challenger /usr/local/bin/
COPY --from=builder /app/op-dispute-mon/bin/op-dispute-mon /usr/local/bin/
COPY --from=builder /app/op-batcher/bin/op-batcher /usr/local/bin/
COPY --from=builder /app/op-proposer/bin/op-proposer /usr/local/bin/
COPY --from=builder /app/op-conductor/bin/op-conductor /usr/local/bin/
......@@ -8,6 +8,7 @@
!/op-bootnode
!/op-chain-ops
!/op-challenger
!/op-dispute-mon
!/op-conductor
!/op-heartbeat
!/op-node
......
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