Proposal for new core API#163
Conversation
4e1084b to
13ccbe7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
5d708f9 to
6bc05f7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Left comments on bigger things that stuck out to me. There's a lot of misc fields that could be added still (groups, supplementary groups, chroot) and fields that are missing args (i.e. cache mount options, ability to make a mount ro, etc.), but they're small things that fit into the existing patterns, so can save that for later.
Overall LGTM to though, my comments are pretty minor at this point. Having all the withX be in Container rather than Exec makes sense to me and I like that it, for instance, allows mounts to be carried along across multiple execs without respecifying everytime. But if we go this route and it confuses users, I don't think it will be a huge lift to rearrange it, so I'm personally fine with going the route in this PR for now.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
I'm ready to call this "good enough" and merge it, so that we can start implementing. Of course we can continue tweaking in follow-up PRs but I think we're close enough to ship this. wdyt? |
sipsma
left a comment
There was a problem hiding this comment.
I'm ready to call this "good enough" and merge it, so that we can start implementing. Of course we can continue tweaking in follow-up PRs but I think we're close enough to ship this.
wdyt?
SGTM
|
Looks good. I'll be excited to have a single key I continue to get some cognitive dissonance from using a "directory" or "filesystem" to pull a single file string when working with secrets (versus https://github.com/shykes/cloak/blob/gql-builtins/api/README.md#secrets
I like that |
Would |
Or I guess we could move this to Beforequery secretFromDir($dir: DirectoryID!, $path: String!) {
directory(id: $dir) {
secret(path: $path) {
id
}
}
}Afterquery secretFromDir($dir: DirectoryID!, $path: String!) {
directory(id: $dir) {
file(path: $path) {
secret {
id
}
}
}
} |
|
Hmmm...yeah, that's tough. You could say: a secret is a special string. Sometimes it acts like a secret environment var or sometimes like a secret file from a directory, but those are really just places/routes where we get the secret from. We shouldn't think of a "secret file" as a "file" that happens to be secret or a "secret env var" as an "env var". So by that logic, what you have proposed is the best and it's shorter. It also keeps secrets from splitting taxonomically into file-secret and env-secret, etc. |
|
I have a question regarding In the case of directory filtering, having the I guess it's more of an implementation detail, but if it were the case, it could be a problem (no one wants to pass the |
Good question. In theory buildkit could optimize this before marshaling llb. I don’t know if it does. |
To double check I'm understanding the question, you're saying that it would be more optimal to just not create (or import) the directory in the first place rather than create/import it and then delete it? If so, yes I agree the first is more optimal and should be used whenever possible (i.e. you can use |
0c85616 to
c878c53
Compare
Signed-off-by: Solomon Hykes <solomon@dagger.io>
c878c53 to
4821fe9
Compare
I updated the secrets API based on your feedback, it feels cleaner this way. See host.gql, directory.gql and secret.gql. I also changed |
|
I also created the optional Going for lunch break, and will merge this after as a checkpoint, unless there are remaining red flags or strong objections. Thanks everyone! |
|
LGTM. We don't have any way to configure network or CA in this API. Is it because it can come later on? Or we don't plan to deal with that at all? |
It depends on what kind of networking configuration you have in mind.
|
|
I'm merging this as discussed. Remember, this can keep evolving. But we have a good enough checkpoint that we can start a good amount of implementation work with confidence. |
Last updated 2022-09-09
This proposal defines a complete Core API for cloak. It is written with the following goals in mind:
See the README for a complete overview.