Repository navigation
Feat/context directory - #7744
Conversation
c08bbea to
e3064b6
Compare
|
(continuing a conversation from discord) For now, I think the way to general way to approach this feature should be to leave the current module context loading as is since it's used by the SDKs to build modules and then add this support for user arg context dirs as separate context loading calls. There's likely ways of unifying and optimizing this but better to start simple for now. There's different ways of approaching this, I'm just gonna outline the first reasonable possibility that comes to mind. Not set in stone at all though so happy to hear other opinions and happy to help out more if reality of implementing it doesn't align with theory.
|
I understand this but this directory will not have the full repo if it's not part included in |
You would need to add a new method that does the actual load of files from the original context directory (i.e. loads from the user's local dirs or loads from the git repo). That's what I was referring to under "The way that you implement loading the context depends on whether it's coming from a remote git repo or a local git repo." in my previous comment |
To do such thing, we need to know the file where the module func comes from, I'm not sure we got this information in the current API. |
Sorry I forgot to update that line after further discussion. It should be relative to the module root, not the file (that would be too difficult to find out). |
Ohh then yeah it's much easier haha |
|
Another question @helderco @jedevc @shykes, should the API returns an error during registration if the typedef has both a default value and a contextual one? Example of notation: @func()
async test(@context("/") dir: Directory = dag.directory()): Promise<string[]> |
b920242 to
426440b
Compare
I thought we were using default values? I might have missed (or forgotten) the last round of bikeshedding on that topic. |
No it's a specific field in the API, see the change of spec in the description |
|
@TomChv could you add example snippets of what that feature would look like, in the 3 main languages please? It would make it easier to discuss the DX tradeoffs |
I updated my view in #7647 (comment):
We need to bikeshed on the In Python, this would have to be done using metadata annotation on the type: def build(
self,
backend: Annotated[
dagger.Directory,
DefaultFromContext("../backend/app/src"),
Ignore(...),
]
) -> dagger.Directory:
... |
I think it should look like this: Go func (app *App) Build(
// +default="./frontend/src"
frontend *Directory,
// +default="./backend/app/src"
backend *Directory,
// +default="/tools/builder.conf"
buildConfig *File,
) *Directory {}Typescript @func()
build(
@context("./frontend/src") frontend: Directory,
@context("./backend/app/src") backend: Directory,
@context("./tools/builder.conf") buildConfig: File,
): Directory {}Python Done by Helder above
|
|
In Go, rather than |
|
@TomChv could you add an example of how regular default values work in each case? |
Go I'm not sure you can default to a directory value in Go so I don't know?? But for primitive type, you set a pragma like Typescript @func()
build(
frontend: Directory = dag.directory(),
backend: Directory = dag.directory(),
buildConfig: File = dag.directory().WithNewFile("xxx", "xxx").File("xxx"),
): Directory {}Python I'm not sure about the syntax but probably: def build(
self,
backend: Annotated[
dagger.Directory,
] = dag.directory()
) -> dagger.Directory:
... |
cb2de90 to
770d17c
Compare
|
Few changes that we'll introduced on this PR based on my conversation with:
|
770d17c to
b57afae
Compare
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
To be moved to the engine. Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Deps were previously getting context dirs resolved from the direct caller's local source rather than from the actual context they were sourced from (in the case of local source modules). The fix here finds the right client to load the context from by just walking through the parent callers of the current client until a non-module client is found. That client has to be the one context was loaded from in the local dir case. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
4d36abb to
0e3ab2e
Compare
sipsma
left a comment
There was a problem hiding this comment.
One nit about more test coverage, otherwise LGTM!
| // +defaultPath="/dep" | ||
| // +ignore=["!yo"] | ||
| source *dagger.Directory, |
There was a problem hiding this comment.
nit: I think it's worth adding coverage of relative paths when setting defaultPath for deps in addition to this coverage of absolute paths. There's a lot of logic to get correct when it comes to resolving those paths so seems worth another test.
There was a problem hiding this comment.
Done in 79e917c, with fixes on relative dep module resolution normally.
|
|
||
| out, err := ctr.With(daggerCall("get-dep-source", "--src", "./dep", "entries")).Stdout(ctx) | ||
| require.NoError(t, err) | ||
| require.Equal(t, "yo\n", out) |
There was a problem hiding this comment.
I think this test is technically passing, but I have a hunch it might be wrong.
So, what if we have a dep module that doesn't exist on disk, and we created the directory source inside the GetDepSource func? I think it would still read from the disk of the parent.
...I'm not sure that's right, but I'm also not convinced what the right behavior should be. Potentially I wonder if we should just not allow a context directory at all in this case (or fallback to .ContextDirectory), since there's not really a corresponding client it was loaded from here. cc @sipsma
No need to block here, since it's a minor point in a relatively unused API (but note, we use it in our CI!).
There was a problem hiding this comment.
Are you referring to the case where the Directory.asModule API is used with a directory that was created with some set of arbitrary API calls?
If so, yeah that wouldn't work atm. The logic for loading context dirs/files is based on the Kind of the module source (e.g. here), so I think this just means that modules created from arbitrary directories should be marked as their own separate kind from Local/Git (need to be marked as a different kind here).
Then context can be loaded from them. I think the logic would be almost identical to the logic for loading from git.
Either way, agree this is extremely obscure, doesn't need to be a blocker.
There was a problem hiding this comment.
Are you referring to the case where the
Directory.asModuleAPI is used with a directory that was created with some set of arbitrary API calls?
Exactly this.
I think this just means that modules created from arbitrary directories should be marked as their own separate kind
I suggested a ScratchKind for this back in #7744 (comment), can look at that at some point 🎉
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Follow up to dagger#7744 to point relative path to source dir instead of root dir. Signed-off-by: Tom Chauveau <[email protected]>
* fix: context dir relative path point to source dir Follow up to #7744 to point relative path to source dir instead of root dir. Signed-off-by: Tom Chauveau <[email protected]>
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [dagger/dagger](https://redirect.github.com/dagger/dagger) | patch | `v0.12.5` -> `v0.12.7` | --- ### Release Notes <details> <summary>dagger/dagger (dagger/dagger)</summary> ### [`v0.12.7`](https://redirect.github.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0127---2024-09-02) [Compare Source](https://redirect.github.com/dagger/dagger/compare/v0.12.6...v0.12.7) ##### Fixed - Fixed regression in module ref parsing for no-protocol refs that had version suffixes by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8298](https://redirect.github.com/dagger/dagger/pull/8298) - Make `Git.tags` URL parsing consistent with `Git.tree` by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8298](https://redirect.github.com/dagger/dagger/pull/8298) - Load specified version when loading `php` or `elixir` sdk by [@​rajatjindal](https://redirect.github.com/rajatjindal) in [https://github.com/dagger/dagger/pull/8297](https://redirect.github.com/dagger/dagger/pull/8297) ##### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) ### [`v0.12.6`](https://redirect.github.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0126---2024-08-29) [Compare Source](https://redirect.github.com/dagger/dagger/compare/v0.12.5...v0.12.6) ##### Added - Add new context directory support by [@​TomChv](https://redirect.github.com/TomChv) in [https://github.com/dagger/dagger/pull/7744](https://redirect.github.com/dagger/dagger/pull/7744) \ This allows accessing their own source directory, without needing to explicitly pass directories around. - Support private modules with new SSH ref scheme and forward of SSH agent by [@​grouville](https://redirect.github.com/grouville) in [https://github.com/dagger/dagger/pull/7708](https://redirect.github.com/dagger/dagger/pull/7708) - Go-like public module refs (currently used) remain active - HTTP / HTTPS schemes are now supported as alternative public module refs - SSH refs are introduced, with support of SCP-like refs git@provider:user/repo and explicit ssh://provider/user/repo - Implements CLI call argument `--interactive-command` for overriding the default command used in interactive mode by [@​samalba](https://redirect.github.com/samalba) in [https://github.com/dagger/dagger/pull/8171](https://redirect.github.com/dagger/dagger/pull/8171) ##### Fixed - Error out if non-existent local module directory is passed to CLI by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8193](https://redirect.github.com/dagger/dagger/pull/8193) \ The file-not-found errors were previously silently ignored for the top-level module passed in the CLI. - Silence noisy `failed to get repo HEAD` CLI error by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8189](https://redirect.github.com/dagger/dagger/pull/8189) - Fix performance issues in `Container.withExec` after using `withMountedTemp` or `withMountedSecret` by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8180](https://redirect.github.com/dagger/dagger/pull/8180) ##### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone America/Los_Angeles, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/scottames/daggerverse). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [dagger/dagger](https://redirect.github.com/dagger/dagger) | patch | `v0.12.5` -> `v0.12.7` | --- ### Release Notes <details> <summary>dagger/dagger (dagger/dagger)</summary> ### [`v0.12.7`](https://redirect.github.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0127---2024-09-02) [Compare Source](https://redirect.github.com/dagger/dagger/compare/v0.12.6...v0.12.7) ##### Fixed - Fixed regression in module ref parsing for no-protocol refs that had version suffixes by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8298](https://redirect.github.com/dagger/dagger/pull/8298) - Make `Git.tags` URL parsing consistent with `Git.tree` by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8298](https://redirect.github.com/dagger/dagger/pull/8298) - Load specified version when loading `php` or `elixir` sdk by [@​rajatjindal](https://redirect.github.com/rajatjindal) in [https://github.com/dagger/dagger/pull/8297](https://redirect.github.com/dagger/dagger/pull/8297) ##### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) ### [`v0.12.6`](https://redirect.github.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0126---2024-08-29) [Compare Source](https://redirect.github.com/dagger/dagger/compare/v0.12.5...v0.12.6) ##### Added - Add new context directory support by [@​TomChv](https://redirect.github.com/TomChv) in [https://github.com/dagger/dagger/pull/7744](https://redirect.github.com/dagger/dagger/pull/7744) \ This allows accessing their own source directory, without needing to explicitly pass directories around. - Support private modules with new SSH ref scheme and forward of SSH agent by [@​grouville](https://redirect.github.com/grouville) in [https://github.com/dagger/dagger/pull/7708](https://redirect.github.com/dagger/dagger/pull/7708) - Go-like public module refs (currently used) remain active - HTTP / HTTPS schemes are now supported as alternative public module refs - SSH refs are introduced, with support of SCP-like refs git@provider:user/repo and explicit ssh://provider/user/repo - Implements CLI call argument `--interactive-command` for overriding the default command used in interactive mode by [@​samalba](https://redirect.github.com/samalba) in [https://github.com/dagger/dagger/pull/8171](https://redirect.github.com/dagger/dagger/pull/8171) ##### Fixed - Error out if non-existent local module directory is passed to CLI by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8193](https://redirect.github.com/dagger/dagger/pull/8193) \ The file-not-found errors were previously silently ignored for the top-level module passed in the CLI. - Silence noisy `failed to get repo HEAD` CLI error by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8189](https://redirect.github.com/dagger/dagger/pull/8189) - Fix performance issues in `Container.withExec` after using `withMountedTemp` or `withMountedSecret` by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8180](https://redirect.github.com/dagger/dagger/pull/8180) ##### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone America/Los_Angeles, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/scottames/containers). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [dagger/dagger](https://redirect.github.com/dagger/dagger) | patch | `v0.12.5` -> `v0.12.7` | --- ### Release Notes <details> <summary>dagger/dagger (dagger/dagger)</summary> ### [`v0.12.7`](https://redirect.github.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0127---2024-09-02) [Compare Source](https://redirect.github.com/dagger/dagger/compare/v0.12.6...v0.12.7) ##### Fixed - Fixed regression in module ref parsing for no-protocol refs that had version suffixes by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8298](https://redirect.github.com/dagger/dagger/pull/8298) - Make `Git.tags` URL parsing consistent with `Git.tree` by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8298](https://redirect.github.com/dagger/dagger/pull/8298) - Load specified version when loading `php` or `elixir` sdk by [@​rajatjindal](https://redirect.github.com/rajatjindal) in [https://github.com/dagger/dagger/pull/8297](https://redirect.github.com/dagger/dagger/pull/8297) ##### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) ### [`v0.12.6`](https://redirect.github.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0126---2024-08-29) [Compare Source](https://redirect.github.com/dagger/dagger/compare/v0.12.5...v0.12.6) ##### Added - Add new context directory support by [@​TomChv](https://redirect.github.com/TomChv) in [https://github.com/dagger/dagger/pull/7744](https://redirect.github.com/dagger/dagger/pull/7744) \ This allows accessing their own source directory, without needing to explicitly pass directories around. - Support private modules with new SSH ref scheme and forward of SSH agent by [@​grouville](https://redirect.github.com/grouville) in [https://github.com/dagger/dagger/pull/7708](https://redirect.github.com/dagger/dagger/pull/7708) - Go-like public module refs (currently used) remain active - HTTP / HTTPS schemes are now supported as alternative public module refs - SSH refs are introduced, with support of SCP-like refs git@provider:user/repo and explicit ssh://provider/user/repo - Implements CLI call argument `--interactive-command` for overriding the default command used in interactive mode by [@​samalba](https://redirect.github.com/samalba) in [https://github.com/dagger/dagger/pull/8171](https://redirect.github.com/dagger/dagger/pull/8171) ##### Fixed - Error out if non-existent local module directory is passed to CLI by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8193](https://redirect.github.com/dagger/dagger/pull/8193) \ The file-not-found errors were previously silently ignored for the top-level module passed in the CLI. - Silence noisy `failed to get repo HEAD` CLI error by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8189](https://redirect.github.com/dagger/dagger/pull/8189) - Fix performance issues in `Container.withExec` after using `withMountedTemp` or `withMountedSecret` by [@​jedevc](https://redirect.github.com/jedevc) in [https://github.com/dagger/dagger/pull/8180](https://redirect.github.com/dagger/dagger/pull/8180) ##### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone America/Los_Angeles, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/scottames/dots). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
|
Would love to have this also supported in go sdk :) |
|
It is supported in the go sdk. See the go examples in https://docs.dagger.io/manuals/developer/functions/#directories-and-files. |
This is an implementation of #7647
API changes
This PR updates the
FunctionandFunctionArgfrom our engine API to supportdefaultPathFromContextEngine changes
Callto load contextual values and insert it as input.loadContextualArgfunction that take the typedef and retrieve its contextual default value.loadContextto load fromgitorlocalsource the contextual path.This implements the spec designed in Context directory #7647
For git: we load it from the context directory since it includes the whole repo.
For local: we load it from
importLocalwith the specific directory specified so we never load the full repo expect for/Current progress
*DirectorytoID: I found a workaround withBlobbut it's not okay forFile, I will check if I can use select instead.Selectactually works!Spec Reminder
SDKs support
Go using pragmas directive on
DirectoryorFiletype ⌛Typescript using
@argument({ defaultPath: "path", ignore: ["xx", "!xx"] })✅Example
Fixes #7647