-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHA pipeline rewrite for ease and speed #1551
Merged
Merged
Changes from 69 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
943ca6a
Renmove unnecessary/old workflow files
gpmayorga 9ea2c6f
Add PR common checks and wasm build(s)
gpmayorga 298c307
Modify docs buld
gpmayorga 06dc4ef
modify benchmark
gpmayorga 77948d5
Modify CI script (simpler)
gpmayorga 949dbeb
Add docker build
gpmayorga 934145d
Add prep action for common Ubuntu steps.
gpmayorga 3641a11
separate sccache gcloud action
gpmayorga 98ca8f3
fix dockertag pattern
gpmayorga c2bc2cf
delete old benchmark check
gpmayorga 79eff04
Trick the wasm publish for this branch
gpmayorga bb5713e
new benchmark pipeline
gpmayorga c6be052
additional cache options
gpmayorga 309afdb
exclude runtime integration tests from dockerfile
gpmayorga c2b8fc7
fix buildwasm
gpmayorga 53a21a0
fix docker build & fix benchmarks
gpmayorga f79e94b
remove old benchmark job
gpmayorga 97fa94e
debug benchmark cache
gpmayorga 6a4c523
fix wasm location upload
gpmayorga 12292b0
better benchmark PR
gpmayorga 9486c1e
small fixes
gpmayorga ed7ec02
fix typo on build-wasm
gpmayorga 5200f38
better Docker build and management
gpmayorga d467440
small fixes
gpmayorga 0bfbf7a
cleanup and concurrency review
gpmayorga 9fddac4
simplify docker and fix bench-check cache
gpmayorga 9ca1e9a
inject sccache in the docker image
gpmayorga 61cbe48
fix benchmark write access for PRs
gpmayorga d72014a
test gha cache for docker
gpmayorga c9264d8
remove sccache from dockerfile
gpmayorga e23b574
adjust machine size and fix quotation in Dockfile
gpmayorga 8087d93
try fix docker var quoting
gpmayorga 3b1d5b3
pin all github action versions
gpmayorga 06ec8e1
fix srtool build
gpmayorga 0271fdb
Upload srtool report from wasm build
gpmayorga ec97693
add code coverage to wasm build
gpmayorga d4512b0
Merge branch 'main' into ci-rewrite-n-cache
gpmayorga 8ed4eda
fix typo
gpmayorga b0b406c
add nix build (fully commented)
gpmayorga 64d1822
Update build-wasm.yml
gpmayorga 7868914
change build wasm docker run
gpmayorga fae3288
Move the code coverage up to see erros
gpmayorga c47131e
check if wasm builds
gpmayorga 30a8468
try and force the report generation
gpmayorga b967a3a
Merge branch 'main' into ci-rewrite-n-cache
gpmayorga 31660dd
review the PR with @wischli
gpmayorga 8a9f774
Merge remote-tracking branch 'origin/main' into ci-rewrite-n-cache
gpmayorga eed117c
Try cargo install --locked
gpmayorga d03c379
Use toolchain from toml file
gpmayorga d51ee77
small fixes
gpmayorga 31d1884
comment code coverage reports
gpmayorga 7d486b7
trigger wasm build only on tag push
gpmayorga 44012ad
Rename benchmarks job
gpmayorga 2ce5707
try and fix the docker tag logic
gpmayorga 780adbf
small fixes
gpmayorga f0f25af
more minor fixes
gpmayorga 0d414a8
fix cache warning
gpmayorga 2ce04c8
srtool has no latest tag on the repo, using 1.69
gpmayorga 3eda725
remove production environment restrictions
gpmayorga aeaaedd
Fix GITHUB_ENV and bump srtool version
gpmayorga 5a5d394
Merge remote-tracking branch 'origin/main' into ci-rewrite-n-cache
wischli 8879d86
chore: update srtool version to latest
wischli 61fcacb
fix: remove unused rust toolchain from setup
wischli 9dfdcfb
fix: toolchain version docker build
wischli 43e5d7a
fix: remove unused thread_local
wischli 5177624
Update build-wasm.yml
gpmayorga 8398d7a
Final review of CI changes
gpmayorga 13e2085
review of sanity-checks
gpmayorga 3e9b865
Final review of CI PR with @wischli
gpmayorga bfc67a5
Use Rust docker image for building the binary
gpmayorga 2fac7af
Fix review comments
gpmayorga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
**/target/ | ||
.github/ | ||
!scripts/install_toolchain.sh | ||
docker-compos | ||
.gitignore | ||
docker | ||
README.md |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Prepare Ubuntu for Rust builds | ||
description: cleanup and Rust Tools setup | ||
inputs: | ||
cache: | ||
description: cache type (enabled if set) | ||
default: "disabled" | ||
GWIP: | ||
description: "Google Workload identity provider" | ||
default: '' | ||
GSA: | ||
description: "Google Service Account" | ||
default: '' | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Prep build on Ubuntu | ||
id: ubuntu_prep | ||
shell: sh | ||
run: | | ||
echo "Pre cleanup" | ||
df -h | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
echo "Post cleanup" | ||
df -h | ||
sudo apt-get install protobuf-compiler | ||
- name: Install toolchain from rust-toolchain.toml | ||
shell: sh | ||
run: scripts/install_toolchain.sh | ||
|
||
- name: SCcache setup | ||
if: ${{ inputs.cache == 'enabled' }} | ||
uses: ./.github/actions/sccache-gcloud | ||
with: | ||
GWIP: ${{ inputs.GWIP }} | ||
GSA: ${{ inputs.GSA }} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Install SCcache w/ GCloud bucket | ||
description: Configure Scache to use a Gcloud bucket through workload identity | ||
|
||
inputs: | ||
GWIP: | ||
description: Google Workflow Identity provider | ||
required: true | ||
GSA: | ||
description: Google Service Account | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
|
||
- name: Auth gcloud | ||
id: gauth | ||
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033 # @v1.1.1 | ||
with: | ||
workload_identity_provider: ${{ inputs.GWIP }} | ||
service_account: ${{ inputs.GSA }} | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/sccache-action@8417cffc2ec64127ad83077aceaa8631f7cdc83e #v0.0.3 | ||
wischli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: set GCS bucket sccache variables | ||
shell: bash | ||
run: | | ||
echo "SCCACHE_GCS_BUCKET=centrifuge-chain-sccache-backend" >> $GITHUB_ENV | ||
echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV | ||
# The gauth step should already take care of this: | ||
# echo "SCCACHE_GCS_KEY_PATH=${{ steps.gauth.credentials_file_path }}" >> $GITHUB_ENV | ||
- name: setup Rust sccache wrapper | ||
if: ${{ inputs.cache == 'enabled' }} | ||
shell: bash | ||
run: | | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
echo "CARGO_INCREMENTAL=false" >> $GITHUB_ENV # https://github.com/mozilla/sccache#rust | ||
- name: Run sccache stat for check | ||
shell: bash | ||
run: ${SCCACHE_PATH} --show-stats |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Docker Build | ||
on: | ||
# Keep in mind the Docker tagging on the "metadata" step if you add new triggers | ||
push: | ||
branches: [main] | ||
release: | ||
types: [unpublished] # GITHUB_REF == tag pushed with the release | ||
pull_request: | ||
paths: | ||
- ".github/workflows/build-docker.yml" | ||
- "docker/centrifuge-chain/Dockerfile" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}${{ github.ref == '/refs/heads/main' && github.sha || 'false' }} | ||
cancel-in-progress: true | ||
jobs: | ||
docker: | ||
strategy: | ||
matrix: | ||
target: [ release, test ] | ||
runs-on: ubuntu-latest-8-cores | ||
steps: | ||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Free space | ||
# https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930 | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
# sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
- name: check available docker space | ||
run: | | ||
docker volume ls | ||
df -h | ||
- name: Install toolchain from rust-toolchain.toml | ||
shell: sh | ||
run: | | ||
TOOLCHAIN_VERSION=$(grep 'channel =' rust-toolchain.toml | awk -F'"' '{print $2}') | ||
rustup toolchain install "$TOOLCHAIN_VERSION" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 #v3 | ||
- name: DockerHub Login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- run: echo "NOW=$(date -u +%y-%m-%d)" >> $GITHUB_ENV | ||
|
||
- name: Setup docker metadata | ||
id: meta | ||
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 #v5 | ||
with: | ||
images: centrifugeio/centrifuge-chain | ||
flavor: | | ||
suffix=-${{ env.NOW }} | ||
prefix=${{ matrix.target == 'test' && 'test-' || 'latest=auto' }} | ||
tags: | | ||
type=raw,event=branch,value={{branch}}-{{sha}} | ||
type=semver,pattern={{raw}},suffix=,prefix=${{ matrix.target == 'test' && 'test-' || 'latest=auto' }} | ||
type=semver,pattern={{major}},prefix=${{ matrix.target == 'test' && 'test-' || '' }},suffix= | ||
type=edge | ||
- name: Configure sccache | ||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 #v6 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
- name: Build and push centrifugeio/centrifuge-chain | ||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 #v5 | ||
with: | ||
context: . | ||
file: ./docker/centrifuge-chain/Dockerfile | ||
build-args: | | ||
FEATURES=${{ matrix.target == 'test' && 'fast-runtime' || '' }} | ||
push: ${{ github.ref == '/refs/heads/main' && true || false }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
# Cache options: | ||
# https://docs.docker.com/build/ci/github-actions/cache/ | ||
cache-from: type=gha | ||
# cache-from: type=registry,ref=centrifugeio/centrifuge-chain:${{ github.ref }} | ||
# https://docs.docker.com/build/cache/backends/inline/ | ||
cache-to: type=gha, mode=max | ||
# cache-to: type=registry,ref=centrifugeio/centrifuge-chain:${{ github.ref }}, mode=max | ||
wischli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Update DockerHub descriptions | ||
if: contains(github.ref, 'refs/tags/release-v') | ||
uses: peter-evans/dockerhub-description@dc67fad7001ef9e8e3c124cb7a64e16d0a63d864 #v3.4.2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
repository: centrifuge/centrifuge-chain | ||
short-description: ${{ github.event.repository.description }} | ||
enable-url-completion: true | ||
|
||
- if: failure() | ||
name: Check available space after build failed | ||
run: | | ||
docker volume ls | ||
df -h |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could add @wischli too, for the bus factor