Skip to content

Commit

Permalink
Unified container jobs in one workflow. Added metadata-crawler jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortejoso committed Dec 14, 2023
1 parent be09de7 commit 2a67b85
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 127 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/celo-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
code-${{ github.sha }}
- name: Detect files changed in PR (or commit), and expose as output
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v40
with:
# Using comma as separator to be able to easily match full paths (using ,<path>)
separator: ','
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/container-all-monorepo.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/container-celotool.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/container-cli.yml

This file was deleted.

157 changes: 157 additions & 0 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
name: Build containers

on:
push:
paths:
- 'dockerfiles/**'
branches:
- master
pull_request:
paths:
- 'dockerfiles/**'
workflow_dispatch:

jobs:
changed-files:
runs-on: ubuntu-latest
outputs:
# Propagate more outputs if you need https://github.com/tj-actions/changed-files#outputs
# Adding a initial comma so ',<path>' matches also for the first file
all_modified_files: ',${{ steps.changed-files.outputs.all_modified_files }}'
steps:
- uses: actions/checkout@v4
- name: Detect files changed in PR (or commit), and expose as output
id: changed-files
uses: tj-actions/changed-files@v40
with:
# Using comma as separator to be able to easily match full paths (using ,<path>)
separator: ','

# Celotool images
celotool-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celotool:${{ github.sha }}
needs: changed-files
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/celotool/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/celotool
tags: ${{ github.sha }}
context: .
file: dockerfiles/celotool/Dockerfile
trivy: true
celotool-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool:${{ github.sha }}
needs: changed-files
if: |
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/celotool/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool
tags: ${{ github.sha }}
context: .
file: dockerfiles/celotool/Dockerfile
trivy: true

# All monorepo
celomonorepo-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/monorepo:${{ github.sha }}
needs: changed-files
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/all-monorepo/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/monorepo
tags: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile
trivy: true
celomonorepo-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo:${{ github.sha }}
needs: changed-files
if: |
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/all-monorepo/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo
tags: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile
trivy: true

# CeloCli images
celocli-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celocli:testing
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/cli-standalone/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/celocli
tags: testing
context: .
file: dockerfiles/cli-standalone/Dockerfile
trivy: true
celocli-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celocli:latest
if: |
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/cli-standalone/Dockerfile')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/celocli
tags: latest
context: .
file: dockerfiles/cli-standalone/Dockerfile
trivy: true

# Blockscout Metadata crawler images
metadata-crawler-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/blockscoute-metadata-crawler:testing
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/metadata-crawler')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/blockscoute-metadata-crawler
tags: testing
context: .
file: dockerfiles/metadata-crawler
trivy: true
metadata-crawler-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
needs: changed-files
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/blockscoute-metadata-crawler:testing
if: |
github.ref != 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/metadata-crawler')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/blockscoute-metadata-crawler
tags: master
context: .
file: dockerfiles/metadata-crawler
trivy: true
14 changes: 14 additions & 0 deletions .github/workflows/publish_censored_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Protocol Foundry tests
on: [workflow_dispatch]

jobs:
runs-on: ubuntu-latest

for pod in $(kubectl get pods -l component=validators -n globaltestnet --no-headers -o custom-columns=":metadata.name"); do
echo "Validator $pod, block $(kubectl exec -it $pod -c geth -- geth attach --exec 'eth.blockNumber')"
done

k exec -it globaltestnet-load-test-0 -c geth -- geth attach --exec 'admin.addPeer("enode://f938f0246c4c3248f05ea2566cd5ad5a9004e59fdcc8040e6c59bf13edd02565c96a3ef81ebb8f9b005abccff90316fe291e3a6ab38569b493d7d91d8122e458@130.211.76.255:30303")'
k exec -it globaltestnet-load-test-0 -c geth -- geth attach --exec 'admin.addPeer("enode://bd4ac93b6eebe34024c105984974215ee996ac99d0b2c30fccd50bdfff6cde9a774f2c35a1e91616d29fee12679894ce4bd6c812f1665a46f3d404311cb8cad3@35.195.20.98:30303")'
k exec -it globaltestnet-load-test-0 -c geth -- geth attach --exec 'admin.addPeer("enode://b64363b8618a0b8f2b43869481c13c9da67e864377ffd3ce3bf3122a22fde471ed9ebfa8d1bfa97ec7cc8f4715a2e61845012417599b672bc266ac4e62c877d8@35.240.106.222:30303")'
k exec -it globaltestnet-load-test-0 -c geth -- geth attach --exec 'admin.addPeer("enode://750bfdecc18ea107c251fda411dd3f75a6a9023d3565d6b6692a92157828fbccb66d5706d042cee333ae11541f2748237f8930407ab9505d0f1b3c2d60e9f60b@35.205.197.201:30303")'

0 comments on commit 2a67b85

Please sign in to comment.