Repository navigation
Description
Task List
Things we need to make core.#Start tasks basically useful:
Basic quick fixes:
- Ability to stop gracefully
- Stdout/stderr of the process are logged in the same way as normal
core.#Exec
Networking:
Cue:
Buildkit fixes:
And, once we have the above features, we can document:
Misc (not necessary for documentation but shouldn't lose track of):
- Support for output in TTY mode (right now the logs are only visible in plain progress mode, as mentioned here)
In parallel, we should gather both current feedback and feedback on the updated features:
Latest Updates
- Previously
- Right Now
- Getting core.Start output log PR merged
- Next Steps
- Fix the buildkit bug upstream
- TBD based on conversation with team, but networking feature may be a good next follow-up.
Discussion
core.#Start and related tasks enables users to run ephemeral containers and "sidecar" services that assist the execution of other tasks in an action or provide interactive services to end users. Whereas a core.#Exec is used to run synchronous commands with cache-able outputs, such as building code or executing a test, a core.#Start has no FS output consumable by other tasks and is not cache-able. The tradeoff of those limitations is that it can be used in ways that are off-limits to core.#Exec due to non-determinism (such as interaction with the client or providing network services).
Example use cases:
- Running a database used by tests executing in other
core.#Exectasks. - Development servers (i.e. a server for a web project built by dagger, accessible over the user's localhost)
- Interactive processes, such as debug shells or dev environments
- Running tracing daemons like Jaeger (both for user tasks and even Buildkit itself)
Issues
A few of the tasks are just basic usability concerns (graceful stops and stdout/stderr logging) or bug fixes upstream. The others are more involved and touch on more components.
Networking
Once a process has been started in a core.#Start, we need a way of actually interacting with it. Today, this is possible but far from ideal:
- The network can be used, but because all Buildkit containers are in the same host network namespace (at least in our default buildkitd, as mentioned here), it's easy for port contention to become a problem. Additionally, this requires just hardcoding ports and addresses on both the client and server, which is not very flexible and can be host-dependent.
- A unix socket can be shared over a cache mount. This is a bit of an abuse of a cache mount though and is quite delicate. For example, it doesn't work if one of the containers specifies
always: true.
Users instead need the ability to easily expose network services between containers (conceptually similar to docker compose) and the ability to proxy connections from the dagger client to services in a core.#Start.
Cue
core.#Start is asynchronous, so it's quite important to be able to create dependencies on it having started before executing other tasks. E.g. a test that uses a database running in a core.#Start needs to be sure that the database has been started before running.
Right now, this can only be easily accomplished using tricks like the one here, which don't always work (that trick only works when creating a dependency between two core tasks).
Instead, users need the ability to flexibly create arbitrary dependencies between any cue structs.
Activity
mircubed commentedon May 13, 2022
@sipsma hi! I just assigned to you for tracking, but I will set up some time for us to go through this epic in detail
sipsma commentedon May 13, 2022
Sounds good, thanks @mircubed!
shykes commentedon Dec 21, 2022
Closing since CUE APIs are frozen, and this design work continues in the GraphQL API now.