Repository navigation
Description
Status
| Issue description | Status | Notes |
|---|---|---|
Missing field: user |
✅ Added | |
Missing field: always |
✅ Added | |
Missing field: hosts |
✅ Added | |
Unresolved design issues: stdin, stdout, stderr |
✅ Removed | Needs more design work. Bring back when it’s ready |
Unresolved design issues: exit |
✅ Left a exit: 0 field to indicate need for future API expansion |
Expand API when implementation allows |
env: map or list? |
✅ Changed to map | Let’s follow our principles of maximizing CUE nativeness, and not over-optimize for a develop error scenario that is still hypothetical. If it becomes an issue, we can remediate with scanning, best practice documentation, etc. |
mounts: map or list? |
✅ Changed to map | see env |
#CacheDir.id: is this useful? |
✅ added to the spec to support TheChangelog use case. This seems like the correct DX. cc @gerhard @grouville @jlongtine | |
mounts: [string]: { contents: #Secret, optional: bool } what does optional do? |
✅ maps to buildkit API |
Discussion
Feedback from @aluzzardi, with inline resolution status.
Just started implementing this. A few questions when comparing to op.#Exec:
Missing:
user
Will add.
always
Will add.
hosts
Will add.
Extra features, not doable without exec helper:
stdoutstdinstderrexit
- Based on our understanding of how a future exec helper will work, does the current API seem accurate (if not, I will change now)
- I will modify the package so that it’s clear the feature is 1) planned for future versions, 2) not yet implemented.
Changes:
envused to be a map, now it's an array of strings namedenviron--> why?
This is to discourage Cue-style inheritance / specialization between #Exec calls, which would not work as the developer expects, because of runtime IDs.
For example:
foo: engine.#Exec & {
args: [“echo”, “hello”]
}
bar: foo & {
env: “DEBUG”: “1”
}
This will break because the engine will only fill a single exec ID, and it will be shared between 2 commands. We replace maps with lists in engine to discourage this pattern, similar to how Go randomizes maps to discourage relying on stable order.
argsis either an array or a string --> is the runtime supposed to shlex args?
No, engine should never shlex. There is a pure CUE convenience in the higher-level docker package.
mountsused to be a map, it's now a list of#Mount--> why?
Same as env.
#CacheDirnow takes anid, how is the user supposed to use that?
This is from @gerhard ‘s Changelog configuration, pinging @jlongtine and @grouville for more context :)
- secret mounts have an optional field, what does it do?
(FIXME I will look into this one shortly)
Activity
aluzzardi commentedon Dec 14, 2021
Missing:
user👍
always👍
hosts👍
Extra features, not doable without exec helper:
stdoutstdinstderrexitFor stdin/stdout/stderr there's the open question about
dagger.#Stream(and the deadlock)For exit, I'm wondering how to control the behavior (e.g. "continue on failure"). But that's probably orthogonal to defining the exit field.
Changes:
envused to be a map, now it's an array of strings namedenviron--> why?Ok, I get it now.
But aren't we just pushing the problem around? If you replace
engine.#Execwithdocker.#Runin the snippet above, we'd end up in the same situation I think.argsis either an array or a string --> is the runtime supposed to shlex args?Does it behave like a single element array? Can't the high level package just deal with it?
mountsused to be a map, it's now a list of#Mount--> why?👍
#CacheDirnow takes anid, how is the user supposed to use that?Sounds good. Curious about context, specifically the implication is packages (e.g.
yarn) are now supposed to take a#CacheDiras argument rather than declaring their own. Which is totally fine but changes the way we write packages.👍
shykes commentedon Dec 14, 2021
Ouch… You’re right! Goddamn.
My bad, it should be
args: […string. I will clean it up.So, same problem as env…
shykes commentedon Dec 14, 2021
Status update:
Added in #1223 .
Added in #1223.
Added in #1223.
I decided to remove those 3 fields in #1223, and opened #1222 to track outstanding API design discussion. Seems cleaner and simpler that way.
This is from the Buildkit API. It tells Buildkit whether it’s OK for the source secret file to not exist. I just mapped it as is.
shykes commentedon Dec 15, 2021
@aluzzardi I added a status table at the top, to make it more readable. There are 3 issues left that require discussion:
exithardcode to zero, or remove for now? I propose hardcode to zero.env: map or list? I propose list.mounts: map or list? I propose list.shykes commentedon Dec 17, 2021
All outstanding issues are resolved in #1223.