-
Notifications
You must be signed in to change notification settings - Fork 47
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
chore: publish metadata as gitlab artifact #459
Conversation
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.
As far as I can see this is definitely good. But I cannot get the SDK to use this properly inside the augment-api
package. @rflechtner do you have any insights into how we could use this directly instead of pulling the metadata from a running node?
.maintain/s3-upload.sh
Outdated
aws configure set region eu-central-1 | ||
|
||
if [[ "$1" == "spiritnet" ]]; then | ||
aws s3 cp /tmp/spiritnet-metadata.json s3://$S3_BUCKET/spiritnet/$2/ |
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.
Can we just use the value of "$1" as part of the path?
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.
already added $1 == spiritnet
Probably scope of a different PR, but subwasm also allows to run diffs between two metadata. We can discuss what is the best strategy to execute those checks, but I would say that running it when a PR is merged into |
This is expected metadata as json https://kilt-protocol.org/peregrine/peregrine-metadata.json |
The augment-api script expects the result of the
Doesn't really work for me though rn, but that does seem to do the trick:
|
I assume subwasm also has a binary export format for the metadata if you're passing the --json flag? That could be just what we need. Should we try uploading that?
But in the JSON file we've got the keys |
I have been playing on the rust server with the latest version of subwasm, and I also get a JSON with a single |
Asked this on StackExchange as well: https://substrate.stackexchange.com/questions/6988/how-to-generate-augmented-types-from-v14-metadata-generated-with-subwasm |
Another related StackExchange issue: polkadot-js/api#4293 |
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.
it might be enough if we have them as an artifact. Not sure if we need to upload them to s3. Gitlab also stores them for a while.
https://github.com/chevdor/subwasm/releases/tag/v0.19.0 contains the needed functionality to output all kinds of metadata formats. Especially there is |
@trusch so as a quick recap, does |
@ntn-x2 the format flag just specifies the format, but there is now also a --output flag where you can specify a file. It's not possible to output two different formats at the same time, but running the command is fast enough to do it two times. The diff subcommand was not changed since the last release. |
@trusch thanks for the clarifications. I would say that we can update this PR to export the new format so that the SDK can use it. We will tackle metadata diffs in a separate ticket. |
.gitlab-ci.yml
Outdated
image: amazon/aws-cli:2.9.18 | ||
script: | ||
- aws configure set region $AWS_DEFAULT_REGION | ||
- aws s3 cp /out/peregrine-metadata.json s3://$S3_BUCKET/peregrine/${CI_COMMIT_TAG}/ |
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.
@ggera as far as I know, CI_COMMIT_TAG
could be empty if the job was simply triggered by a commit push. Would it make sense to have the same logic we have for Docker image tagging? Or maybe push something like <branch-commit>
if a regular push and <tag>
if a tag.
I pushed a new change with the new format for subwasm, but we still need to wait for a new SRtool release that includes the new subwasm 0.19. |
Tracking PR: paritytech/srtool#60 |
The artifacts only include |
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.
Should be good enough! Let's give it a try!
Reverts #459 Reverts until stable toolchain supporter
Reverts KILTprotocol/kilt-node#459 Reverts until stable toolchain supporter
fixes KILTProtocol/ticket#2241
Generates metadata and publishes json value to s3 bucket
Sample here https://kilt-protocol.org/peregrine/peregrine-metadata.json
Pending
json+scale
output format. PR: chore: update subwasm dependency to 0.19 paritytech/srtool#60