This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[CI] Expose WASM binaries on publish #1093
Merged
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
19dfc0f
add build-wasm-release CI job
s3krit 86bc723
temporarily run build-wasm-release everywhere
s3krit e387a82
Merge branch 'master' into mp-expose-wasm-binaries
s3krit 516e075
temporary job to inspect artifacts dir
s3krit fcce1b4
fix test job
s3krit 7f73850
fix test job again
s3krit 54af85f
remove temporary job
s3krit fbb1e1e
remove FIXME for when to run jobs
s3krit 799fdc6
remove pointless echo
s3krit f3757cf
Change cargo build for wasm-pack
s3krit 1d1882c
Checksum polkadot_cli files
s3krit c336193
make separate wasm dir for artifacts
s3krit 47acecb
fix nits
s3krit 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 hidden or 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 |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ | |
| # pipelines can be triggered manually in the web | ||
| # setting DEPLOY_TAG will only deploy the tagged image | ||
|
|
||
|
|
||
| stages: | ||
| - test | ||
| - build | ||
|
|
@@ -23,7 +22,6 @@ variables: | |
| DOCKER_OS: "debian:stretch" | ||
| ARCH: "x86_64" | ||
|
|
||
|
|
||
| .collect-artifacts: &collect-artifacts | ||
| artifacts: | ||
| name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" | ||
|
|
@@ -56,8 +54,6 @@ variables: | |
| - cargo --version | ||
| - sccache -s | ||
|
|
||
|
|
||
|
|
||
| .build-refs: &build-refs | ||
| only: | ||
| - master | ||
|
|
@@ -100,7 +96,6 @@ check-runtime: | |
| interruptible: true | ||
| allow_failure: true | ||
|
|
||
|
|
||
| check-line-width: | ||
| stage: test | ||
| image: parity/tools:latest | ||
|
|
@@ -138,7 +133,6 @@ test-linux-stable: &test | |
| - time cargo test --all --release --verbose --locked --features runtime-benchmarks | ||
| - sccache -s | ||
|
|
||
|
|
||
| check-web-wasm: &test | ||
| stage: test | ||
| <<: *test-refs | ||
|
|
@@ -167,6 +161,21 @@ check-runtime-benchmarks: &test | |
| - time cargo check --features runtime-benchmarks | ||
| - sccache -s | ||
|
|
||
| build-wasm-release: | ||
| stage: build | ||
| <<: *collect-artifacts | ||
| <<: *docker-env | ||
| <<: *compiler_info | ||
| # Note: We likely only want to do this for tagged releases, hence the 'only:' | ||
| only: | ||
| - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 | ||
| script: | ||
| - time cargo build --locked --target=wasm32-unknown-unknown --manifest-path cli/Cargo.toml --no-default-features --features browser --release | ||
| - mkdir -p ./artifacts | ||
| - mv ./target/wasm32-unknown-unknown/release/polkadot_cli.wasm ./artifacts/. | ||
| - sha256sum ./artifacts/polkadot_cli.wasm | | ||
| tee ./artifacts/polkadot_cli.wasm.sha256 | ||
| - echo "Polkadot version = ${VERSION} (EXTRATAG ${EXTRATAG})" | ||
s3krit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| build-linux-release: &build | ||
| stage: build | ||
|
|
@@ -193,13 +202,11 @@ build-linux-release: &build | |
| - cp -r scripts/docker/* ./artifacts | ||
| - sccache -s | ||
|
|
||
|
|
||
|
|
||
|
|
||
| .publish-build: &publish-build | ||
| stage: publish | ||
| dependencies: | ||
| - build-linux-release | ||
| - build-wasm-release | ||
|
Contributor
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. can artifacts be fetched that way from two different jobs which ran in parallel before?
Contributor
Author
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. Yep, wasn't sure about this myself so I made a test job to verify it: https://gitlab.parity.io/parity/polkadot/-/jobs/507196
Contributor
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. nice job! |
||
| cache: {} | ||
| <<: *build-refs | ||
| <<: *kubernetes-env | ||
|
|
@@ -210,9 +217,6 @@ build-linux-release: &build | |
| - EXTRATAG="$(cat ./artifacts/EXTRATAG)" | ||
| - echo "Polkadot version = ${VERSION} (EXTRATAG ${EXTRATAG})" | ||
|
|
||
|
|
||
|
|
||
|
|
||
| publish-docker-release: | ||
| <<: *publish-build | ||
| image: docker:stable | ||
|
|
@@ -243,9 +247,6 @@ publish-docker-release: | |
| # only VERSION information is needed for the deployment | ||
| - find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete | ||
|
|
||
|
|
||
|
|
||
|
|
||
| publish-s3-release: | ||
| <<: *publish-build | ||
| image: parity/awscli:latest | ||
|
|
@@ -276,12 +277,6 @@ publish-s3-release: | |
| - aws s3 ls s3://${BUCKET}/${PREFIX}/${EXTRATAG}/ | ||
| --recursive --human-readable --summarize | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| deploy-polkasync-kusama: | ||
| stage: deploy | ||
| <<: *build-refs | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I'd like to have @expenses's eyes too. Her command was using wasm-pack (see https://github.com/paritytech/devops/issues/401#issuecomment-577231023), and it generates, apart from the .wasm file, some .js/.d.ts glue code.
I'm also not 100% sure if I need to update on my side the .js glue code each time the .wasm file changes or not. If yes, I think they would need to be part of the artifacts too.
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.
Yeah, we need the glue code to be generated with the wasm binary, because the function mangling a lot. We should probably be calling
wasm-packand notcargo build+wasm-bindgenhere, if possible.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.
Ok cool cheers. I'll move this back into draft and sort that
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.
If there are more than 3-4 files, a .zip might be easier.
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.
I think better to have the files unzipped and in a directory of their own :) Current code puts them in a directory called 'wasm', which will be available from our s3 bucket on each release. Obviously we'll have to wait for a release to trigger this :) ready for review again now