-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env tsx | ||
/** | ||
* @file like runTestImages.ts, but for a single proposal, | ||
* and with a bash entrypoint | ||
*/ | ||
import { execSync } from 'node:child_process'; | ||
import { parseArgs } from 'node:util'; | ||
import { imageNameForProposalEval, readOneProposal } from './common'; | ||
|
||
const options = { | ||
match: { short: 'm', type: 'string' }, | ||
} as const; | ||
const { values } = parseArgs({ options }); | ||
|
||
const proposal = readOneProposal(values.match!); | ||
|
||
console.log( | ||
`Starting shell of eval image for proposal ${proposal.proposalName}`, | ||
); | ||
// SLOGFILE isn't in the regular build because it's huge | ||
console.log('If you want a SLOGFILE:'); | ||
console.log(' export SLOGFILE=slog.slog'); | ||
console.log('Run the following command to start a chain:'); | ||
console.log(' agd start --log_level warn'); | ||
console.log('This gets another shell:'); | ||
console.log( | ||
' docker exec -it `docker ps --latest --format json | jq -r .Names` bash', | ||
); | ||
console.log('And within that shell:'); | ||
console.log(' cd /usr/src/proposals/"$PROPOSAL_PATH/" && ./eval.sh'); | ||
const { name } = imageNameForProposalEval(proposal); | ||
// start the chain | ||
const cmd = `docker run --mount type=bind,src=.,dst=/usr/src/a3p -it --entrypoint bash ${name}`; | ||
execSync(cmd, { stdio: 'inherit' }); |