Skip to content
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

Start rebuilding the GH actions for speed #1542

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8191d73
Start rebuilding the GH actions for speed
gpmayorga Sep 12, 2023
0041367
fix tests.yml
gpmayorga Sep 12, 2023
996222d
Try with different action path
gpmayorga Sep 12, 2023
c667b4a
try fix the first two ci files
gpmayorga Sep 12, 2023
d0aeae5
fix tests
gpmayorga Sep 12, 2023
f7e3595
add concurrency and more testing
gpmayorga Sep 12, 2023
a7d6c57
more fixing
gpmayorga Sep 12, 2023
0fdc756
more tests
gpmayorga Sep 12, 2023
dcea734
last minute fixes
gpmayorga Sep 12, 2023
bc491db
Added root to the srtool container
gpmayorga Sep 13, 2023
8f0b6f1
remove old linter
gpmayorga Sep 13, 2023
203ce5e
install nightly always
gpmayorga Sep 13, 2023
9daa1e6
sccache with gcloud
gpmayorga Sep 13, 2023
5712913
testing 2 diff cache methods
gpmayorga Sep 13, 2023
c5eddae
Simplify tests workflows
gpmayorga Sep 13, 2023
ca760f8
keep improving
gpmayorga Sep 13, 2023
8b1e25f
rename sccache action
gpmayorga Sep 13, 2023
97ffd64
check if sccache running
gpmayorga Sep 13, 2023
c6b8907
typo on action.yml
gpmayorga Sep 13, 2023
e5513f4
check sccache
gpmayorga Sep 13, 2023
b38ff19
debug why sccache path can't be found
gpmayorga Sep 13, 2023
cdec32e
sccache bin fixed and new test approach
gpmayorga Sep 13, 2023
53fdc08
Add benchmarks and docs. Reorganize jobs,less code
gpmayorga Sep 13, 2023
2bc1047
Update sanity-checks.yml
gpmayorga Sep 14, 2023
10400be
fix docs build
gpmayorga Sep 14, 2023
e59c4f0
chmod on CI script
gpmayorga Sep 14, 2023
d22b947
cleanup and some fixes
gpmayorga Sep 14, 2023
2aafae3
fix benchmark-check
gpmayorga Sep 14, 2023
493b618
add cache to common job. separate benchmark check
gpmayorga Sep 14, 2023
fc74591
resolve cache issue
gpmayorga Sep 14, 2023
fdaa7f6
try sccache again
gpmayorga Sep 14, 2023
5a1a524
all options on and concurrent builds
gpmayorga Sep 14, 2023
ef53568
small fixes
gpmayorga Sep 14, 2023
ae6af34
delete docs cache and cache job
gpmayorga Sep 14, 2023
405eb8d
add docker build
gpmayorga Sep 15, 2023
21a7177
adjust machine sizes
gpmayorga Sep 15, 2023
2ddc9e4
cleanup and new codeowner path
gpmayorga Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
**/target/
ci/
.github/
scripts/
docker-compose*
18 changes: 9 additions & 9 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Centrifudge Code Owners

