From 312eac8cac2fa9af28923a9840f754f7b4e24793 Mon Sep 17 00:00:00 2001 From: Donald Hutchison Date: Tue, 13 Feb 2024 09:24:08 +0100 Subject: [PATCH 1/7] Remove dead links from nav. --- apps/block_scout_web/config/navigation.exs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/apps/block_scout_web/config/navigation.exs b/apps/block_scout_web/config/navigation.exs index 2bd8413d200d..8ca18d2cf4d2 100644 --- a/apps/block_scout_web/config/navigation.exs +++ b/apps/block_scout_web/config/navigation.exs @@ -3,8 +3,6 @@ import Config config :block_scout_web, defi: [ %{title: "Moola", url: "https://moola.market/"}, - %{title: "Pinnata", url: "https://www.pinnata.xyz/farm#/"}, - %{title: "GoodGhosting", url: "https://goodghosting.com/"}, %{title: "Revo", url: "https://revo.market/"}, %{title: "ImmortalDao Finance", url: "https://www.immortaldao.finance"} ], @@ -19,14 +17,10 @@ config :block_scout_web, %{title: "Valora", url: "https://valoraapp.com/"}, %{title: "Celo Terminal", url: "https://celoterminal.com/"}, %{title: "Celo Wallet", url: "https://celowallet.app/"}, - %{title: "Node Wallet", url: "https://www.nodewallet.xyz/"} ], nft_list: [ - %{title: "Niftydrop", url: "https://niftydrop.net/"}, %{title: "NFT Viewer", url: "https://nfts.valoraapp.com/"}, - %{title: "Cyberbox", url: "https://cyberbox.art/"}, %{title: "Nomspace", url: "https://nom.space/"}, - %{title: "Alities", url: "https://alities.io/"} ], connect_list: [ %{title: "impactMarket", url: "https://impactmarket.com/"}, @@ -40,20 +34,17 @@ config :block_scout_web, ], finance_tools_list: [ %{title: "Celo Tracker", url: "https://celotracker.com/"}, - %{title: "celo.tax", url: "https://celo.tax/"}, %{title: "Trelis", url: "https://trelis.com/"} ], resources: [ %{title: "Celo Vote", url: "https://celovote.com/"}, %{title: "Celo Forum", url: "https://forum.celo.org/"}, %{title: "TheCelo", url: "https://thecelo.com/"}, - %{title: "Validators", url: "https://celo.org/validators/explore"}, %{title: "Celo Reserve", url: "https://celoreserve.org/"}, %{title: "Celo Docs", url: "https://docs.celo.org/"} ], learning: [ %{title: "Celo Whitepaper", url: "https://celo.org/papers/whitepaper"}, - %{title: "Learn Celo", url: "https://learn.figment.io/protocols/celo"}, %{title: "Coinbase Earn", url: "https://www.coinbase.com/price/celo"} ], other_networks: [ From 439cb582231f89693b8495f4d965b646cc844e16 Mon Sep 17 00:00:00 2001 From: Donald Hutchison Date: Tue, 13 Feb 2024 09:43:33 +0100 Subject: [PATCH 2/7] Mix format. --- apps/block_scout_web/config/navigation.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/config/navigation.exs b/apps/block_scout_web/config/navigation.exs index 8ca18d2cf4d2..ed151374884f 100644 --- a/apps/block_scout_web/config/navigation.exs +++ b/apps/block_scout_web/config/navigation.exs @@ -16,11 +16,11 @@ config :block_scout_web, wallet_list: [ %{title: "Valora", url: "https://valoraapp.com/"}, %{title: "Celo Terminal", url: "https://celoterminal.com/"}, - %{title: "Celo Wallet", url: "https://celowallet.app/"}, + %{title: "Celo Wallet", url: "https://celowallet.app/"} ], nft_list: [ %{title: "NFT Viewer", url: "https://nfts.valoraapp.com/"}, - %{title: "Nomspace", url: "https://nom.space/"}, + %{title: "Nomspace", url: "https://nom.space/"} ], connect_list: [ %{title: "impactMarket", url: "https://impactmarket.com/"}, From a5cad556dc5c7d00197dd8c6b06441ed0852b03c Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Tue, 13 Feb 2024 11:09:07 +0100 Subject: [PATCH 3/7] Update container ci-cd jobs to use self-hosted runners --- .github/workflows/blockscout.yml | 118 ++++++++++++++----------------- 1 file changed, 52 insertions(+), 66 deletions(-) diff --git a/.github/workflows/blockscout.yml b/.github/workflows/blockscout.yml index 4017e0bc83b6..9a21fca398bb 100644 --- a/.github/workflows/blockscout.yml +++ b/.github/workflows/blockscout.yml @@ -26,9 +26,6 @@ jobs: build-and-cache: name: Build and Cache deps runs-on: [ '8-cpu','self-hosted', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root steps: - uses: actions/checkout@v3 - uses: erlef/setup-beam@v1 @@ -95,9 +92,6 @@ jobs: credo: name: Credo runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -122,9 +116,6 @@ jobs: check_formatted: name: Code formatting checks runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -148,9 +139,6 @@ jobs: dialyzer: name: Dialyzer static analysis runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -191,9 +179,6 @@ jobs: gettext: name: Missing translation keys check runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -220,9 +205,6 @@ jobs: sobelow: name: Sobelow security analysis runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -251,9 +233,6 @@ jobs: eslint: name: ESLint runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -308,9 +287,6 @@ jobs: jest: name: JS Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -356,9 +332,6 @@ jobs: test_nethermind_mox_ethereum_jsonrpc: name: EthereumJSONRPC Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache services: postgres: @@ -424,9 +397,6 @@ jobs: test_nethermind_mox_explorer: name: Explorer Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache services: postgres: @@ -513,9 +483,6 @@ jobs: test_nethermind_mox_indexer: name: Indexer Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache services: postgres: @@ -586,9 +553,6 @@ jobs: test_nethermind_mox_block_scout_web: name: Blockscout Web Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] - container: - image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest - options: --user root needs: build-and-cache env: DATABASE_URL: postgres://postgres:postgres@postgres:5432/explorer_test @@ -745,35 +709,57 @@ jobs: echo "tag=${{ github.ref != 'ref/heads/main' && 'testing' || 'latest' }}" >> $GITHUB_OUTPUT echo "sha=${{ github.ref != 'ref/heads/main' && github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_OUTPUT - - Build-Blockscout: - uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v2.0 + build-blockscout-container: + runs-on: ['self-hosted', '8-cpu', 'blockscout'] needs: [set-docker-vars] - with: - workload-id-provider: ${{ needs.set-docker-vars.outputs.workload-id-provider }} - service-account: ${{ needs.set-docker-vars.outputs.service-account }} - artifact-registry: "${{ needs.set-docker-vars.outputs.artifact-registry }}/blockscout" - tags: ${{ needs.set-docker-vars.outputs.tag }} - context: . - file: docker/Dockerfile - build-args: | - "FORCE_MIX_COMPILE_CACHE_MISS=${{ needs.set-docker-vars.outputs.sha }}" - trivy: true - - - Build-Blockscout-api: - uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v2.0 + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + - name: Authenticate to Google Cloud + uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v2.0.1 + with: + workload-id-provider: ${{ needs.set-docker-vars.outputs.workload-id-provider }} + service-account: ${{ needs.set-docker-vars.outputs.service-account }} + access-token-lifetime: "20m" + docker-gcp-registries: "us-west1-docker.pkg.dev" + - name: Build, push and scan the container + uses: celo-org/reusable-workflows/.github/actions/build-container@main + with: + platforms: linux/amd64 + registry: "${{ needs.set-docker-vars.outputs.artifact-registry }}/blockscout" + tags: ${{ needs.set-docker-vars.outputs.tag }} + context: . + dockerfile: docker/Dockerfile + build-args: | + "FORCE_MIX_COMPILE_CACHE_MISS=${{ needs.set-docker-vars.outputs.sha }}" + push: true + trivy: true + + build-blockscout-api-container: + runs-on: ['self-hosted', '8-cpu', 'blockscout'] needs: [set-docker-vars] - with: - workload-id-provider: ${{ needs.set-docker-vars.outputs.workload-id-provider }} - service-account: ${{ needs.set-docker-vars.outputs.service-account }} - artifact-registry: "${{ needs.set-docker-vars.outputs.artifact-registry }}/blockscout-api" - tags: ${{ needs.set-docker-vars.outputs.tag }} - context: . - file: docker/Dockerfile - build-args: | - "FORCE_MIX_COMPILE_CACHE_MISS=${{ needs.set-docker-vars.outputs.sha }}" - "DISABLE_WRITE_API=true", - "DISABLE_INDEXER=true", - "DISABLE_WEBAPP=true", - trivy: true + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + - name: Authenticate to Google Cloud + uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v2.0.1 + with: + workload-id-provider: ${{ needs.set-docker-vars.outputs.workload-id-provider }} + service-account: ${{ needs.set-docker-vars.outputs.service-account }} + access-token-lifetime: "20m" + docker-gcp-registries: "us-west1-docker.pkg.dev" + - name: Build, push and scan the container + uses: celo-org/reusable-workflows/.github/actions/build-container@main + with: + platforms: linux/amd64 + registry: "${{ needs.set-docker-vars.outputs.artifact-registry }}/blockscout" + tags: ${{ needs.set-docker-vars.outputs.tag }} + context: . + dockerfile: docker/Dockerfile + build-args: | + "FORCE_MIX_COMPILE_CACHE_MISS=${{ needs.set-docker-vars.outputs.sha }}" + "DISABLE_WRITE_API=true", + "DISABLE_INDEXER=true", + "DISABLE_WEBAPP=true", + push: true + trivy: true From 235aa9172ca27a4cbebbd536825543890edb3afe Mon Sep 17 00:00:00 2001 From: Donald Hutchison Date: Tue, 13 Feb 2024 11:16:21 +0100 Subject: [PATCH 4/7] Bump cache version. --- .github/workflows/blockscout.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/blockscout.yml b/.github/workflows/blockscout.yml index 9a21fca398bb..c6377e14df92 100644 --- a/.github/workflows/blockscout.yml +++ b/.github/workflows/blockscout.yml @@ -20,7 +20,7 @@ env: ACCOUNT_AUTH0_DOMAIN: 'blockscoutcom.us.auth0.com' ACCOUNT_AUTH0_LOGOUT_URL: 'https://blockscoutcom.us.auth0.com/v2/logout' ACCOUNT_AUTH0_LOGOUT_RETURN_URL: 'https://blockscout.com/auth/logout' - CACHE_VERSION: 20 + CACHE_VERSION: 21 jobs: build-and-cache: From 6fd9547432a881a214353b413d2def02db3f8b63 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Tue, 13 Feb 2024 11:25:59 +0100 Subject: [PATCH 5/7] Restore container option --- .github/workflows/blockscout.yml | 45 ++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/.github/workflows/blockscout.yml b/.github/workflows/blockscout.yml index c6377e14df92..f98b33ae1797 100644 --- a/.github/workflows/blockscout.yml +++ b/.github/workflows/blockscout.yml @@ -25,7 +25,10 @@ env: jobs: build-and-cache: name: Build and Cache deps - runs-on: [ '8-cpu','self-hosted', 'blockscout'] + runs-on: [ '8-cpu', 'self-hosted', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root steps: - uses: actions/checkout@v3 - uses: erlef/setup-beam@v1 @@ -92,6 +95,9 @@ jobs: credo: name: Credo runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -116,6 +122,9 @@ jobs: check_formatted: name: Code formatting checks runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -139,6 +148,9 @@ jobs: dialyzer: name: Dialyzer static analysis runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -179,6 +191,9 @@ jobs: gettext: name: Missing translation keys check runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -205,6 +220,9 @@ jobs: sobelow: name: Sobelow security analysis runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -233,6 +251,9 @@ jobs: eslint: name: ESLint runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -287,6 +308,9 @@ jobs: jest: name: JS Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache steps: - uses: actions/checkout@v3 @@ -332,6 +356,9 @@ jobs: test_nethermind_mox_ethereum_jsonrpc: name: EthereumJSONRPC Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache services: postgres: @@ -397,6 +424,9 @@ jobs: test_nethermind_mox_explorer: name: Explorer Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache services: postgres: @@ -483,6 +513,9 @@ jobs: test_nethermind_mox_indexer: name: Indexer Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache services: postgres: @@ -553,6 +586,9 @@ jobs: test_nethermind_mox_block_scout_web: name: Blockscout Web Tests runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: build-and-cache env: DATABASE_URL: postgres://postgres:postgres@postgres:5432/explorer_test @@ -663,7 +699,6 @@ jobs: name: Wallaby screenshots path: apps/block_scout_web/screenshots/*.png - publish-test-results: name: "Publish Unit Tests Results" runs-on: ['self-hosted', '8-cpu', 'blockscout'] @@ -711,6 +746,9 @@ jobs: build-blockscout-container: runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: [set-docker-vars] steps: - name: 'Checkout' @@ -737,6 +775,9 @@ jobs: build-blockscout-api-container: runs-on: ['self-hosted', '8-cpu', 'blockscout'] + container: + image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest + options: --user root needs: [set-docker-vars] steps: - name: 'Checkout' From 50412667093dabbe0aa48b4e39b03f7c07ea6a95 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Tue, 13 Feb 2024 11:52:13 +0100 Subject: [PATCH 6/7] Bumped cache --- .github/workflows/blockscout.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/blockscout.yml b/.github/workflows/blockscout.yml index f98b33ae1797..fbedbe107d4c 100644 --- a/.github/workflows/blockscout.yml +++ b/.github/workflows/blockscout.yml @@ -20,7 +20,7 @@ env: ACCOUNT_AUTH0_DOMAIN: 'blockscoutcom.us.auth0.com' ACCOUNT_AUTH0_LOGOUT_URL: 'https://blockscoutcom.us.auth0.com/v2/logout' ACCOUNT_AUTH0_LOGOUT_RETURN_URL: 'https://blockscout.com/auth/logout' - CACHE_VERSION: 21 + CACHE_VERSION: 22 jobs: build-and-cache: From 591b0595f04bfedef1cf3448b8769963c71d2902 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Tue, 13 Feb 2024 12:12:40 +0100 Subject: [PATCH 7/7] Add workflow permissions --- .github/workflows/blockscout.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/blockscout.yml b/.github/workflows/blockscout.yml index fbedbe107d4c..ff12358ccfab 100644 --- a/.github/workflows/blockscout.yml +++ b/.github/workflows/blockscout.yml @@ -750,6 +750,10 @@ jobs: image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest options: --user root needs: [set-docker-vars] + permissions: + contents: read + id-token: write + security-events: write steps: - name: 'Checkout' uses: actions/checkout@v4 @@ -779,6 +783,10 @@ jobs: image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest options: --user root needs: [set-docker-vars] + permissions: + contents: read + id-token: write + security-events: write steps: - name: 'Checkout' uses: actions/checkout@v4