Repository navigation
Conversation
|
So happy to see this moving forward. Would it be possible to expand the scope from top level module to any local module within the Git repository? Meaning the security boundary is our Git repo and any external modules would lose access? |
|
Glad to see this moving also! One drawback I see with this method is that it's tied to a constructor. We have modules that we chain and sometimes a downstream module needs a secret. For example, say I have this
I have a token Another drawback would be the host ENV var becomes tied to the name of the module param if the consumer is using "inline/platform" type of module. Module may be created and maintained by different teams, so one could have a I like a more explicit approach. Secrets are name-spaced to the module and the user can have a This supports the sandbox better because user still has to tell dagger to use their env var and it's not pulled in under the hood. The drawback is, if you are using a whole bunch of modules in tandem, this env file could get messy. Ideally, you'd have a top level module that collects all secrets and distributes. |
|
@nipuna-perera yes the goal is to have a |
70d9232 to
5129e22
Compare
5129e22 to
2098e01
Compare
|
Looking for my next incremental step. I see at least 3 well scoped tasks:
FYI @jedevc @eunomie @TomChv @sipsma in case you're interested |
|
5611c8c to
ed809a5
Compare
|
Update:
|
ed809a5 to
97a65e4
Compare
Is the plan to support non-constructor function args too? If not, is there a limitation there? |
This comment was marked as resolved.
This comment was marked as resolved.
|
I've just came to revisit this issue, as I was thinking of the design of our blueprints: In our org, we are developing blueprints quite generic, so the consumers can tweak them to their needs (to certain extent). This turns out in blueprints with PLENTY of arguments (more than a normal module, where you will have everything defined in code inside the module definition. If we were able to define defaults outside of the module in a or Without having to remember the many parameters required, and having them coded somewhere so I can call dagger locally. Quite excited about this feature and if the possibility of unlocking defaults for functions, not just constructor... 👍 |
|
⬆️ Adding on Nadir's comments, I think this would help ensure dagger functions are called the same way locally and in CI. We currently see engineers use tools like Having configurable defaults would go a long way in reducing the need to use these wrappers. |
97a65e4 to
39c58af
Compare
|
Back from vacation, picking this back up |
@nadirollo it seems there was a typo in your example snippet, could you elaborate on exactly what commands you would imagine being typed? Thank you! |
From my last discussion with him, we were envisioning two types of commands. 1. A "setup" command that will save your default parameters into a Which would output the following {
"src": "./infra/platform/app",
"image-name": "example/platform-app"
}2. The instead of (Adding on why this is more important for blueprints is that normally we'd setup these defaults in the |
|
@vmaffet-fast thanks for the details! That makes sense.
For the specific case of source directory, you should still use That said, you would still need a |
In my experience, most Dagger calls primarily require secrets. In an E2E pipeline, these secrets can include:
Many tools are moving away from traditional username/password authentication and now require token-based authentication. This means we can no longer rely on LDAP credentials alone, which adds complexity and increases the number of flags we need to pass. |
|
@nipuna-perera agreed! Which is why this feature will be so helpful. I was just pointing out that it won't be as needed for blueprints + source directories. |
…ilesystem Signed-off-by: Solomon Hykes <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Solomon Hykes <[email protected]>
…, etc. Signed-off-by: Solomon Hykes <[email protected]>
- honor secret cacheKey when using address api - update TestParseGit unit tests to account for nil fragment Authored-by: Erik Sipsma <[email protected]> Signed-off-by: Erik Sipsma <[email protected]> Signed-off-by: Solomon Hykes <[email protected]>
39c58af to
6d72902
Compare
- cleaner implementation, support more object types
6d72902 to
4177e3c
Compare
|
Hi all, I made a second POC which deprecates this one: #11000 |
|
Continuing in #11034 |
This is a POC of persistent environment configuration: like
.envfor your dagger moduel. It is sometimes referred to as "default secrets" because of its most requested use case: not having to pass a gazillion secret references at every CLI invocation of dagger.In this POC, you can pre-configure arguments to your module constructor, by writing a json configuration at
.env.dagger.jsonin your module.Example:
{ "token": "op://foo/bar", "source": "github.com/dagger/dagger#main:docs", "db": "tcp://localhost:4242" }In this case ☝️ these values will be mapped to the arguments
token,sourceanddbof your module's constructor. It's up to you to make sure the fields in your config file match the arguments in your module constructor.Example
Starting from a stable dagger:
Then try running:
Normally you should see your pre-configured repo, cloned using your pre-configured token :)
Design tradeoffs
The main benefit of this approach is that it is simple. Once I figured out how to hook into module loading, the patch is quite small.
The main drawback is that the default value is an ID (the ID of a secret to be precise; but would be generalized to other objects). And that ID is shown in the CLI introspection: