Repository navigation
Journal file support - #4300
Journal file support#4300
Conversation
da4dc92 to
ed68828
Compare
ed68828 to
cb9d896
Compare
|
I am just about to open a PR which will confirm that this change works as expected. FTR: https://github.com/dagger/tools/pull/29#issuecomment-1373878073 |
Add support for `_EXPERIMENTAL_DAGGER_JOURNAL`. This will dump raw events to a log file, useful for post analysis. Currently this will only be used internally and is subject to removal. Related: dagger#4248 Signed-off-by: Andrea Luzzardi <[email protected]>
cb9d896 to
0f83a32
Compare
Signed-off-by: Andrea Luzzardi <[email protected]>
|
I don't think that this works as expected. Given the following diffs: diff --git a/internal/mage/sdk/nodejs.go b/internal/mage/sdk/nodejs.go
index bc0c8412..3a73f849 100644
--- a/internal/mage/sdk/nodejs.go
+++ b/internal/mage/sdk/nodejs.go
@@ -32,6 +32,7 @@ func (t Nodejs) Lint(ctx context.Context) error {
eg.Go(func() error {
_, err = base.
+ WithExec([]string{"env"}).
WithExec([]string{"yarn", "lint"}).
ExitCode(gctx)
return err
@@ -70,7 +71,7 @@ func (t Nodejs) Test(ctx context.Context) error {
_, err = nodeJsBase(c).
WithMountedDirectory("/root/.docker", util.HostDockerDir(c)).
WithExec([]string{"yarn", "test"}).
- ExitCode(ctx)
+ File("/engine.log").Export(ctx, "engine.log")
return err
}❯ git diff internal/mage/util/util.go
diff --git a/internal/mage/util/util.go b/internal/mage/util/util.go
index 288e2c09..95ea8f65 100644
--- a/internal/mage/util/util.go
+++ b/internal/mage/util/util.go
@@ -62,11 +62,12 @@ func RepositoryGoCodeOnly(c *dagger.Client) *dagger.Directory {
})
}
func WithDevEngine(c *dagger.Client, ctr *dagger.Container) *dagger.Container {
// the cli bin is statically linked, can just mount it in anywhere
dockerCli := c.Container().From("docker:cli").File("/usr/local/bin/docker")
cliBinPath := "/.dagger-cli"
+ engineLog := "/engine.log"
return ctr.
// Mount in the docker cli + socket, this will be used to connect to the dev engine
// container
@@ -80,7 +81,9 @@ func WithDevEngine(c *dagger.Client, ctr *dagger.Container) *dagger.Container {
WithMountedFile(cliBinPath, DaggerBinary(c)).
// Point the SDKs to use the dev engine via these env vars
WithEnvVariable("_EXPERIMENTAL_DAGGER_CLI_BIN", cliBinPath).
- WithEnvVariable("_EXPERIMENTAL_DAGGER_RUNNER_HOST", "docker-container://"+TestContainerName)
+ WithEnvVariable("_EXPERIMENTAL_DAGGER_RUNNER_HOST", "docker-container://"+TestContainerName).
+ WithEnvVariable("_EXPERIMENTAL_DAGGER_JOURNAL", engineLog)
+
}
func goBase(c *dagger.Client) *dagger.Container {The I have noticed that only a subset of these tests run in the dev engine - the ones under I have also noticed that While digging into this, I noticed that we use I think that all our CI workflows should use the dev SDK - flowchart LR
make(./hack/make sdk:node:lint)
sdk_node_test(go run main.go -w ../.. sdk:node:test)
engine_dev(go run main.go -w ../.. engine:dev)
make --> engine_dev --> engine_dev_localhost --> test-dagger-engine
engine_dev -.- sdk_node_test
src["./sdk/nodejs"] --> |COPY| workdir
subgraph Docker
subgraph dagger-engine-SHA:v0.3.7
engine_dev_localhost[/BUILD A DEV ENGINE/]
end
subgraph test-dagger-engine
workdir["/workdir"]
lint[yarn lint]
end
end
sdk_node_test --> |_EXPERIMENTAL_DAGGER_RUNNER_HOST| test-dagger-engine
This is what is happening today: flowchart LR
make(./hack/make sdk:node:lint)
sdk_node_test(go run main.go -w ../.. sdk:node:test)
engine_dev(go run main.go -w ../.. engine:dev)
make --> engine_dev --> engine_dev_localhost --> test-dagger-engine
engine_dev -.- sdk_node_test
src["./sdk/nodejs"] --> |COPY| workdir
subgraph Docker
subgraph dagger-engine-SHA:v0.3.7
workdir["/workdir"]
lint[yarn lint]
engine_dev_localhost[/BUILD A DEV ENGINE/]
end
subgraph test-dagger-engine
connect_via[[_EXPERIMENTAL_DAGGER_RUNNER_HOST]]
end
end
sdk_node_test --> dagger-engine-SHA:v0.3.7
|
Use of a go mod replace like that will create catch-22s in cases where we are making a backwards incompatible change to how Other possible solutions (discussed some of these w/ @aluzzardi earlier today too):
Overall, I don't love it but I think |
|
I cannot help thinking that having a stable engine to build a dev engine seems similar to having a single tool and using it for everything. Since we were able to build the first engine without using an existing engine, could we do the same for the dev engine? |
WithDevEngine implies that the wrapped container will use the dev engine. This is misleading and results in surprising behaviour, as described in #4300 (comment) AdvertiseDevEngine is more accurate: the dev engine is being advertised for any component that is interested in using it, but nothing is enforced. As we discovered, some components will continue using the engine in which they already run (this used to be the stable engine). The link above goes into more detail - it includes screenshots & diagrams that explain the state better than text alone. Signed-off-by: Gerhard Lazu <[email protected]>
|
Having talked through my above comment with @sipsma, the cleanest & easiest to understand approach requires us to move the dev engine building code into a separate directory with its own Once we have build the dev engine, all commands that run through |
|
#3755 has a bunch of context on this. AFAIK there were a bunch of trade-offs in complexity for small gains, that's why we binned the initiative |


Add support for
_EXPERIMENTAL_DAGGER_JOURNAL. This will dump rawevents to a log file, useful for post analysis.
Currently this will only be used internally and is subject to removal.
Related: #4248