Repository navigation
add new Host API with directory + env access, update projects - #3304
Conversation
👷 Deploy request for cloak-docs pending review.Visit the deploys page to approve it
|
|
👨🏻🍳 💋 |
There was a problem hiding this comment.
Does llb.Diff + llb.Merge actually fail if you try to provide different platforms? I wouldn't have expected that but also have learned to expect the unexpected when it comes to these nitty gritty details...
There was a problem hiding this comment.
It might work, I'm just not sure how to represent it, or test it. 🤔 I've only seen platform get passed to Marshal and wasn't sure what should happen when we have multiple states turn into one.
With Diff I guess it's simpler because it's really a one-directional diff, more like "what has upper changed from lower." But with Merge I have no idea what to keep. Maybe the first? Or last?
Should I just remove this check and have it carry on with otherPlatform? And probably call it upper instead of other for clarity?
There was a problem hiding this comment.
Ah okay right, you don't have choice but to choose a value, but I agree it's not clear which one is right. Honestly feel free to just leave this as is for now. It's not causing any harm and I will think about it some more when I rebase my multiplatform PR on the new API.
There was a problem hiding this comment.
There's some existing tests that create extensions under testdata and use a cloak.yaml. You could re-use that pattern here too but just for loading a workdir rather than creating more extensions too. Just requires not using testutil.Query and instead starting up the engine directly with explicit workdir+configPath values.
Not a blocker but will need to happen sometime as the way config loading works is going to change in the near future.
There was a problem hiding this comment.
Is it possible for the runtimes to return Containers instead so that the image config (env vars and such) are maintained? It's not a huge deal but would be nice to have
There was a problem hiding this comment.
Oh good catch, I forgot Filesystem was closer to Container, will look into that now.
There was a problem hiding this comment.
I looked into this, it's definitely possible. Essentially these direct LLB calls need to turn into *core.Container calls. The upside is we'll land on a richer core.Container Go API, but the downside is it's a lot of work and it gets a bit verbose with all the extra err != nil checks.
One alternative is to stick with LLB and add some kind of NewContainer that takes a llb.State, but I think we'd need to manually fetch the image config, which doesn't seem great.
Here's the patch so far: https://gist.github.com/vito/65a4c3b513e7f3528cbc4ada8945eec8
Maybe better for a separate PR? Or is this introducing a regression without it?
There was a problem hiding this comment.
Maybe better for a separate PR? Or is this introducing a regression without it?
Yeah no need to block this one on it. There has already been some fluctuation in whether extension execution propagates the env or not, so I think most code I've seen handles the case where PATH and such isn't set right. Another brief period where it's not propagated should be okay I think.
these pretty much go hand-in-hand, since projects are loaded from local dirs Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
fixes #3201
based on #3272 - will rebase if it's merged first
This implements the new Host core API, with added support for reading/writing to multiple local directories. See
host.graphqlsfor the new schema.This also updates the Project schema/code to use the new
*core.Directoryinstead of the old*filesystem.Filesystem, with the following schema changes:@sipsma This second part probably conflicts with your work to do the same (#3259), but I couldn't complete this without it and it seemed like maybe a mutual dependency, so I kept going.