diff --git a/.changeset/red-trains-run.md b/.changeset/red-trains-run.md new file mode 100644 index 0000000000000000000000000000000000000000..c46e1853a35c9740371099a757d6157a3f80576d --- /dev/null +++ b/.changeset/red-trains-run.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/endpoint-monitor': major +--- + +Initial release of endpoint monitor diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml index 8f81d0911ec7a2baed5dfc9fb2d3eb245c207af9..a874fd327b61695512d3d4a4c7bf00476f3ffd69 100644 --- a/.github/workflows/publish-canary.yml +++ b/.github/workflows/publish-canary.yml @@ -32,6 +32,7 @@ jobs: batch-submitter-service: ${{ steps.packages.outputs.batch-submitter-service }} indexer: ${{ steps.packages.outputs.indexer }} teleportr: ${{ steps.packages.outputs.teleportr }} + endpoint-monitor: ${{ steps.packages.outputs.l2geth-exporter }} steps: - name: Check out source code @@ -603,3 +604,41 @@ jobs: GITDATE=${{ steps.build_args.outputs.GITDATE }} GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }} GITVERSION=${{ steps.build_args.outputs.GITVERSION }} + + endpoint-monitor: + name: Publish endpoint-monitor Version ${{ needs.canary-publish.outputs.canary-docker-tag }} + needs: canary-publish + if: needs.canary-publish.outputs.endpoint-monitor != '' + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} + + - name: Set build args + id: build_args + run: | + echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" + echo ::set-output name=GITVERSION::$(jq -r .version ./endpoint-monitor/package.json) + echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./endpoint-monitor/Dockerfile + push: true + tags: ethereumoptimism/endpoint-monitor:${{ needs.canary-publish.outputs.endpoint-monitor }} + build-args: | + GITDATE=${{ steps.build_args.outputs.GITDATE }} + GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }} + GITVERSION=${{ steps.build_args.outputs.GITVERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c10e3e4dc3e749663b146c68ed621f92796ffb8b..726d680931f1cff2355dd3bcf77fe2372144a2c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: teleportr: ${{ steps.packages.outputs.teleportr }} ci-builder: ${{ steps.packages.outputs.ci-builder }} foundry: ${{ steps.packages.outputs.foundry }} + endpoint-monitor: ${{ steps.packages.outputs.endpoint-monitor }} steps: - name: Checkout Repo @@ -635,3 +636,40 @@ jobs: GITDATE=${{ steps.build_args.outputs.GITDATE }} GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }} GITVERSION=${{ steps.build_args.outputs.GITVERSION }} + + endpoint-monitor: + name: Publish endpoint-monitor Version ${{ needs.release.outputs.endpoint-monitor}} + needs: release + if: needs.release.outputs.endpoint-monitor != '' + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} + + - name: Set build args + id: build_args + run: | + echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" + echo ::set-output name=GITVERSION::$(jq -r .version ./endpoint-monitor/package.json) + echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./endpoint-monitor/Dockerfile + push: true + tags: ethereumoptimism/endpoint-monitor:${{ needs.release.outputs.endpoint-monitor }},ethereumoptimism/endpoint-monitor:latest + build-args: | + GITDATE=${{ steps.build_args.outputs.GITDATE }} + GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }} + GITVERSION=${{ steps.build_args.outputs.GITVERSION }} diff --git a/endpoint-monitor/CHANGELOG.md b/endpoint-monitor/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..779e68678a60ab7bfb312821a22451db8b216546 --- /dev/null +++ b/endpoint-monitor/CHANGELOG.md @@ -0,0 +1 @@ +# @eth-optimism/endpoint-monitor diff --git a/endpoint-monitor/config.go b/endpoint-monitor/config.go index 51f9fbb23d9b17af42289f09b20b706a1340cfb5..f741c72db78c2d02d8d21b39606fdb93559df11f 100644 --- a/endpoint-monitor/config.go +++ b/endpoint-monitor/config.go @@ -50,9 +50,9 @@ func CLIFlags(envPrefix string) []cli.Flag { } type Config struct { - Providers []string `envconfig:"PROVIDERS" required:"true"` - CheckInterval time.Duration `envconfig:"CHECK_INTERVAL" default:"5m"` - CheckDuration time.Duration `envconfig:"CHECK_DURATION" default:"4m"` + Providers []string + CheckInterval time.Duration + CheckDuration time.Duration LogConfig oplog.CLIConfig MetricsConfig opmetrics.CLIConfig diff --git a/endpoint-monitor/package.json b/endpoint-monitor/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d1233b5efc6d47ffb37443b0421f74f57b21ca3b --- /dev/null +++ b/endpoint-monitor/package.json @@ -0,0 +1,6 @@ +{ + "name": "@eth-optimism/endpoint-monitor", + "version": "0.0.0", + "private": true, + "dependencies": {} +} diff --git a/package.json b/package.json index ee21b2580ba9b4f46da8a04253747221899f45c6..7f9c2ffef1c2aeca31ddb0709c2e54a8ba47163c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "ops/docker/ci-builder", "ops/docker/foundry", "proxyd", - "teleportr" + "teleportr", + "endpoint-monitor" ], "nohoist": [ "**/typechain/*",