-
Notifications
You must be signed in to change notification settings - Fork 19
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
Switch self-hosted runners to ubicloud github runners #1877
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
be8050c
runs-on: ubicloud
saraswatpuneet 5d017dc
runs-on: ubicloud-standard-2
saraswatpuneet 8d751fb
address feedback and fix code cov action
saraswatpuneet 0ad82f8
ubicloud-standard-4
saraswatpuneet 2f0f723
try root user
saraswatpuneet a8c63ca
try use permission on/build
saraswatpuneet e81f21e
mkdir and give permissions
saraswatpuneet f52282a
run as root
saraswatpuneet 22ddc0f
try standar-8 for code cov?
saraswatpuneet d505150
try 4 again
saraswatpuneet 20a6f11
use standard 8 for code coverage
saraswatpuneet c77da2b
run benchmarks on self hosted
saraswatpuneet 38e3a86
to prevent network issues, setting this is suggested
saraswatpuneet 9188ec3
try standard 4 for code coverage jobs
saraswatpuneet 0ad29e0
revert back to standard 8 for code coverage
saraswatpuneet 31261af
Touch rust file to test rust flows
wilwade 6ab24cf
Enable retry instead of git-fetch-with-cli
wilwade a336077
Are required packages actually required?
wilwade 369491c
Upgrade srtool to use image 1.77.0
wilwade deaca70
Unused workflow
wilwade 6a21aad
Switch e2e tests to use ubicloud
wilwade ff9e9c7
Tweaking what runs on what power runner
wilwade 1a8c72f
srtool action instead of using srtool-cli
wilwade 23bc711
runtime_dir
wilwade 1c86a3f
runtime-dir
wilwade 9d2fd98
Set the srtool job id
wilwade 1a01e0a
Merge remote-tracking branch 'origin/main' into ubicloud
wilwade 0b3ce58
Testing workflow
wilwade 0a11459
Setting GHA permissions to write to create release and release branch
wilwade 8a746a5
Remove custom base image where not needed
wilwade 1dd8296
Add arch back in
wilwade d2916bc
Revert "Testing workflow"
wilwade 0f8af34
Remove unneeded comment
wilwade 16e79cc
Remove unneeded ci image use
wilwade 1c5a338
Switch around CI power levels
wilwade 93dd3ba
16 is the max
wilwade 6d2915e
Revert "Switch around CI power levels"
wilwade 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 |
---|---|---|
|
@@ -41,3 +41,6 @@ rustflags = [ | |
"-Dclippy::unwrap_used", | ||
"-Dclippy::expect_used", | ||
] | ||
|
||
[net] | ||
retry = 5 | ||
43 changes: 0 additions & 43 deletions
43
.github/workflows/common/reset-self-hosted-runner/action.yml
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,234 @@ | ||
# This is a copy of the action file from https://github.com/chevdor/srtool-actions/blob/48e9baed50ca414936dfac59d34d8b9bbe581abd/action.yml | ||
# It is pulled in and modified for the following reasons: | ||
# 1. We needed to add an additional environment variable to the docker run (CARGO_NET_RETRY=10) | ||
# 2. Local for direct auditing of the action building the runtime | ||
|
||
name: "Srtool" | ||
description: "Build WASM Runtime with SRTOOL" | ||
author: chevdor | ||
branding: | ||
icon: "package" | ||
color: "blue" | ||
|
||
inputs: | ||
chain: | ||
description: > | ||
Name of the chain, ie. polkadot | ||
required: true | ||
|
||
package: | ||
description: > | ||
Runtime package to build, ie. polkadot-runtime. | ||
If your runtime follows this pattern, you don't have and should not provide this input. | ||
|
||
If not provided, it will be set to <chain>-runtime | ||
required: false | ||
|
||
image: | ||
description: > | ||
You can use an alternate image, use with caution! | ||
default: "paritytech/srtool" | ||
required: true | ||
|
||
tag: | ||
description: > | ||
Tag of the srtool image to use. Omit to use the latest (recommended) | ||
required: false | ||
|
||
workdir: | ||
description: > | ||
Path of the project, this is where your main Cargo.toml is located. This is relative to $GITHUB_WORKSPACE. | ||
default: "." | ||
required: false | ||
|
||
runtime_dir: | ||
description: > | ||
Location of the runtime in your repo. The default is 'runtime/<chain_name>' | ||
required: false | ||
|
||
profile: | ||
description: > | ||
Which profile to use with cargo build. | ||
required: false | ||
default: "release" | ||
|
||
outputs: | ||
json: | ||
description: > | ||
The full json output of srtool. If you need more information than this action provides by default, | ||
you can use this json output and extract some content using 'jq'. | ||
value: ${{ steps.build.outputs.json }} | ||
|
||
proposal_hash: | ||
description: The proposal hash as it will show on-chain | ||
value: ${{ steps.build.outputs.proposal_hash }} | ||
|
||
version: | ||
description: The version of srtool | ||
value: ${{ steps.build.outputs.version }} | ||
|
||
info: | ||
description: Some information from srtool about the current project | ||
value: ${{ steps.build.outputs.info }} | ||
|
||
ipfs: | ||
description: ipfs hash | ||
value: ${{ steps.build.outputs.ipfs }} | ||
|
||
wasm: | ||
description: Path of the produced compact runtime | ||
value: ${{ steps.build.outputs.wasm }} | ||
|
||
wasm_compressed: | ||
description: Path of the produced compressed runtime | ||
value: ${{ steps.build.outputs.wasm_compressed }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: check_latest_srtool | ||
name: Check the version of the latest srtool | ||
shell: bash | ||
run: | | ||
echo ::group::Inputs | ||
echo "- image: ${{ inputs.image }}" | ||
echo "- chain: ${{ inputs.chain }}" | ||
echo ::endgroup:: | ||
|
||
RUSTC_VERSION_URL=https://raw.githubusercontent.com/${{ inputs.image }}/master/RUSTC_VERSION | ||
echo Fetching RUSTC_VERSION from $RUSTC_VERSION_URL | ||
RUSTC_VERSION=`curl -s $RUSTC_VERSION_URL` | ||
|
||
SRTOOL_VERSION_URL=https://raw.githubusercontent.com/${{ inputs.image }}/master/VERSION | ||
echo Fetching SRTOOL_VERSION from $SRTOOL_VERSION_URL | ||
SRTOOL_VERSION=`curl -s $SRTOOL_VERSION_URL` | ||
|
||
echo "RUSTC_VERSION=$RUSTC_VERSION" >> $GITHUB_ENV | ||
echo "SRTOOL_VERSION=$SRTOOL_VERSION" >> $GITHUB_ENV | ||
echo "SRTOOL_LATEST=$RUSTC_VERSION" >> $GITHUB_ENV | ||
|
||
- id: env_setup | ||
name: Setting Env | ||
shell: bash | ||
run: | | ||
echo ::group::Debug | ||
echo "RUSTC_VERSION=$RUSTC_VERSION" | ||
echo "SRTOOL_VERSION=$SRTOOL_VERSION" | ||
echo "SRTOOL_LATEST=$RUSTC_VERSION" | ||
echo ::endgroup:: | ||
|
||
echo ::group::Environment setup | ||
SRTOOL_TAG=${{ inputs.tag || env.SRTOOL_LATEST }} | ||
echo "SRTOOL_TAG=$SRTOOL_TAG" >> $GITHUB_ENV | ||
echo "SRTOOL_IMAGE=${{ inputs.image }}:$SRTOOL_TAG" >> $GITHUB_ENV | ||
echo "WORKDIR=${{ github.workspace }}/${{ inputs.workdir }}" >> $GITHUB_ENV | ||
|
||
RUNTIME_DIR=${{ inputs.runtime_dir }} | ||
RUNTIME_DIR=${RUNTIME_DIR:-'runtime/'${{ inputs.chain }}} | ||
echo "RUNTIME_DIR=$RUNTIME_DIR" >> $GITHUB_ENV | ||
|
||
PACKAGE=${{ inputs.package }} | ||
PACKAGE=${PACKAGE:-${{ inputs.chain }}'-runtime'} | ||
echo "PACKAGE=$PACKAGE" >> $GITHUB_ENV | ||
|
||
echo "BUILD_OPTS=${{ env.BUILD_OPTS }}" >> $GITHUB_ENV | ||
|
||
PROFILE=${{ inputs.profile }} | ||
echo "PROFILE=$PROFILE" >> $GITHUB_ENV | ||
|
||
PARACHAIN_PALLET_ID=${{ env.PARACHAIN_PALLET_ID }} | ||
PARACHAIN_PALLET_ID=${PARACHAIN_PALLET_ID:-0x01} | ||
AUTHORIZE_UPGRADE_PREFIX=${{ env.AUTHORIZE_UPGRADE_PREFIX }} | ||
AUTHORIZE_UPGRADE_PREFIX=${AUTHORIZE_UPGRADE_PREFIX:-0x02} | ||
echo "PARACHAIN_PALLET_ID=$PARACHAIN_PALLET_ID" >> $GITHUB_ENV | ||
echo "AUTHORIZE_UPGRADE_PREFIX=$AUTHORIZE_UPGRADE_PREFIX" >> $GITHUB_ENV | ||
|
||
echo ::endgroup:: | ||
|
||
- id: env_check | ||
name: Checking Env | ||
shell: bash | ||
run: | | ||
echo ::group::Environment check | ||
|
||
echo ℹ️ SRTOOL_LATEST: ${{ env.SRTOOL_LATEST }} | ||
echo ℹ️ image: ${{ env.SRTOOL_IMAGE }} | ||
echo ℹ️ chain: ${{ inputs.chain }} | ||
echo ℹ️ package: ${{ env.PACKAGE }} | ||
echo ℹ️ Github Workspace: ${{ github.workspace }} | ||
echo ℹ️ workdir: ${{ env.WORKDIR }} | ||
echo ℹ️ runtime_dir: ${{ env.RUNTIME_DIR }} | ||
echo ℹ️ build_opts: ${{ env.BUILD_OPTS }} | ||
echo ℹ️ parachain_pallet_id: ${{ env.PARACHAIN_PALLET_ID }} | ||
echo ℹ️ profile: ${{ env.PROFILE }} | ||
echo ℹ️ authorize_upgrade_prefix: ${{ env.AUTHORIZE_UPGRADE_PREFIX }} | ||
echo ℹ️ .git folder: `ls -ald ${{ env.WORKDIR }}/.git` | ||
echo ℹ️ Cargo.toml: `ls -al ${{ env.WORKDIR }}/Cargo.toml` | ||
|
||
echo ::endgroup:: | ||
|
||
- id: pulling_srtool | ||
name: Build ${{ env.PACKAGE }} using ${{ env.SRTOOL_IMAGE }} | ||
shell: bash | ||
run: | | ||
echo ::group::Pulling the srtool docker image: ${{ env.SRTOOL_IMAGE }} | ||
docker pull ${{ env.SRTOOL_IMAGE }} | ||
echo ::endgroup:: | ||
|
||
- id: version | ||
shell: bash | ||
run: | | ||
echo ::group::Srtool version | ||
CMD="docker run -i --rm -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE }} version -cM" | ||
JSON=`$CMD` | ||
echo $JSON | jq . | ||
echo "version=$JSON" >> $GITHUB_OUTPUT | ||
echo ::endgroup:: | ||
|
||
- id: info | ||
shell: bash | ||
run: | | ||
echo ::group::srtool info | ||
CMD="docker run -i --rm -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE }} info -cM" | ||
JSON=`$CMD` | ||
echo $JSON | jq . | ||
echo "info=$JSON" >> $GITHUB_OUTPUT | ||
echo ::endgroup:: | ||
|
||
- id: build | ||
name: Build ${{ env.PACKAGE }} using ${{ env.SRTOOL_IMAGE }} | ||
shell: bash | ||
env: | ||
# https://github.com/paritytech/polkadot-sdk/pull/2217 | ||
WASM_BUILD_STD: "0" | ||
run: | | ||
echo ::group::Srtool build of chain ${{ inputs.chain }} | ||
CMD="docker run -i --rm -e CARGO_NET_RETRY=10 -e PACKAGE=${{ env.PACKAGE }} -e RUNTIME_DIR=${{ env.RUNTIME_DIR }} -e BUILD_OPTS -e | ||
PARACHAIN_PALLET_ID -e AUTHORIZE_UPGRADE_PREFIX -e PROFILE -e WASM_BUILD_STD -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE | ||
}} build --app --json -cM" | ||
|
||
echo ::debug::build::docker_run $CMD | ||
# here we keep streaming the progress and fetch the last line for the json result | ||
stdbuf -oL $CMD | { | ||
while IFS= read -r line | ||
do | ||
echo ║ $line | ||
JSON="$line" | ||
done | ||
|
||
echo "json=$JSON" >> $GITHUB_OUTPUT | ||
echo $JSON | jq . | ||
|
||
PROP=`echo $JSON | jq -r .runtimes.compact.prop` | ||
echo "proposal_hash=$PROP" >> $GITHUB_OUTPUT | ||
|
||
WASM=`echo $JSON | jq -r .runtimes.compact.wasm` | ||
echo "wasm=$WASM" >> $GITHUB_OUTPUT | ||
|
||
Z_WASM=`echo $JSON | jq -r .runtimes.compressed.wasm` | ||
echo "wasm_compressed=$Z_WASM" >> $GITHUB_OUTPUT | ||
|
||
IPFS=`echo $JSON | jq -r .runtimes.compact.ipfs` | ||
echo "ipfs=$IPFS" >> $GITHUB_OUTPUT | ||
} | ||
echo ::endgroup:: |
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 |
---|---|---|
|
@@ -12,7 +12,6 @@ jobs: | |
changes: | ||
name: Determine Changed Files | ||
runs-on: ubuntu-22.04 | ||
container: ghcr.io/libertydsnp/frequency/ci-base-image:latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll see a lot of places where I removed the use of the ci-base-image. It really is only needed for things that use rust. |
||
outputs: | ||
ci-base-image: ${{steps.filter.outputs.ci-base-image}} | ||
steps: | ||
|
@@ -28,7 +27,7 @@ jobs: | |
|
||
publish-js-api-augment-rc: | ||
name: Merge - Publish JS API Augment Release Candidate | ||
runs-on: [self-hosted, Linux, X64, build, v2] | ||
runs-on: ubicloud-standard-4 | ||
container: ghcr.io/libertydsnp/frequency/ci-base-image:latest | ||
steps: | ||
- name: Check Out Repo | ||
|
@@ -65,7 +64,7 @@ jobs: | |
|
||
calc-code-coverage: | ||
name: Merge - Calculate Code Coverage | ||
runs-on: [self-hosted, Linux, X64, build, v2] | ||
runs-on: ubicloud-standard-8 | ||
saraswatpuneet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
container: ghcr.io/libertydsnp/frequency/ci-base-image:latest | ||
steps: | ||
- name: Check Out Repo | ||
|
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.
Needed due to the location of the ubicloud runners