Skip to content

Commit

Permalink
[ci] Change storage type for forklift in GHA (#4850)
Browse files Browse the repository at this point in the history
PR changes forklift authentication to gcs

cc paritytech/ci_cd#987
  • Loading branch information
alvicsam authored Jun 21, 2024
1 parent a23abb1 commit b301218
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 41 deletions.
33 changes: 33 additions & 0 deletions .forklift/config-gitlab.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[compression]
type = "zstd"

[compression.zstd]
compressionLevel = 3

[general]
jobNameVariable = "CI_JOB_NAME"
jobsBlackList = []
logLevel = "warn"
threadsCount = 6

[cache]
extraEnv = ["RUNTIME_METADATA_HASH"]

[metrics]
enabled = true
pushEndpoint = "placeholder"

[metrics.extraLabels]
environment = "production"
job_name = "$CI_JOB_NAME"
project_name = "$CI_PROJECT_PATH"

[storage]
type = "s3"

[storage.s3]
accessKeyId = "placeholder"
bucketName = "placeholder"
concurrency = 10
endpointUrl = "placeholder"
secretAccessKey = "placeholder"
10 changes: 3 additions & 7 deletions .forklift/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ job_name = "$CI_JOB_NAME"
project_name = "$CI_PROJECT_PATH"

[storage]
type = "s3"
type = "gcs"

[storage.s3]
accessKeyId = "placeholder"
bucketName = "placeholder"
concurrency = 10
endpointUrl = "placeholder"
secretAccessKey = "placeholder"
[storage.gcs]
bucketName = "parity-ci-forklift"
2 changes: 2 additions & 0 deletions .github/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rules:
- ^\.gitlab/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
- ^\.forklift/.*
exclude:
- ^\.gitlab/pipeline/zombienet.*
type: "or"
Expand All @@ -33,6 +34,7 @@ rules:
- ^docker/.*
- ^\.github/.*
- ^\.gitlab/.*
- ^\.forklift/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
minApprovals: 2
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/check-runtime-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }}
FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }}
FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }}
FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }}
FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }}

jobs:
set-image:
# GitHub Actions allows using 'env' in a container context.
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/tests-linux-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }}
FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }}
FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }}
FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }}
FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }}

jobs:

changes:
permissions:
pull-requests: read
Expand All @@ -31,7 +23,7 @@ jobs:
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
needs: changes
if: ${{ needs.changes.outputs.rust }}
if: ${{ needs.changes.outputs.rust }}
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
Expand All @@ -40,10 +32,10 @@ jobs:
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT

test-linux-stable-int:
needs: [set-image, changes]
if: ${{ needs.changes.outputs.rust }}
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
container:
Expand All @@ -60,11 +52,11 @@ jobs:
uses: actions/checkout@v4
- name: script
run: WASM_BUILD_NO_COLOR=1 time forklift cargo test -p staging-node-cli --release --locked -- --ignored

# https://github.com/paritytech/ci_cd/issues/864
test-linux-stable-runtime-benchmarks:
needs: [set-image, changes]
if: ${{ needs.changes.outputs.rust }}
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
container:
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }}
FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }}
FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }}
FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }}
FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }}

jobs:

changes:
permissions:
pull-requests: read
Expand All @@ -40,7 +32,7 @@ jobs:

quick-benchmarks:
needs: [set-image, changes]
if: ${{ needs.changes.outputs.rust }}
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
container:
Expand All @@ -55,11 +47,11 @@ jobs:
uses: actions/checkout@v4
- name: script
run: time forklift cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet

# cf https://github.com/paritytech/polkadot-sdk/issues/1652
test-syscalls:
needs: [set-image, changes]
if: ${{ needs.changes.outputs.rust }}
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
container:
Expand All @@ -81,10 +73,10 @@ jobs:
# - if [[ "$CI_JOB_STATUS" == "failed" ]]; then
# printf "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update polkadot/scripts/list-syscalls/*-worker-syscalls as needed.\n";
# fi

cargo-check-all-benches:
needs: [set-image, changes]
if: ${{ needs.changes.outputs.rust }}
if: ${{ needs.changes.outputs.rust }}
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
container:
Expand Down
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ default:
.forklift-cache:
before_script:
- mkdir ~/.forklift
- cp .forklift/config.toml ~/.forklift/config.toml
- cp .forklift/config-gitlab.toml ~/.forklift/config.toml
- cat .forklift/config-gitlab.toml > .forklift/config.toml
- >
if [ "$FORKLIFT_BYPASS" != "true" ]; then
echo "FORKLIFT_BYPASS not set";
Expand Down

0 comments on commit b301218

Please sign in to comment.