Commit 5d309e6a authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

maint: Move Go packages into root of repo, adopt go.work (#2524)

- Adopts Go workspaces for future compatibility with the Bedrock move into the monorepo
- Moves Go packages to the root of the repo in order to fix import paths
- Rewrites existing Go import paths
- Removes Stackman, since it's not needed anymore
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 412688d5
...@@ -199,13 +199,13 @@ jobs: ...@@ -199,13 +199,13 @@ jobs:
- run: - run:
name: Lint name: Lint
command: golangci-lint run -E goimports -E sqlclosecheck -E bodyclose -E asciicheck ./... command: golangci-lint run -E goimports -E sqlclosecheck -E bodyclose -E asciicheck ./...
working_directory: go/bss-core working_directory: bss-core
- run: - run:
name: Test name: Test
command: | command: |
mkdir -p /test-results mkdir -p /test-results
gotestsum --junitfile /test-results/tests.xml gotestsum --junitfile /test-results/tests.xml
working_directory: go/bss-core working_directory: bss-core
- store_test_results: - store_test_results:
path: /test-results path: /test-results
...@@ -313,26 +313,26 @@ workflows: ...@@ -313,26 +313,26 @@ workflows:
- go-lint-test-build: - go-lint-test-build:
name: batch-submitter-tests name: batch-submitter-tests
binary_name: batch-submitter binary_name: batch-submitter
working_directory: go/batch-submitter working_directory: batch-submitter
- go-lint-test-build: - go-lint-test-build:
name: proxyd-tests name: proxyd-tests
binary_name: proxyd binary_name: proxyd
working_directory: go/proxyd working_directory: proxyd
- go-lint-test-build: - go-lint-test-build:
name: teleportr-tests name: teleportr-tests
binary_name: teleportr binary_name: teleportr
working_directory: go/teleportr working_directory: teleportr
- go-lint-test-build: - go-lint-test-build:
name: gas-oracle-tests name: gas-oracle-tests
binary_name: gas-oracle binary_name: gas-oracle
working_directory: go/gas-oracle working_directory: gas-oracle
- go-lint-test-build: - go-lint-test-build:
name: indexer-tests name: indexer-tests
binary_name: indexer binary_name: indexer
working_directory: go/indexer working_directory: indexer
- go-lint-test: - go-lint-test:
name: bss-core-tests name: bss-core-tests
working_directory: go/bss-core working_directory: bss-core
- contracts-tests: - contracts-tests:
requires: requires:
- yarn-monorepo - yarn-monorepo
...@@ -379,14 +379,14 @@ workflows: ...@@ -379,14 +379,14 @@ workflows:
- yarn-monorepo - yarn-monorepo
- docker-publish: - docker-publish:
name: l2geth-release name: l2geth-release
docker_file: ops/docker/Dockerfile.geth docker_file: l2geth/Dockerfile
docker_tags: ethereumoptimism/l2geth:nightly docker_tags: ethereumoptimism/l2geth:nightly
docker_context: . docker_context: .
context: context:
- optimism - optimism
- docker-publish: - docker-publish:
name: gas-oracle-release name: gas-oracle-release
docker_file: ops/docker/Dockerfile.gas-oracle docker_file: gas-oracle/Dockerfile
docker_tags: ethereumoptimism/gas-oracle:nightly docker_tags: ethereumoptimism/gas-oracle:nightly
docker_context: . docker_context: .
context: context:
...@@ -414,21 +414,21 @@ workflows: ...@@ -414,21 +414,21 @@ workflows:
- optimism - optimism
- docker-publish: - docker-publish:
name: proxyd-release name: proxyd-release
docker_file: go/proxyd/Dockerfile docker_file: proxyd/Dockerfile
docker_tags: ethereumoptimism/proxyd:nightly docker_tags: ethereumoptimism/proxyd:nightly
docker_context: . docker_context: .
context: context:
- optimism - optimism
- docker-publish: - docker-publish:
name: l2geth-exporter-release name: l2geth-exporter-release
docker_file: ops/docker/Dockerfile.l2geth-exporter docker_file: l2geth-exporter/Dockerfile
docker_tags: ethereumoptimism/l2geth-exporter:nightly docker_tags: ethereumoptimism/l2geth-exporter:nightly
docker_context: . docker_context: .
context: context:
- optimism - optimism
- docker-publish: - docker-publish:
name: op-exporter-release name: op-exporter-release
docker_file: ops/docker/Dockerfile.op-exporter docker_file: op-exporter/Dockerfile
docker_tags: ethereumoptimism/op-exporter:nightly docker_tags: ethereumoptimism/op-exporter:nightly
docker_context: . docker_context: .
context: context:
...@@ -467,21 +467,21 @@ workflows: ...@@ -467,21 +467,21 @@ workflows:
- optimism - optimism
- docker-publish: - docker-publish:
name: batch-submitter-service-release name: batch-submitter-service-release
docker_file: ops/docker/Dockerfile.batch-submitter-service docker_file: ops/docker/Dockerfile
docker_tags: ethereumoptimism/batch-submitter-service:nightly docker_tags: ethereumoptimism/batch-submitter-service:nightly
docker_context: . docker_context: .
context: context:
- optimism - optimism
- docker-publish: - docker-publish:
name: indexer-release name: indexer-release
docker_file: ops/docker/Dockerfile.indexer docker_file: indexer/Dockerfile
docker_tags: ethereumoptimism/indexer:nightly docker_tags: ethereumoptimism/indexer:nightly
docker_context: . docker_context: .
context: context:
- optimism - optimism
- docker-publish: - docker-publish:
name: teleportr-release name: teleportr-release
docker_file: ops/docker/Dockerfile.teleportr docker_file: teleportr/Dockerfile
docker_tags: ethereumoptimism/teleportr:nightly docker_tags: ethereumoptimism/teleportr:nightly
docker_context: . docker_context: .
context: context:
......
...@@ -113,7 +113,7 @@ jobs: ...@@ -113,7 +113,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.geth file: ./l2geth/Dockerfile
push: true push: true
tags: ethereumoptimism/l2geth:${{ needs.canary-publish.outputs.canary-docker-tag }} tags: ethereumoptimism/l2geth:${{ needs.canary-publish.outputs.canary-docker-tag }}
...@@ -139,7 +139,7 @@ jobs: ...@@ -139,7 +139,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.gas-oracle file: ./gas-oracle/Dockerfile
push: true push: true
tags: ethereumoptimism/gas-oracle:${{ needs.canary-publish.outputs.canary-docker-tag }} tags: ethereumoptimism/gas-oracle:${{ needs.canary-publish.outputs.canary-docker-tag }}
...@@ -326,14 +326,14 @@ jobs: ...@@ -326,14 +326,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/proxyd/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./proxyd/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./go/proxyd/Dockerfile file: ./proxyd/Dockerfile
push: true push: true
tags: ethereumoptimism/proxyd:${{ needs.canary-publish.outputs.proxyd }} tags: ethereumoptimism/proxyd:${{ needs.canary-publish.outputs.proxyd }}
build-args: | build-args: |
...@@ -363,14 +363,14 @@ jobs: ...@@ -363,14 +363,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/op-exporter/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./op-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.op-exporter file: ./op-exporter/Dockerfile=
push: true push: true
tags: ethereumoptimism/op-exporter:${{ needs.canary-publish.outputs.op-exporter }} tags: ethereumoptimism/op-exporter:${{ needs.canary-publish.outputs.op-exporter }}
build-args: | build-args: |
...@@ -400,14 +400,14 @@ jobs: ...@@ -400,14 +400,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/l2geth-exporter/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./l2geth-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.l2geth-exporter file: ./l2geth-exporter/Dockerfile
push: true push: true
tags: ethereumoptimism/l2geth-exporter:${{ needs.canary-publish.outputs.l2geth-exporter }} tags: ethereumoptimism/l2geth-exporter:${{ needs.canary-publish.outputs.l2geth-exporter }}
build-args: | build-args: |
...@@ -437,7 +437,7 @@ jobs: ...@@ -437,7 +437,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.batch-submitter-service file: ./batch-submitter/Dockerfile
push: true push: true
tags: ethereumoptimism/batch-submitter-service:${{ needs.canary-publish.outputs.batch-submitter-service }} tags: ethereumoptimism/batch-submitter-service:${{ needs.canary-publish.outputs.batch-submitter-service }}
...@@ -463,14 +463,14 @@ jobs: ...@@ -463,14 +463,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./indexer/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.indexer file: ./indexer/Dockerfile
push: true push: true
tags: ethereumoptimism/indexer:${{ needs.canary-publish.outputs.indexer }} tags: ethereumoptimism/indexer:${{ needs.canary-publish.outputs.indexer }}
build-args: | build-args: |
...@@ -500,14 +500,14 @@ jobs: ...@@ -500,14 +500,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/teleportr/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./teleportr/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.teleportr file: ./teleportr/Dockerfile
push: true push: true
tags: ethereumoptimism/teleportr:${{ needs.canary-publish.outputs.teleportr }} tags: ethereumoptimism/teleportr:${{ needs.canary-publish.outputs.teleportr }}
build-args: | build-args: |
......
...@@ -93,7 +93,7 @@ jobs: ...@@ -93,7 +93,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.geth file: ./ops/docker/Dockerfile
push: true push: true
tags: ethereumoptimism/l2geth:${{ needs.release.outputs.l2geth }},ethereumoptimism/l2geth:latest tags: ethereumoptimism/l2geth:${{ needs.release.outputs.l2geth }},ethereumoptimism/l2geth:latest
...@@ -119,7 +119,7 @@ jobs: ...@@ -119,7 +119,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.gas-oracle file: ./gas-oracle/Dockerfile
push: true push: true
tags: ethereumoptimism/gas-oracle:${{ needs.release.outputs.gas-oracle }},ethereumoptimism/gas-oracle:latest tags: ethereumoptimism/gas-oracle:${{ needs.release.outputs.gas-oracle }},ethereumoptimism/gas-oracle:latest
...@@ -223,14 +223,14 @@ jobs: ...@@ -223,14 +223,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/proxyd/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./proxyd/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./go/proxyd/Dockerfile file: ./proxyd/Dockerfile
push: true push: true
tags: ethereumoptimism/proxyd:${{ needs.release.outputs.proxyd }},ethereumoptimism/proxyd:latest tags: ethereumoptimism/proxyd:${{ needs.release.outputs.proxyd }},ethereumoptimism/proxyd:latest
build-args: | build-args: |
...@@ -260,14 +260,14 @@ jobs: ...@@ -260,14 +260,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/l2geth-exporter/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./l2geth-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.l2geth-exporter file: ./l2geth-exporter/Dockerfile
push: true push: true
tags: ethereumoptimism/l2geth-exporter:${{ needs.release.outputs.l2geth-exporter }},ethereumoptimism/l2geth-exporter:latest tags: ethereumoptimism/l2geth-exporter:${{ needs.release.outputs.l2geth-exporter }},ethereumoptimism/l2geth-exporter:latest
build-args: | build-args: |
...@@ -297,14 +297,14 @@ jobs: ...@@ -297,14 +297,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/op-exporter/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./op-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.op-exporter file: ./op-exporter/Dockerfile
push: true push: true
tags: ethereumoptimism/op-exporter:${{ needs.release.outputs.op-exporter }},ethereumoptimism/op-exporter:latest tags: ethereumoptimism/op-exporter:${{ needs.release.outputs.op-exporter }},ethereumoptimism/op-exporter:latest
build-args: | build-args: |
...@@ -469,7 +469,7 @@ jobs: ...@@ -469,7 +469,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.batch-submitter-service file: ./batch-submitter/Dockerfile
push: true push: true
tags: ethereumoptimism/batch-submitter-service:${{ needs.release.outputs.batch-submitter-service }},ethereumoptimism/batch-submitter-service:latest tags: ethereumoptimism/batch-submitter-service:${{ needs.release.outputs.batch-submitter-service }},ethereumoptimism/batch-submitter-service:latest
...@@ -495,14 +495,14 @@ jobs: ...@@ -495,14 +495,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./indexer/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Publish Indexer - name: Publish Indexer
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.indexer file: ./indexer/Dockerfile
push: true push: true
tags: ethereumoptimism/indexer:${{ needs.release.outputs.indexer }},ethereumoptimism/indexer:latest tags: ethereumoptimism/indexer:${{ needs.release.outputs.indexer }},ethereumoptimism/indexer:latest
build-args: | build-args: |
...@@ -532,14 +532,14 @@ jobs: ...@@ -532,14 +532,14 @@ jobs:
id: build_args id: build_args
run: | run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/teleportr/package.json) echo ::set-output name=GITVERSION::$(jq -r .version ./teleportr/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Publish Teleportr - name: Publish Teleportr
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./ops/docker/Dockerfile.teleportr file: ./teleportr/Dockerfile
push: true push: true
tags: ethereumoptimism/teleportr:${{ needs.release.outputs.teleportr }},ethereumoptimism/teleportr:latest tags: ethereumoptimism/teleportr:${{ needs.release.outputs.teleportr }},ethereumoptimism/teleportr:latest
build-args: | build-args: |
......
...@@ -38,10 +38,10 @@ root ...@@ -38,10 +38,10 @@ root
│ ├── <a href="./packages/message-relayer">message-relayer</a>: Tool for automatically relaying L1<>L2 messages in development │ ├── <a href="./packages/message-relayer">message-relayer</a>: Tool for automatically relaying L1<>L2 messages in development
│ └── <a href="./packages/replica-healthcheck">replica-healthcheck</a>: Service for monitoring the health of a replica node │ └── <a href="./packages/replica-healthcheck">replica-healthcheck</a>: Service for monitoring the health of a replica node
├── <a href="./go">go</a> ├── <a href="./go">go</a>
│ ├── <a href="./go/batch-submitter">batch-submitter</a>: Service for submitting batches of transactions and results to L1 │ ├── <a href="./batch-submitter">batch-submitter</a>: Service for submitting batches of transactions and results to L1
│ ├── <a href="./go/bss-core">bss-core</a>: Core batch-submitter logic and utilities │ ├── <a href="./bss-core">bss-core</a>: Core batch-submitter logic and utilities
│ ├── <a href="./go/gas-oracle">gas-oracle</a>: Service for updating L1 gas prices on L2 │ ├── <a href="./gas-oracle">gas-oracle</a>: Service for updating L1 gas prices on L2
│ └── <a href="./go/proxyd">proxyd</a>: Configurable RPC request router and proxy │ └── <a href="./proxyd">proxyd</a>: Configurable RPC request router and proxy
├── <a href="./l2geth">l2geth</a>: Optimism client software, a fork of <a href="https://github.com/ethereum/go-ethereum/tree/v1.9.10">geth v1.9.10</a> ├── <a href="./l2geth">l2geth</a>: Optimism client software, a fork of <a href="https://github.com/ethereum/go-ethereum/tree/v1.9.10">geth v1.9.10</a>
├── <a href="./integration-tests">integration-tests</a>: Various integration tests for the Optimism network ├── <a href="./integration-tests">integration-tests</a>: Various integration tests for the Optimism network
└── <a href="./ops">ops</a>: Tools for running Optimism nodes and networks └── <a href="./ops">ops</a>: Tools for running Optimism nodes and networks
......
...@@ -2,12 +2,12 @@ FROM golang:1.18.0-alpine3.15 as builder ...@@ -2,12 +2,12 @@ FROM golang:1.18.0-alpine3.15 as builder
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
COPY ./l2geth /l2geth COPY ./batch-submitter /go/batch-submitter
COPY ./go/bss-core /go/bss-core COPY ./bss-core /go/bss-core
COPY ./go/batch-submitter/go.mod ./go/batch-submitter/go.sum /go/batch-submitter/ COPY ./l2geth /go/l2geth
COPY ./batch-submitter/docker.go.work /go/go.work
WORKDIR /go/batch-submitter WORKDIR /go/batch-submitter
RUN go mod graph | grep -v l2geth | grep -v bss-core | awk '{if ($1 !~ "@") print $2}' | xargs -n 1 go get
COPY ./go/batch-submitter/ ./
RUN make RUN make
FROM alpine:3.15 FROM alpine:3.15
......
...@@ -5,12 +5,12 @@ import ( ...@@ -5,12 +5,12 @@ import (
"os" "os"
"time" "time"
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/proposer" "github.com/ethereum-optimism/optimism/batch-submitter/drivers/proposer"
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/sequencer" "github.com/ethereum-optimism/optimism/batch-submitter/drivers/sequencer"
bsscore "github.com/ethereum-optimism/optimism/go/bss-core" bsscore "github.com/ethereum-optimism/optimism/bss-core"
"github.com/ethereum-optimism/optimism/go/bss-core/dial" "github.com/ethereum-optimism/optimism/bss-core/dial"
"github.com/ethereum-optimism/optimism/go/bss-core/metrics" "github.com/ethereum-optimism/optimism/bss-core/metrics"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/getsentry/sentry-go" "github.com/getsentry/sentry-go"
"github.com/urfave/cli" "github.com/urfave/cli"
......
...@@ -8,8 +8,8 @@ import ( ...@@ -8,8 +8,8 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/urfave/cli" "github.com/urfave/cli"
batchsubmitter "github.com/ethereum-optimism/optimism/go/batch-submitter" batchsubmitter "github.com/ethereum-optimism/optimism/batch-submitter"
"github.com/ethereum-optimism/optimism/go/batch-submitter/flags" "github.com/ethereum-optimism/optimism/batch-submitter/flags"
) )
var ( var (
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli" "github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/go/batch-submitter/flags" "github.com/ethereum-optimism/optimism/batch-submitter/flags"
) )
var ( var (
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
batchsubmitter "github.com/ethereum-optimism/optimism/go/batch-submitter" batchsubmitter "github.com/ethereum-optimism/optimism/batch-submitter"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/ethereum-optimism/optimism/go/bss-core/dial" "github.com/ethereum-optimism/optimism/bss-core/dial"
"github.com/ethereum-optimism/optimism/l2geth/ethclient" "github.com/ethereum-optimism/optimism/l2geth/ethclient"
"github.com/ethereum-optimism/optimism/l2geth/log" "github.com/ethereum-optimism/optimism/l2geth/log"
"github.com/ethereum-optimism/optimism/l2geth/rpc" "github.com/ethereum-optimism/optimism/l2geth/rpc"
......
go 1.18
use (
./batch-submitter
./bss-core
./l2geth
)
...@@ -7,11 +7,11 @@ import ( ...@@ -7,11 +7,11 @@ import (
"math/big" "math/big"
"strings" "strings"
"github.com/ethereum-optimism/optimism/go/batch-submitter/bindings/ctc" "github.com/ethereum-optimism/optimism/batch-submitter/bindings/ctc"
"github.com/ethereum-optimism/optimism/go/batch-submitter/bindings/scc" "github.com/ethereum-optimism/optimism/batch-submitter/bindings/scc"
"github.com/ethereum-optimism/optimism/go/bss-core/drivers" "github.com/ethereum-optimism/optimism/bss-core/drivers"
"github.com/ethereum-optimism/optimism/go/bss-core/metrics" "github.com/ethereum-optimism/optimism/bss-core/metrics"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
l2ethclient "github.com/ethereum-optimism/optimism/l2geth/ethclient" l2ethclient "github.com/ethereum-optimism/optimism/l2geth/ethclient"
"github.com/ethereum-optimism/optimism/l2geth/log" "github.com/ethereum-optimism/optimism/l2geth/log"
"github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"math/big" "math/big"
"testing" "testing"
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/sequencer" "github.com/ethereum-optimism/optimism/batch-submitter/drivers/sequencer"
l2common "github.com/ethereum-optimism/optimism/l2geth/common" l2common "github.com/ethereum-optimism/optimism/l2geth/common"
l2types "github.com/ethereum-optimism/optimism/l2geth/core/types" l2types "github.com/ethereum-optimism/optimism/l2geth/core/types"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
......
...@@ -7,10 +7,10 @@ import ( ...@@ -7,10 +7,10 @@ import (
"math/big" "math/big"
"strings" "strings"
"github.com/ethereum-optimism/optimism/go/batch-submitter/bindings/ctc" "github.com/ethereum-optimism/optimism/batch-submitter/bindings/ctc"
"github.com/ethereum-optimism/optimism/go/bss-core/drivers" "github.com/ethereum-optimism/optimism/bss-core/drivers"
"github.com/ethereum-optimism/optimism/go/bss-core/metrics" "github.com/ethereum-optimism/optimism/bss-core/metrics"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
l2ethclient "github.com/ethereum-optimism/optimism/l2geth/ethclient" l2ethclient "github.com/ethereum-optimism/optimism/l2geth/ethclient"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/sequencer" "github.com/ethereum-optimism/optimism/batch-submitter/drivers/sequencer"
l2types "github.com/ethereum-optimism/optimism/l2geth/core/types" l2types "github.com/ethereum-optimism/optimism/l2geth/core/types"
l2rlp "github.com/ethereum-optimism/optimism/l2geth/rlp" l2rlp "github.com/ethereum-optimism/optimism/l2geth/rlp"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
......
package sequencer package sequencer
import ( import (
"github.com/ethereum-optimism/optimism/go/bss-core/metrics" "github.com/ethereum-optimism/optimism/bss-core/metrics"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
) )
......
module github.com/ethereum-optimism/optimism/go/batch-submitter module github.com/ethereum-optimism/optimism/batch-submitter
go 1.16 go 1.16
replace github.com/ethereum-optimism/optimism/bss-core v0.0.0 => ../bss-core
replace github.com/ethereum-optimism/optimism/l2geth v0.0.0 => ../l2geth
require ( require (
github.com/ethereum-optimism/optimism/go/bss-core v0.0.0 github.com/ethereum-optimism/optimism/bss-core v0.0.0
github.com/ethereum-optimism/optimism/l2geth v1.0.0 github.com/ethereum-optimism/optimism/l2geth v0.0.0
github.com/ethereum/go-ethereum v1.10.16 github.com/ethereum/go-ethereum v1.10.16
github.com/getsentry/sentry-go v0.11.0 github.com/getsentry/sentry-go v0.11.0
github.com/prometheus/client_golang v1.11.0 github.com/prometheus/client_golang v1.11.0
github.com/stretchr/testify v1.7.0 github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.5 github.com/urfave/cli v1.22.5
) )
replace github.com/ethereum-optimism/optimism/l2geth => ../../l2geth
replace github.com/ethereum-optimism/optimism/go/bss-core => ../bss-core
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"strings" "strings"
"testing" "testing"
bsscore "github.com/ethereum-optimism/optimism/go/bss-core" bsscore "github.com/ethereum-optimism/optimism/bss-core"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"math/big" "math/big"
"strings" "strings"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
......
...@@ -8,9 +8,9 @@ import ( ...@@ -8,9 +8,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/ethereum-optimism/optimism/go/bss-core/drivers" "github.com/ethereum-optimism/optimism/bss-core/drivers"
"github.com/ethereum-optimism/optimism/go/bss-core/mock" "github.com/ethereum-optimism/optimism/bss-core/mock"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
......
module github.com/ethereum-optimism/optimism/go/bss-core module github.com/ethereum-optimism/optimism/bss-core
go 1.16 go 1.16
......
...@@ -7,8 +7,8 @@ import ( ...@@ -7,8 +7,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/ethereum-optimism/optimism/go/bss-core/metrics" "github.com/ethereum-optimism/optimism/bss-core/metrics"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr" "github.com/ethereum-optimism/optimism/bss-core/txmgr"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
......
...@@ -2,7 +2,8 @@ FROM golang:1.18.0-alpine3.15 as builder ...@@ -2,7 +2,8 @@ FROM golang:1.18.0-alpine3.15 as builder
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
COPY ./go/gas-oracle /gas-oracle COPY ./gas-oracle /gas-oracle
RUN cd /gas-oracle && make gas-oracle RUN cd /gas-oracle && make gas-oracle
FROM alpine:3.15 FROM alpine:3.15
......
...@@ -13,6 +13,7 @@ CONTRACTS_PATH := "../../packages/contracts/artifacts/contracts" ...@@ -13,6 +13,7 @@ CONTRACTS_PATH := "../../packages/contracts/artifacts/contracts"
gas-oracle: gas-oracle:
env GO111MODULE=on go build $(LDFLAGS) env GO111MODULE=on go build $(LDFLAGS)
.PHONY: gas-oracle
clean: clean:
rm gas-oracle rm gas-oracle
......
module github.com/ethereum-optimism/optimism/go/gas-oracle module github.com/ethereum-optimism/optimism/gas-oracle
go 1.16 go 1.16
......
...@@ -5,9 +5,9 @@ import ( ...@@ -5,9 +5,9 @@ import (
"os" "os"
"time" "time"
"github.com/ethereum-optimism/optimism/go/gas-oracle/flags" "github.com/ethereum-optimism/optimism/gas-oracle/flags"
ometrics "github.com/ethereum-optimism/optimism/go/gas-oracle/metrics" ometrics "github.com/ethereum-optimism/optimism/gas-oracle/metrics"
"github.com/ethereum-optimism/optimism/go/gas-oracle/oracle" "github.com/ethereum-optimism/optimism/gas-oracle/oracle"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics/influxdb" "github.com/ethereum/go-ethereum/metrics/influxdb"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/ethereum-optimism/optimism/go/gas-oracle/bindings" "github.com/ethereum-optimism/optimism/gas-oracle/bindings"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"math/big" "math/big"
"testing" "testing"
"github.com/ethereum-optimism/optimism/go/gas-oracle/bindings" "github.com/ethereum-optimism/optimism/gas-oracle/bindings"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"math/big" "math/big"
"strings" "strings"
"github.com/ethereum-optimism/optimism/go/gas-oracle/flags" "github.com/ethereum-optimism/optimism/gas-oracle/flags"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
......
...@@ -7,8 +7,8 @@ import ( ...@@ -7,8 +7,8 @@ import (
"math/big" "math/big"
"time" "time"
"github.com/ethereum-optimism/optimism/go/gas-oracle/bindings" "github.com/ethereum-optimism/optimism/gas-oracle/bindings"
"github.com/ethereum-optimism/optimism/go/gas-oracle/gasprices" "github.com/ethereum-optimism/optimism/gas-oracle/gasprices"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
......
...@@ -6,8 +6,8 @@ import ( ...@@ -6,8 +6,8 @@ import (
"math/big" "math/big"
"time" "time"
"github.com/ethereum-optimism/optimism/go/gas-oracle/bindings" "github.com/ethereum-optimism/optimism/gas-oracle/bindings"
ometrics "github.com/ethereum-optimism/optimism/go/gas-oracle/metrics" ometrics "github.com/ethereum-optimism/optimism/gas-oracle/metrics"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"math/big" "math/big"
"testing" "testing"
"github.com/ethereum-optimism/optimism/go/gas-oracle/bindings" "github.com/ethereum-optimism/optimism/gas-oracle/bindings"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
......
go 1.18
use (
./batch-submitter
./bss-core
./gas-oracle
./indexer
./l2geth
./l2geth-exporter
./op-exporter
./proxyd
./teleportr
)
replace github.com/ethereum-optimism/optimism/bss-core v0.0.0 => ./bss-core
replace github.com/ethereum-optimism/optimism/l2geth v0.0.0 => ./l2geth
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore build and test binaries.
bin/
testbin/
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin
testbin/*
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Kubernetes Generated files - skip generated files, except for vendored files
!vendor/**/zz_generated.*
# editor and IDE paraphernalia
.idea
*.swp
*.swo
*~
# Build the manager binary
FROM golang:1.16 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532
ENTRYPOINT ["/manager"]
# VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project.
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.0.1
# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable)
# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable")
ifneq ($(origin CHANNELS), undefined)
BUNDLE_CHANNELS := --channels=$(CHANNELS)
endif
# DEFAULT_CHANNEL defines the default channel used in the bundle.
# Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable")
# To re-generate a bundle for any other default channel without changing the default setup, you can:
# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable)
# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable")
ifneq ($(origin DEFAULT_CHANNEL), undefined)
BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
# This variable is used to construct full image tags for bundle and catalog images.
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# optimism-stacks.net/stackman-bundle:$VERSION and optimism-stacks.net/stackman-catalog:$VERSION.
IMAGE_TAG_BASE ?= optimism-stacks.net/stackman
# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
# Image URL to use all building/pushing image targets
IMG ?= ethereumoptimism/stackman-controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.22
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
# Setting SHELL to bash allows bash commands to be executed by recipes.
# This is a requirement for 'setup-envtest.sh' in the test target.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
all: build
##@ General
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk commands is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
# More info on the usage of ANSI control characters for terminal formatting:
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
# More info on the awk command:
# http://linuxcommand.org/lc3_adv_awk.php
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Development
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
fmt: ## Run go fmt against code.
go fmt ./...
vet: ## Run go vet against code.
go vet ./...
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
##@ Build
build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go
run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go
docker-build: test ## Build docker image with the manager.
docker build -t ${IMG} .
docker-push: ## Push docker image with the manager.
docker push ${IMG}
##@ Deployment
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl delete -f -
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)
KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)
ENVTEST = $(shell pwd)/bin/setup-envtest
envtest: ## Download envtest-setup locally if necessary.
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
@[ -f $(1) ] || { \
set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
rm -rf $$TMP_DIR ;\
}
endef
.PHONY: bundle
bundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
operator-sdk generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
operator-sdk bundle validate ./bundle
.PHONY: bundle-build
bundle-build: ## Build the bundle image.
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
.PHONY: bundle-push
bundle-push: ## Push the bundle image.
$(MAKE) docker-push IMG=$(BUNDLE_IMG)
.PHONY: opm
OPM = ./bin/opm
opm: ## Download opm locally if necessary.
ifeq (,$(wildcard $(OPM)))
ifeq (,$(shell which opm 2>/dev/null))
@{ \
set -e ;\
mkdir -p $(dir $(OPM)) ;\
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.15.1/$${OS}-$${ARCH}-opm ;\
chmod +x $(OPM) ;\
}
else
OPM = $(shell which opm)
endif
endif
# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0).
# These images MUST exist in a registry and be pull-able.
BUNDLE_IMGS ?= $(BUNDLE_IMG)
# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:v$(VERSION)
# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image.
ifneq ($(origin CATALOG_BASE_IMG), undefined)
FROM_INDEX_OPT := --from-index $(CATALOG_BASE_IMG)
endif
# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'.
# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see:
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
.PHONY: catalog-build
catalog-build: opm ## Build a catalog image.
$(OPM) index add --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT)
# Push the catalog image.
.PHONY: catalog-push
catalog-push: ## Push a catalog image.
$(MAKE) docker-push IMG=$(CATALOG_IMG)
domain: optimism-stacks.net
layout:
- go.kubebuilder.io/v3
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: stackman
repo: github.com/ethereum-optimism/optimism/go/stackman
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: optimism-stacks.net
group: stack
kind: CliqueL1
path: github.com/ethereum-optimism/optimism/go/stackman/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: optimism-stacks.net
group: stack
kind: Deployer
path: github.com/ethereum-optimism/optimism/go/stackman/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: optimism-stacks.net
group: stack
kind: DataTransportLayer
path: github.com/ethereum-optimism/optimism/go/stackman/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: optimism-stacks.net
group: stack
kind: Sequencer
path: github.com/ethereum-optimism/optimism/go/stackman/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: optimism-stacks.net
group: stack
kind: BatchSubmitter
path: github.com/ethereum-optimism/optimism/go/stackman/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: optimism-stacks.net
group: stack
kind: GasOracle
path: github.com/ethereum-optimism/optimism/go/stackman/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: optimism-stacks.net
group: stack
kind: Actor
path: github.com/ethereum-optimism/optimism/go/stackman/api/v1
version: v1
version: "3"
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ActorSpec defines the desired state of Actor
type ActorSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image,omitempty"`
L1URL string `json:"l1_url"`
L2URL string `json:"l2_url"`
PrivateKey *Valuer `json:"private_key,omitempty"`
AddressManagerAddress string `json:"address_manager_address"`
TestFilename string `json:"test_filename,omitempty"`
Concurrency int `json:"concurrency,omitempty"`
RunForMS int `json:"run_for_ms,omitempty"`
RunCount int `json:"run_count,omitempty"`
ThinkTimeMS int `json:"think_time_ms,omitempty"`
Env []corev1.EnvVar `json:"env,omitempty"`
}
// ActorStatus defines the observed state of Actor
type ActorStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// Actor is the Schema for the actors API
type Actor struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ActorSpec `json:"spec,omitempty"`
Status ActorStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// ActorList contains a list of Actor
type ActorList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Actor `json:"items"`
}
func init() {
SchemeBuilder.Register(&Actor{}, &ActorList{})
}
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// BatchSubmitterSpec defines the desired state of BatchSubmitter
type BatchSubmitterSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image,omitempty"`
L1URL string `json:"l1_url,omitempty"`
L1TimeoutSeconds int `json:"l1_timeout_seconds,omitempty"`
L2URL string `json:"l2_url,omitempty"`
L2TimeoutSeconds int `json:"l2_timeout_seconds,omitempty"`
DeployerURL string `json:"deployer_url,omitempty"`
DeployerTimeoutSeconds int `json:"deployer_timeout_seconds,omitempty"`
Env []corev1.EnvVar `json:"env,omitempty"`
}
// BatchSubmitterStatus defines the observed state of BatchSubmitter
type BatchSubmitterStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// BatchSubmitter is the Schema for the batchsubmitters API
type BatchSubmitter struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec BatchSubmitterSpec `json:"spec,omitempty"`
Status BatchSubmitterStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// BatchSubmitterList contains a list of BatchSubmitter
type BatchSubmitterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []BatchSubmitter `json:"items"`
}
func init() {
SchemeBuilder.Register(&BatchSubmitter{}, &BatchSubmitterList{})
}
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// CliqueL1Spec defines the desired state of CliqueL1
type CliqueL1Spec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image,omitempty"`
GenesisFile *Valuer `json:"genesis_file,omitempty"`
SealerPrivateKey *Valuer `json:"sealer_private_key"`
SealerAddress string `json:"sealer_address,omitempty"`
ChainID int `json:"chain_id,omitempty"`
DataPVC *PVCConfig `json:"data_pvc,omitempty"`
AdditionalArgs []string `json:"additional_args,omitempty"`
}
// CliqueL1Status defines the observed state of CliqueL1
type CliqueL1Status struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// CliqueL1 is the Schema for the cliquel1s API
type CliqueL1 struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec CliqueL1Spec `json:"spec,omitempty"`
Status CliqueL1Status `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// CliqueL1List contains a list of CliqueL1
type CliqueL1List struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []CliqueL1 `json:"items"`
}
func init() {
SchemeBuilder.Register(&CliqueL1{}, &CliqueL1List{})
}
package v1
import (
"gopkg.in/yaml.v2"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
)
type Valuer struct {
Value string `json:"value,omitempty"`
ValueFrom *corev1.EnvVarSource `json:"value_from,omitempty"`
}
func (v *Valuer) String() string {
out, err := yaml.Marshal(v)
if err != nil {
panic(err)
}
return string(out)
}
func (v *Valuer) EnvVar(name string) corev1.EnvVar {
return corev1.EnvVar{
Name: name,
Value: v.Value,
ValueFrom: v.ValueFrom,
}
}
type PVCConfig struct {
Name string `json:"name"`
Storage *resource.Quantity `json:"storage,omitempty"`
}
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// DataTransportLayerSpec defines the desired state of DataTransportLayer
type DataTransportLayerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image,omitempty"`
L1URL string `json:"l1_url,omitempty"`
L1TimeoutSeconds int `json:"l1_timeout_seconds,omitempty"`
DeployerURL string `json:"deployer_url,omitempty"`
DeployerTimeoutSeconds int `json:"deployer_timeout_seconds,omitempty"`
DataPVC *PVCConfig `json:"data_pvc,omitempty"`
Env []v1.EnvVar `json:"env,omitempty"`
}
// DataTransportLayerStatus defines the observed state of DataTransportLayer
type DataTransportLayerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// DataTransportLayer is the Schema for the datatransportlayers API
type DataTransportLayer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DataTransportLayerSpec `json:"spec,omitempty"`
Status DataTransportLayerStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// DataTransportLayerList contains a list of DataTransportLayer
type DataTransportLayerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []DataTransportLayer `json:"items"`
}
func init() {
SchemeBuilder.Register(&DataTransportLayer{}, &DataTransportLayerList{})
}
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// DeployerSpec defines the desired state of Deployer
type DeployerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image,omitempty"`
L1URL string `json:"l1_url,omitempty"`
L1TimeoutSeconds int `json:"l1_timeout_seconds,omitempty"`
Env []corev1.EnvVar `json:"env,omitempty"`
}
// DeployerStatus defines the observed state of Deployer
type DeployerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// Deployer is the Schema for the deployers API
type Deployer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DeployerSpec `json:"spec,omitempty"`
Status DeployerStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// DeployerList contains a list of Deployer
type DeployerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Deployer `json:"items"`
}
func init() {
SchemeBuilder.Register(&Deployer{}, &DeployerList{})
}
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// GasOracleSpec defines the desired state of GasOracle
type GasOracleSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image,omitempty"`
L1URL string `json:"l1_url,omitempty"`
L1TimeoutSeconds int `json:"l1_timeout_seconds,omitempty"`
L2URL string `json:"l2_url,omitempty"`
L2TimeoutSeconds int `json:"l2_timeout_seconds,omitempty"`
Env []v1.EnvVar `json:"env,omitempty"`
}
// GasOracleStatus defines the observed state of GasOracle
type GasOracleStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// GasOracle is the Schema for the gasoracles API
type GasOracle struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec GasOracleSpec `json:"spec,omitempty"`
Status GasOracleStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// GasOracleList contains a list of GasOracle
type GasOracleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []GasOracle `json:"items"`
}
func init() {
SchemeBuilder.Register(&GasOracle{}, &GasOracleList{})
}
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1 contains API Schema definitions for the stack v1 API group
//+kubebuilder:object:generate=true
//+groupName=stack.optimism-stacks.net
package v1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "stack.optimism-stacks.net", Version: "v1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// SequencerSpec defines the desired state of Sequencer
type SequencerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image,omitempty"`
L1URL string `json:"l1_url,omitempty"`
L1TimeoutSeconds int `json:"l1_timeout_seconds,omitempty"`
DeployerURL string `json:"deployer_url,omitempty"`
DeployerTimeoutSeconds int `json:"deployer_timeout_seconds,omitempty"`
DTLURL string `json:"dtl_url,omitempty"`
DTLTimeoutSeconds int `json:"dtl_timeout_seconds,omitempty"`
DataPVC *PVCConfig `json:"data_pvc,omitempty"`
Env []corev1.EnvVar `json:"env,omitempty"`
AdditionalArgs []string `json:"additional_args,omitempty"`
}
// SequencerStatus defines the observed state of Sequencer
type SequencerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// Sequencer is the Schema for the sequencers API
type Sequencer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec SequencerSpec `json:"spec,omitempty"`
Status SequencerStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// SequencerList contains a list of Sequencer
type SequencerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Sequencer `json:"items"`
}
func init() {
SchemeBuilder.Register(&Sequencer{}, &SequencerList{})
}
This diff is collapsed.
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: cliquel1s.stack.optimism-stacks.net
spec:
group: stack.optimism-stacks.net
names:
kind: CliqueL1
listKind: CliqueL1List
plural: cliquel1s
singular: cliquel1
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: CliqueL1 is the Schema for the cliquel1s API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CliqueL1Spec defines the desired state of CliqueL1
type: object
status:
description: CliqueL1Status defines the observed state of CliqueL1
properties:
pod_names:
items:
type: string
type: array
required:
- pod_names
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
# This kustomization.yaml is not intended to be run by itself,
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/stack.optimism-stacks.net_cliquel1s.yaml
- bases/stack.optimism-stacks.net_deployers.yaml
- bases/stack.optimism-stacks.net_datatransportlayers.yaml
- bases/stack.optimism-stacks.net_sequencers.yaml
- bases/stack.optimism-stacks.net_batchsubmitters.yaml
- bases/stack.optimism-stacks.net_gasoracles.yaml
- bases/stack.optimism-stacks.net_actors.yaml
#+kubebuilder:scaffold:crdkustomizeresource
patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_cliquel1s.yaml
#- patches/webhook_in_deployers.yaml
#- patches/webhook_in_datatransportlayers.yaml
#- patches/webhook_in_sequencers.yaml
#- patches/webhook_in_batchsubmitters.yaml
#- patches/webhook_in_gasoracles.yaml
#- patches/webhook_in_actors.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- patches/cainjection_in_cliquel1s.yaml
#- patches/cainjection_in_deployers.yaml
#- patches/cainjection_in_datatransportlayers.yaml
#- patches/cainjection_in_sequencers.yaml
#- patches/cainjection_in_batchsubmitters.yaml
#- patches/cainjection_in_gasoracles.yaml
#- patches/cainjection_in_actors.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml
# This file is for teaching kustomize how to substitute name and namespace reference in CRD
nameReference:
- kind: Service
version: v1
fieldSpecs:
- kind: CustomResourceDefinition
version: v1
group: apiextensions.k8s.io
path: spec/conversion/webhook/clientConfig/service/name
namespace:
- kind: CustomResourceDefinition
version: v1
group: apiextensions.k8s.io
path: spec/conversion/webhook/clientConfig/service/namespace
create: false
varReference:
- path: metadata/annotations
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: actors.stack.optimism-stacks.net
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: batchsubmitters.stack.optimism-stacks.net
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: cliquel1s.stack.optimism-stacks.net
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: datatransportlayers.stack.optimism-stacks.net
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: deployers.stack.optimism-stacks.net
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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