-
Notifications
You must be signed in to change notification settings - Fork 212
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
add a CoreEval proposal to a3p-integration #8801
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.
For core evals generated in non agoric-3-proposals
repos, I would really expect the core eval material to be generated dynamically from the repo and not checked in. As such I don't understand the approach. Let's discuss.
...9205e90964d278e49039aa65db4a1f30dc44561ddab3a486075b086c12e2c60f4ef7898b0469e0298bd4dc1.json
Outdated
Show resolved
Hide resolved
a3p-integration/package.json
Outdated
@@ -12,5 +12,6 @@ | |||
"@agoric/synthetic-chain": "^0.0.4-2", | |||
"tsx": "^4.7.0" | |||
}, | |||
"packageManager": "yarn@4.0.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.
I'm concerned this will force anyone / anything running this to use corepack
. Is it even enabled in CI?
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'm concerned this will force anyone / anything running this to use corepack.
Valid concern. I adopted it to make it possible to yarn link
to a local checkout of agoric-3-proposals
. I'm open to cutting it. But I would argue that we should adopt corepack throughout our development.
Is it even enabled in CI?
prolly not. easy to solve for this job
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 adopted it to make it possible to
yarn link
to a local checkout ofagoric-3-proposals
.
I see. Technically a link
is irrespective of the package manager, as it's just a symlink in node_modules
.
Would temporarily overriding the "version" to a local path not work? Arguably this package is not part of the workspace, so my concerns are not high as long as we enable corepack in CI for this test.
I would argue that we should adopt corepack throughout our development.
Yes we should get off the yarn1 train, but that's another topic.
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.
Technically a link is irrespective of the package manager, as it's just a symlink in node_modules.
That's not how Yarn 2+ works. It uses resolutions
in package.json. agoric-3-proposals is using 2+ so it can't produce what a3p-integration with Yarn 1 is expecting. Of course I could manually create the symlink but I thought it would be good progress to bump Yarn here.
so my concerns are not high as long as we enable corepack in CI for this test
I'm hearing that as the request and agreement to maintain the Yarn version bump.
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.
FWIW, I still believe that for |
I've seen so much CI flakiness from network dependency. I agree it should be easy to source from chain history and to validate what's checked in matches that, which is Agoric/agoric-3-proposals#67 . |
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.
looks like it's getting there...
a3p-integration/package.json
Outdated
"build": "./node_modules/.bin/synthetic-chain build", | ||
"test": "./node_modules/.bin/synthetic-chain test", | ||
"doctor": "./node_modules/.bin/synthetic-chain doctor" |
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.
shouldn't plain "synthetic-chain build"
work? doesn't yarn
arrange for ./node_modules.bin
to be in $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.
It should but it doesn't due to the .ts
extensions. Another option is to use tsx
as in Agoric/agoric-3-proposals@e4c4791
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. Good to know.
a3p-integration/package.json
Outdated
@@ -12,5 +12,6 @@ | |||
"@agoric/synthetic-chain": "^0.0.4-2", | |||
"tsx": "^4.7.0" | |||
}, | |||
"packageManager": "yarn@4.0.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.
"agoricProposal": { | ||
"type": "/agoric.swingset.CoreEvalProposal", | ||
"source": "build", | ||
"buildScript": "../packages/builders/scripts/vats/restart-vats.js" |
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.
hm. cross-package reference. Did you consider supporting this sort of thing?
"buildScript": "../packages/builders/scripts/vats/restart-vats.js" | |
"buildScript": "@agoric/builders/scripts/vats/restart-vats.js" |
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'm actually confused as to which context this import is resolved in, given the ../packages
. I know the upgrade core proposal mechanism implemented by cosmic-swingset
supports the @agoric/builders
form, and it would be confusing if this type of proposal didn't.
More generally however, I'm wondering if a "resolve in the context of agoric-sdk" approach is correct for core evals. And where does the agoric-sdk even come from, the one inside the image? Consider 3rd party contracts that only depend on agoric-sdk packages through NPM installed packages, no checkout of agoric-sdk
. How should their version of a3p-integration
in their own repo resolve the build script?
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.
Right now this is just relative to where the synthetic-chain
is run, so a3p-integration
. I could do some work to make it resolves against NPM packages, but can we call that future work?
How should their version of a3p-integration in their own repo resolve the build script?
Right now it's the relative path. If we went the package resolution route, it would be the package export. But I don't think we should require them to make their build script an export from a package. It's just a file.
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.
normally you want to generate a core eval from your local repo, which may not be agoric-sdk.
Exactly. That's why I think it best to leave this to filesystem path resolution. Another repo might have a3p-integration
as its home for this tooling, or not. It'll just be somewhere in the repo. And the build script will be referenced relative to that.
Oh, maybe here's the confusion: this buildScript is executed before any Docker comes into play. It's a convention of the synthetic-chain
tooling that it builds the script and puts the output into the proposal directory, so that it's there during the image building.
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.
Oh, maybe here's the confusion: this buildScript is executed before any Docker comes into play. It's a convention of the
synthetic-chain
tooling that it builds the script and puts the output into the proposal directory, so that it's there during the image building.
Ah that's where I was confused, and yes this is the behavior I expect. In this case I am fine with relative path, they actually make more sense.
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 could do some work to make it resolves against NPM packages, but can we call that future work?
Yes.
And I'm content without an issue until motivation is more pressing.
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.
Now running into,
agoric: run: running /home/runner/work/agoric-sdk/agoric-sdk/packages/builders/scripts/vats/restart-vats.js
agoric: (Error#1)
Error#1: Cannot find package '@agoric/deploy-script-support' imported from /home/runner/work/agoric-sdk/agoric-sdk/packages/builders/scripts/vats/restart-vats.js
So it's not "just a file". I could add @agoric/deploy-script-support
to the a3p-integration package.json, but it'll surprise someone again when they depend on something else.
I think a3p-integration needs to be part of the repo workspace, so when it runs these scripts from the repo they can use anything in the repo.
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've got a commit to do that, but it runs into a new problem with https://github.com/Agoric/agoric-3-proposals/blob/main/packages/synthetic-chain/cli.ts#L53-L56
I'll mark this as Draft until I get that working in a 0.0.4-3 or later
"runModuleBehaviors": "makeCoreProposalBehavior" | ||
} | ||
} | ||
} |
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.
github flags lack of a newline at end of file here.
Do we have a shop norm?
Locally, I get a lot of spurious diffs on save for this sort of thing.
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.
We don't have .editorconfig
set up to specify line endings but I think the norm is to include them.
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.
This is just a file move of the output from agoric run
. If we want the file here to have a newline, I think the proper fix is to update upstream. (I don't think it's worth it)
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'm confused about the design goal of the core eval support in synthethic-chain. It seems to be geared towards generating core eval material from the agoric-sdk repo inside the container, but I think that is the outlier use case, and normally you want to generate a core eval from your local repo, which may not be agoric-sdk
.
I likely misunderstood something, so let's discuss.
"agoricProposal": { | ||
"type": "/agoric.swingset.CoreEvalProposal", | ||
"source": "build", | ||
"buildScript": "../packages/builders/scripts/vats/restart-vats.js" |
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'm actually confused as to which context this import is resolved in, given the ../packages
. I know the upgrade core proposal mechanism implemented by cosmic-swingset
supports the @agoric/builders
form, and it would be confusing if this type of proposal didn't.
More generally however, I'm wondering if a "resolve in the context of agoric-sdk" approach is correct for core evals. And where does the agoric-sdk even come from, the one inside the image? Consider 3rd party contracts that only depend on agoric-sdk packages through NPM installed packages, no checkout of agoric-sdk
. How should their version of a3p-integration
in their own repo resolve the build script?
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.
This looks quite helpful.
76d41d4
to
4716b1e
Compare
Integration test failing with,
That seems due to the Yarn 4.0.2 update, which can be punted so I'm removing those commits. (#8801 (comment) was by Mergify. #8801 (comment) has the fix to test) |
9c18377
to
eaaca65
Compare
Looks like we still have the same failure with older yarn |
Yep, that's what the next build shows. It's not happening for me locally because I have |
FWIW, I saw no trouble with b:restart-vats in combination with yarn 4 in the release branch context (#8819). |
In the case of 3rd party dapps, the agoric CLI would be NPM installed. I think in all cases it should be fine to assume that there is an agoric-cli in the "NPM PATH environment"
I'm wondering if the problem is that |
b147046
to
2f63cae
Compare
yarn.lock
Outdated
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 looks like we started taking on dependencies onto the published versions of agoric-sdk
packages, and different endo versions. I am very worried this will cause issues. I haven't traced the cause, but I'm wondering if we can avoid this somehow.
yarn.lock
Outdated
@@ -2686,6 +3468,50 @@ aggregate-error@^4.0.0: | |||
clean-stack "^4.0.0" | |||
indent-string "^5.0.0" | |||
|
|||
agoric@^0.22.0-u13.0: |
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 this is what is entraining all the new deps
a3p-integration/package.json
Outdated
@@ -11,6 +11,7 @@ | |||
}, | |||
"dependencies": { | |||
"@agoric/synthetic-chain": "^0.0.4-3", | |||
"agoric": "^0.22.0-u13.0", |
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.
Oh yeah, why are we depending on the published version here?
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.
aye, this was to get the version when it was in a separate workspace. I put into the SDK workspace, which makes this change unnecessary (and harmful)
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 had to revert because mixing a3p-integration into the root project ran into too many assumptions made about workspace packages
2f63cae
to
808af39
Compare
f72f70d
to
39f3b96
Compare
The `submission` dir was built using: | ||
`packages/builders/scripts/vats/restart-vats.js` | ||
|
||
UNTIL https://github.com/Agoric/agoric-3-proposals/issues/87 |
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 am extremely uncomfortable with this approach in the context of an a3p-integration
test. People will not know and forget to regenerate these bundles, which will get out of sync with the code in the repo.
At the very least, I would want CI to verify that the bundles are up to date, but then that begs the question of why CI can't generate the bundles automatically in the first place.
Is there really not a way to support a "spawn this command to generate bundles" mode? What in the local generation requires manual intervention that it can't be scripted?
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.
Sure it's possible. I understood that someone was blocked on the changes already here so I figured that can land after these other changes. But they don't actually depend on these changes so I'll drop this back into draft and make Agoric/agoric-3-proposals#87 be part of its requirements.
There's other work here that's safe to land which I've pulled out into #8839
39f3b96
to
af6474a
Compare
af6474a
to
a253c42
Compare
Current hurdle: JSON parsing failure due to extra output from Cosmos. The fix merged a couple days ago but hasn't reached our master yet. |
There's an incoming fix for that. I have a branch with the fix, but it fails on another problem (the proposal doesn't seem available when queried for deposit and voting): https://github.com/Agoric/agoric-sdk/compare/mhofman/provisioning-upgrade |
a253c42
to
39092ed
Compare
39092ed
to
f864dd3
Compare
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'm a little surprised to see the bundle checked in, but I guess that's the current state of the art?
{ | ||
"agoricProposal": { | ||
"type": "/agoric.swingset.CoreEvalProposal", | ||
"source": "subdir" |
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.
subdir? not submission?
I'm a little surprised to see the bundle checked in, but I guess that's the current state of the art?
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.
unfortunately yes
add a CoreEval proposal to a3p-integration
add a CoreEval proposal to a3p-integration
add a CoreEval proposal to a3p-integration
refs: Agoric/agoric-3-proposals#59
Description
Trunk should have a CoreEvalProposal to demonstrate how to use them in release branches.
This also serves as a validation of the changes in Agoric/agoric-3-proposals#59 that make it much simpler to write a CoreEvalProposal package
This uses an alpha release of @agoric/synthetic-chain, 0.0.4-3
I tried to get
source: buildScript
working but ran into Agoric/agoric-3-proposals#87 and decided it's better to defer.Security Considerations
n/a
Scaling Considerations
n/a
Documentation Considerations
Concern of the https://github.com/Agoric/agoric-3-proposals/ package
Testing Considerations
Punts on an actual test of restart-vats. Basically just testing that it executes.
Upgrade Considerations
n/a