๐ I've been noodling on some problems with capturing state (particularly logs) from containers run as bound services.
Here is what I want to solve:
We have an integration test suite and it exercises our application through its API.
In dagger we stand up our own service using the same *dagger.Container (via the Go SDK) that we ultimately (intend to) publish.
This container is bound to our integration test container which runs a Go test suite (https://github.com/flipt-io/flipt/blob/main/hack/build/internal/test/integration.go#L20-L25) using our own apps Go SDK (clients) against this running service.
(You might also note that I spin up this combination integration suite + our app in various configurations to ensure compatibility in a number of scenarios)
This past 24 hours I've been trying out ways to manage the log output of each of the containers we create.
At the moment, as you know, it is all just muxed together on stdout.
Our existing integration test suite (a bunch of bash) sinks our services logs into a file, while the test suite sits at the front of our Github action logging on stdout.
When the test ends, we use github actions upload artifact feature to push our applications logs into an action artifact:
https://github.com/flipt-io/flipt/blob/main/.github/workflows/integration-test.yml#L93-L99
This allows us to keep the test output at the forefront and remove the noise of the application logs.
However, when the test fails, we have somewhere to go for the application logs and the missing context.
[Breaking this up to get around the Discord word limit]