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

8868 gen submissions #9009

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
8 changes: 7 additions & 1 deletion a3p-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ make -C ../packages/deployment docker-build-sdk

## Generating core-eval submissions

Some core-eval proposals `submission` content are generated from the `agoric-sdk` code, and must be rebuilt every time there is a change. The `/scripts/generate-a3p-submission.sh` script contains commands to generate the core-eval content and move it to the expected proposal package's `submission` folder. It is executed as part of `a3p-integration`'s `build:submission` step.
Some core-eval proposals `submission` content are generated from the `agoric-sdk`
code, and must be rebuilt every time there is a change. The
`/scripts/generate-a3p-submission.sh` script contains commands to generate the
core-eval content and move it to the expected proposal package's `submission`
folder. It is executed as part of `a3p-integration`'s `build:submission` step.
Each proposal should add a `build:submission` rule in its package.json to
specify the details of proposals that require a build step.

## Building synthetic-chain images

Expand Down
2 changes: 1 addition & 1 deletion a3p-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "yarn run build:sdk && yarn run build:submission && yarn run build:synthetic-chain",
"build:sdk": "make -C ../packages/deployment docker-build-sdk",
"build:submission": "../scripts/generate-a3p-submission.sh",
"build:submission": "../scripts/generate-a3p-submission-dirs.sh",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: plural

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

"build:synthetic-chain": "yarn synthetic-chain build",
"test": "yarn synthetic-chain test",
"doctor": "yarn synthetic-chain doctor"
Expand Down
3 changes: 2 additions & 1 deletion a3p-integration/proposals/a:upgrade-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
]
},
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops",
"build:submission": "../../../scripts/generate-a3p-submission.sh probe-zcf-bundle a:upgrade-next probeZcfBundle probe-submission"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the proposal package must not take a dependency on SDK scripts.

What you could do instead is put these params into agoricProposal and have the top-level script read those to know what to build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's another try. It required extra escaping because of directory names containing dashes.

},
"packageManager": "yarn@4.1.0"
}
4 changes: 3 additions & 1 deletion a3p-integration/proposals/b:localchain/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
CoreEvalProposal to install vat-localchain

The `submission` for the proposal is automatically generated during `yarn build` in `a3p-integration` using the code in agoric-sdk through `script/generate-a3p-submission.sh`.
The `submission` for the proposal is automatically generated during `yarn build`
in `a3p-integration` using the code in agoric-sdk through
`script/generate-a3p-submission-dirs.sh`. and `script/generate-a3p-submission.sh`
3 changes: 3 additions & 0 deletions a3p-integration/proposals/b:localchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
"!submission"
]
},
"scripts": {
"build:submission": "../../../scripts/generate-a3p-submission.sh test-localchain b:localchain"
},
"packageManager": "yarn@4.1.0"
}
9 changes: 9 additions & 0 deletions scripts/generate-a3p-submission-dirs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ueo pipefail

for proposal in ./proposals/?:*
do
cd $proposal
yarn run build:submission
cd -
done
23 changes: 9 additions & 14 deletions scripts/generate-a3p-submission.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ sdkroot=$(cd -- "$(dirname "$0")/.." >/dev/null && pwd)

cd "$sdkroot"

buildSubmission() {
proposalName=$1
a3pProposal=$2
output=${3:-$proposalName}
submissionName=${4:-submission}
proposalName=$1
a3pProposal=$2
output=${3:-$proposalName}
submissionName=${4:-submission}

yarn agoric run "packages/builders/scripts/vats/$proposalName.js"
yarn agoric run "packages/builders/scripts/vats/$proposalName.js"

submissionDir="a3p-integration/proposals/$a3pProposal/$submissionName"
mkdir -p "$submissionDir"
cp $(grep -oh '/.*b1-.*.json' "$output"*) "$submissionDir"

submissionDir="a3p-integration/proposals/$a3pProposal/$submissionName"
mkdir -p "$submissionDir"
cp $(grep -oh '/.*b1-.*.json' "$output"*) "$submissionDir"
mv "$output"* "$submissionDir"
}

buildSubmission probe-zcf-bundle "a:upgrade-next" probeZcfBundle probe-submission
buildSubmission test-localchain "b:localchain"
mv "$output"* "$submissionDir"
Loading