Skip to content

Test ci 2 - #2

Closed
sipsma wants to merge 4 commits into
mainfrom
test-ci-2
Closed

sipsma wants to merge 4 commits into
mainfrom
test-ci-2

Conversation

@sipsma

@sipsma sipsma commented Apr 22, 2022

Copy link
Copy Markdown
Owner

No description provided.

sipsma added 4 commits April 20, 2022 18:28
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
@sipsma sipsma closed this Apr 29, 2022
sipsma pushed a commit that referenced this pull request Aug 30, 2023
sipsma pushed a commit that referenced this pull request Oct 1, 2023
* build: clean up build

update pom.xml dependency management
remove unused dependencies
remove unused import

* build: Add maven exec plugin to run the code samples from the CLI
sipsma pushed a commit that referenced this pull request Oct 1, 2023
* Initial commit

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* Initial version (#1)

Initial version of the SDK
---------

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* Clean up build process & better samples (#2)

* build: clean up build

update pom.xml dependency management
remove unused dependencies
remove unused import

* build: Add maven exec plugin to run the code samples from the CLI

* build: support dependency caching in github action (#3)

* fix: add missing sample in the sample code demo app (#4)

* feat(log): add debug log when response is contains errors. (#5)

Set the log level to debug in integration tests

* fix: support macos arm64 architure by cli downloader (#7)

* fix: client hangs on close (#8)

fix(connection): refactoring of the engine connection package

Move CLIRunner and ConnectParams to a dedicated class file
Replace JSON-B by JSON-P to deserialize the connection parameters
Move the Dagger CLI process execution to the CLI runner (Single-responsibility principle)
Fix process hanging when connection to the engine failed
Improve code style
Add some tests for Connection class

---------

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* build(workflow): enable build on linux and macos (#9)

macos is limited to PR builds
So far windows VM does not support Linux containers

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* build: package jar with dependencies and upload artifacts in github (#11)

package jar with dependencies and upload artifact in github
upload artifact only on push to main
update README.md
---------

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* Move all files into sdk/java subdir

So that this can be imported into dagger/dagger repository

Signed-off-by: Gerhard Lazu <[email protected]>

* sdk(java): Add experimental warning to README

Signed-off-by: Gerhard Lazu <[email protected]>

* sdk(java): Rename LICENSE

But keep as is, same as we did for other experimental SDKs.

Signed-off-by: Gerhard Lazu <[email protected]>

* chore: Add /sdk/java to CODEOWNERS

Signed-off-by: Gerhard Lazu <[email protected]>

* build: rename package name from 'org.chelonix.dagger.*' to 'io.dagger.*'

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* build(codegen): add introspection query in the codegen plugin resources and use it when schema is not available. Inject the CLI version in the code at build time

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* build: add linter plugin and lint current code

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* build: set development version to 1.0.0-SNAPSHOT. Add "release" profile dedicated to deployment

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix: correctly return the dagger CLI path in codegen plugin and fix some log messages

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* build: Add schema for 0.6.4

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix: fix coding style for linter

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* build: fix maven versions plugin groupId

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* ci: add java sdk CI
- add initial build worflow in internal/mage/sdk/java.go
- add test & lint actions in github action worflow

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix: replace deprecated API calls in tests
- Container.fs -> Container.rootfs
- Container.exec -> Container.withExec

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix: Add a static 'from' method to instanciate a Scalar from a String literal

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix(doc): fix javadoc for field parameters in generated code

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix: Fix NPE when CLI download fails and log error

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix(codegen): clarify codegen plugin parameters and Dagger version in generated code

Separate CLI and SDK version
Use either a previously generated schema or a query a locally installed dagger CLI
update the CI to generate the schema matching the used dagger CLI

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* fix(codegen): fix sdk:java:generate goal

Now the generate goal will query the dagger CLI to generate the API JSON schema and write a file
A new dagger-codegen:generateSchema plugin goal has been added to the  dagger-codegen maven plugin (with some code refactoring between both goals) to generate the schema. The generate schema is copied to plugin resources dir /schemas according to the engine version declared in the pom.xml file afterwards.
The schema file naming has been simplifying (removing the 'v' prefix) and the existing files have been renamed accordingly

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* feat(codegen): add schema for dagger engine 0.8.3 and 0.8.4

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* doc(codegen): document how to bump engine dependency

Signed-off-by: Jean-Christophe Sirot <[email protected]>

* Remove redundant return & go fmt

Signed-off-by: Gerhard Lazu <[email protected]>

* Make Java SDK workflow standalone, same as the Elixir one

Leverage the re-usable _hack_make workflow.

Signed-off-by: Gerhard Lazu <[email protected]>

* Use same Apache 2.0 license as all other SDKs

Engine & CLI use the same Apache 2.0 license.

Signed-off-by: Jean-Christophe Sirot <[email protected]>

---------

Signed-off-by: Jean-Christophe Sirot <[email protected]>
Signed-off-by: Jean-Christophe Sirot <[email protected]>
Signed-off-by: Gerhard Lazu <[email protected]>
Signed-off-by: Jean-Christophe Sirot <[email protected]>
Co-authored-by: Jean-Christophe Sirot <[email protected]>
Co-authored-by: Jean-Christophe Sirot <[email protected]>
Co-authored-by: Daniel Lavoie <[email protected]>
sipsma added a commit that referenced this pull request Mar 6, 2026
Problem

After the earlier object-self persistence cutover and restart test fixes, the
manual `./hack/dev` / `./hack/with-dev dagger --progress=plain call engine-dev
container with-exec --args true stdout` workflow was still not reliable.

There were two concrete classes of failures in the manual flow:

1. Restart could still go bad even after the old import wipe was reduced.
   The original failure was:
   - `dagql persistence import failed; wiping and cold-starting`
   - `import term_result: missing result "xxh3:..."`

   We traced that to background dagql prune selecting persisted closure members
   and emitting tombstones for them, which left durable `term_results` rows
   pointing at missing/tombstoned results on the next import.

2. Once that was mitigated, later manual restart runs still hit follow-on
   object/cache failures in real module and engine-dev paths, including:
   - imported results losing `originalRequestID`, which made re-export fail with
     `result has nil original request ID and no persisted envelope`
   - eager object reconstruction in `cache.wait` breaking typed object shells such
     as `FunctionCallArgValue`
   - mounted directory child decode failing with `missing persisted result key`
   - eager mutable `CacheVolume` reopen failing with `... is locked: locked`
   - cache-mount use sites expecting a live snapshot even though imported cache
     volumes now intentionally decode as logical identities first

Solution

Keep the earlier object-self import design, then harden the real manual
workflow around it.

The main behavioral changes are:
- protect persisted closure members from automatic dagql prune tombstoning
- restore enough imported identity (`originalRequestID`) for decoded persisted
  results to be re-exportable later
- make cache object reconstruction more tolerant when a typed object shell is
  present but eager object wrapping would be wrong or premature
- allow persisted child object references to fall back to normal ID load when
  they are intentionally not present in the imported persisted-result index
- treat imported cache volumes as logical cache identities, not eagerly reopened
  mutable refs, and lazily initialize their snapshots at actual mount/exec use
  sites instead

Implementation details

Dagql cache / persistence
- `dagql/cache_prune.go`
  - skip `depOfPersistedResult` entries during automatic prune so persisted
    closure members are not tombstoned out from under restart import.
- `dagql/cache_persistence_import.go`
  - restore `originalRequestID` from persisted envelope IDs during import.
- `dagql/cache.go`
  - when a completed call returns a typed object through a plain `Result[T]`,
    infer `objType` from the current server only for non-list object types.
  - in `cache.wait`, if eager object wrapping fails, fall back to returning the
    typed result shell instead of erroring immediately.
- `dagql/cache_persistence_resolver.go`
  - when persisted child object resolution misses the imported-result index,
    fall back to normal `dagql.NewID[T](id).Load(...)` rather than failing.

Core object / cache volume behavior
- `core/cache.go`
  - `CacheVolume.DecodePersistedObject` now restores logical cache identity and
    selector only; it no longer eagerly grabs a mutable snapshot at decode time.
- `core/container.go`
  - prepare cache-volume mounts before container sync so persistence prep can
    stabilize cache-mounted containers.
  - `WithMountedCache` now lazily initializes the cache volume snapshot if the
    imported cache-volume object has not opened it yet.
- `core/container_exec.go`
  - mount preparation for exec now lazily initializes cache-volume snapshots if
    needed rather than treating missing snapshot handles as fatal.
- `core/persisted_object.go`
  - imported child object loads can fall back to normal ID load when the
    imported cache has no persisted-result-key entry for that child.

Planning / tracking
- `scratch/WHITEBOARD.md`
  - added Phase 8 for the manual engine-dev workflow, including the problem
    statement, checklist, and progress log covering the prune diagnosis and the
    latest manual repro results.

Validation

Focused validation still passes:
- `go test ./dagql -run 'TestPersistedSelfCodec|TestCachePersistenceImport|TestCachePersistenceWorker|TestCachePersistenceCleanShutdownToggleOnClose|TestCachePersistenceWorkerEqFactTombstoneScopedByOwner|TestCachePersistenceWorkerIdempotentUpsertAndTombstone' -count=1`
- `dagger --progress=plain call engine-dev test --pkg ./core/integration --run='TestEngine/TestDiskPersistenceAcrossRestart'`
- `dagger --progress=plain call engine-dev test --pkg ./core/integration --run='TestModule/TestFunctionCacheControl'`

Manual workflow state after these changes:
- clean run #1 succeeds
- run #2 is strongly warm (`EngineDev.container` and `Container.withExec` cache)
- the old restart wipe signature is gone
- post-restart run now succeeds end-to-end for the manual workflow

Remaining caveat noted in WHITEBOARD:
- post-restart `load module` / `DaggerDev.engineDev` still do real work instead
  of being fully warm, even though the workflow is now correct end-to-end.

Signed-off-by: Erik Sipsma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant