-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(a3p-integration): Document and clean up core-eval generation (…
…#10466) ## Description Resolving some confusion I experienced while debugging #10165 and working on #10446. * refactor build-submission.sh to be working-directory-aware and accept an arbitrary number of additional arguments * document build-submission.sh w.r.t. package.json "agoricProposal" * document build-all-submissions.sh w.r.t. `./proposals?:*` * add explanatory output to build-all-submissions.sh * explain all of the above in the README ### Security Considerations None known. ### Scaling Considerations n/a ### Documentation Considerations Included in the README and shell scripts. ### Testing Considerations These scripts are covered by integration testing. ### Upgrade Considerations None known; a3p-integration should be self-contained.
- Loading branch information
Showing
4 changed files
with
57 additions
and
34 deletions.
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
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
set -ueo pipefail | ||
|
||
# Convenience script to debug the current proposal being worked on. | ||
|
||
scripts/build-submission.sh proposals/z:acceptance testing/start-valueVow.js start-valueVow | ||
scripts/build-submission.sh proposals/z:acceptance testing/restart-valueVow.js restart-valueVow | ||
( | ||
cd 'proposals/z:acceptance' | ||
../../scripts/build-submission.sh testing/start-valueVow.js start-valueVow | ||
../../scripts/build-submission.sh testing/restart-valueVow.js restart-valueVow | ||
) | ||
|
||
yarn test -m acceptance --debug |
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 |
---|---|---|
@@ -1,17 +1,24 @@ | ||
#!/bin/bash | ||
set -ueo pipefail | ||
|
||
# cd prints its target, so without the redirect, we get two copies | ||
SCRIPT_DIR=$(cd ${0%/*} > /dev/null && pwd -P) | ||
# Look in the "proposals" subdirectory of the working directory for | ||
# "$char:$name" subdirectories (cf. ../README.md#package-layering), and for each | ||
# one, extract from its package.json "agoricProposal" section a list of | ||
# "sdk-generate" entries corresponding to core-eval submission content that must | ||
# be generated (cf ../README.md#generating-core-eval-submissions) and then use | ||
# ./build-submission.sh to do so. | ||
|
||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) | ||
|
||
IFS=$'\n' | ||
|
||
for proposal in ./proposals/?:*; do | ||
echo >&2 "Building $proposal ..." | ||
cd $proposal | ||
# build submission if proposal specifies an sdk-generate | ||
while read -r line; do | ||
IFS=' ' parts=($line) | ||
$SCRIPT_DIR/build-submission.sh $proposal ${parts[@]} | ||
"$SCRIPT_DIR"/build-submission.sh ${parts[@]} | ||
done < <(jq -r '.agoricProposal["sdk-generate"][]?' < package.json) | ||
cd - | ||
echo >&2 "Built $proposal" | ||
done |
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 |
---|---|---|
@@ -1,23 +1,34 @@ | ||
#!/bin/bash | ||
set -ueo pipefail | ||
|
||
sdkroot=$(git rev-parse --show-toplevel) | ||
# Usage: $0 <builder script> [submission directory name] [builder script arg]... | ||
# Run the specified builder script from packages/builders/scripts and move the | ||
# output into the specified submission directory (defaulting to "submission") | ||
# relative to the working directory. | ||
# Must be run from inside agoric-sdk. | ||
|
||
cd "$sdkroot" | ||
builderScript=$1 | ||
shift | ||
submissionDir=${1:-submission} | ||
shift || true | ||
|
||
a3pProposalDir=$1 | ||
builderScript=$2 | ||
submissionDirName=${3:-submission} | ||
submissionDir="./a3p-integration/$a3pProposalDir/$submissionDirName" | ||
extraParams=${4:-} | ||
# Run the builder script in a subshell at agoric-sdk. | ||
sdkroot=$(git rev-parse --show-toplevel) | ||
( | ||
cd "$sdkroot" | ||
yarn agoric run "packages/builders/scripts/$builderScript" "$@" | ||
) | ||
|
||
yarn agoric run "packages/builders/scripts/$builderScript" $extraParams | ||
# Create and populate the submission directory. | ||
mkdir -p "$submissionDir" | ||
echo >&2 "Populating $(basename -- "$(pwd -P)")/$submissionDir ..." | ||
ls "$sdkroot"/*-plan.json | while read plan; do | ||
# Copy from the bundle cache. | ||
cp $(grep -oh '/.*b1-.*.json' "$plan") "$submissionDir" | ||
|
||
# Move from the root directory. | ||
prefix=${plan%-plan.json} | ||
mv "$prefix"* "$submissionDir" | ||
|
||
plans=*-plan.json | ||
for plan in $plans; do | ||
base=${plan%-plan.json} | ||
cp $(grep -oh '/.*b1-.*.json' "$base"-plan.json) "$submissionDir" | ||
mv "$base"* "$submissionDir" | ||
ls -oS "$submissionDir" | ||
done |