## Changes to .github
.github/* @mikiquantum @mustermeiszer @branan @NunoAlexandre

.github/* @mustermeiszer @branan @NunoAlexandre
.github/workflows @gpmayorga
## Changes to ci
ci/* @mikiquantum @mustermeiszer @branan @NunoAlexandre
ci/* @mustermeiszer @branan @NunoAlexandre

## Changes to the service of our chain.
node/* @mikiquantum @mustermeiszer @branan @NunoAlexandre
node/* @mustermeiszer @branan @NunoAlexandre

## Changes to chain-specs
node/res/* @mikiquantum @mustermeiszer @branan @NunoAlexandre @wischli
node/res/* @mustermeiszer @branan @NunoAlexandre @wischli

## Changes to toml files
*.toml @mikiquantum @mustermeiszer @branan @NunoAlexandre @lemunozm @wischli @cdamian @thea-leake
*.toml @mustermeiszer @branan @NunoAlexandre @lemunozm @wischli @cdamian @thea-leake

## Changes to specific pallets
pallets/liquidity-pools/* @NunoAlexandre @cdamian @wischli @mustermeiszer
Expand Down Expand Up @@ -41,9 +41,9 @@ libs/traits/src/changes.rs @lemunozm
libs/traits/src/data.rs @lemunozm

## Changes to runtime
runtime/common/* @branan @mikiquantum @mustermeiszer @NunoAlexandre @offerijns @lemunozm
runtime/altair/* @branan @mikiquantum @mustermeiszer @NunoAlexandre @offerijns @wischli
runtime/centrifuge/* @branan @mikiquantum @mustermeiszer @NunoAlexandre @offerijns @wischli
runtime/common/* @branan @mustermeiszer @NunoAlexandre @offerijns @lemunozm
runtime/altair/* @branan @mustermeiszer @NunoAlexandre @offerijns @wischli
runtime/centrifuge/* @branan @mustermeiszer @NunoAlexandre @offerijns @wischli

## Changes to integration tests
runtime/integration-tests/* @mustermeiszer @NunoAlexandre @wischli @cdamian
Expand Down
49 changes: 49 additions & 0 deletions .github/actions/prep-ubuntu/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Prepare Ubuntu for Rust builds
description: cleanup and Rust Tools setup
inputs:
RUST_TOOLCHAIN:
description: toolchain version
default: "1.66"
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 latest nightly
uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746
with:
toolchain: ${{ inputs.RUST_TOOLCHAIN }}
default: true

- name: SCcache setup
if: ${{ inputs.cache == 'enabled' }}
uses: ./.github/actions/sccache-gcloud
with:
GWIP: ${{ inputs.GWIP }}
GSA: ${{ inputs.GSA }}

- name: setup Rust sccache wrapper
if: ${{ inputs.cache == 'enabled' }}
shell: sh
run: echo "RUSTC_WRAPPER="sccache"" >> $GITHUB_ENV


40 changes: 0 additions & 40 deletions .github/workflows/benchmark-check.yml

This file was deleted.

35 changes: 17 additions & 18 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ jobs:
benchmark:
permissions:
pull-requests: write
id-token: write
name: benchmark
runs-on: ubuntu-latest-4-cores
if: ${{ startsWith(github.event.comment.body, '/benchmark ') && github.event.issue.pull_request && contains(github.event.comment.author_association, 'CONTRIBUTOR') }}
env:
RUST_TOOLCHAIN: "nightly-2022-11-14"
RUST_TOOLCHAIN: "1.66.0"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/github-script@v6
name: Parse Runtime From Comment
Expand All @@ -34,15 +36,6 @@ jobs:
body: `:clock1: Running Benchmarks for \`${{steps.parse-runtime.outputs.result}}\` :clock1:`
})
return comment.data.id
- name: Prep build on Ubuntu
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: Get PR Hash
id: get_pr_hash
uses: actions/github-script@v6
Expand All @@ -60,21 +53,27 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ steps.get_pr_hash.outputs.result }}
- name: Install latest nightly
uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746

- name: Prep build on Ubuntu
uses: ./.github/actions/prep-ubuntu
with:
RUST_TOOLCHAIN: ${{ matrix.rust_version }}

- name: SCcache setup
uses: ./.github/actions/sccache-gcloud
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
GWIP: ${{ secrets.GWIP_SCCACHE }}
GSA: ${{ secrets.GSA_SCCACHE }}

- name: Run Benchmark ${{steps.parse-runtime.outputs.result}}
run: ./ci/script.sh
env:
TARGET: benchmark
RUNTIME: ${{steps.parse-runtime.outputs.result}}
run: ./scripts/runtime_benchmarks.sh ${{steps.parse-runtime.outputs.result}}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{steps.parse-runtime.outputs.result}}-weights
path: runtime/${{steps.parse-runtime.outputs.result}}/src/weights/

- uses: actions/github-script@v6
name: Notify Benchmark finished
with:
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Docker Build
on:
push:
branches: [main, 'release-v**']
pull_request:
paths:
- ".github/workflows/build-docker.yml"
- "Dockerfile"
workflow_dispatch:

env:
RUST_TOOLCHAIN: "1.66"
jobs:
docker:
strategy:
matrix:
os: [ ubuntu-latest-4-cores ]
target: [ release, test ]
runs-on: ${{ matrix.os }}
env:
WORKFLOW_TAG: ${{ github.event.inputs.docker_tag }}
steps:

- uses: actions/checkout@v3
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 "$AGENT_TOOLSDIRECTORY"

- name: check available docker space
run: |
docker volume ls
df -h

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@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@v5
with:
images: centrifugeio/centrifuge-chain
flavor: |
prefix=${{ matrix.target == 'test' && 'test-' || '' }}
suffix=${{ env.NOW }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=sha,format=short,prefix='git-'

- name: Build and push centrifugeio/centrifuge-chain
uses: docker/build-push-action@v5
with:
context: .
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=registry,ref=centrifugeio/centrifuge-chain
# https://docs.docker.com/build/cache/backends/inline/
cache-to: inline

- name: Update DockerHub descriptions
if: contains(github.ref, 'refs/tags/release-v')
uses: peter-evans/dockerhub-description@v3
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
48 changes: 0 additions & 48 deletions .github/workflows/build-matrix.json

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/build-nix.yml

This file was deleted.

Loading