Comments (5)
Sure, since there's a cache volume type, it makes sense that you can pass it as argument. I've never seen that done so hadn't even thought about it, but it seems reasonable to me that we don't break it. As long as it doesn't break namespacing of modules (which I don't think it would), then I don't see any problem with that.
So these things should all be true:
- When a cache volume is loaded by key (
cacheVolume(key: String!)
), the key is always namespaced by module address. There is no way to bypass this. - A cache volume ID can be used by any module. But a module cannot guess the ID of another module's cache volume: it needs to be passed explicitly.
- Ideally, cache volume IDs do NOT become sensitive values to be scrubbed from screenshots and logs (because ie. they are not reusable across sessions)
from dagger.
What does module mean in this context? Each instance/call of a module gets separate cache volumes?
What if I have multiple calls to a Go module within the same project and I want to share the module/build cache between them?
from dagger.
What does module mean in this context? Each instance/call of a module gets separate cache volumes?
What if I have multiple calls to a Go module within the same project and I want to share the module/build cache between them?
I mean the full canonical address of the module, for example github.com/shykes/daggerverse/hello
.
All instances of the same module would share the same volume, as long as they share the same persisted cache volume storage.
from dagger.
I agree we need to do something like this, but do want to note that the fact that cache volumes can be shared across modules is highly beneficial to performance for many common use cases. E.g. anything that uses Go benefits from sharing a cache volume for downloading deps (and possibly build cache, etc.).
Obviously in the choice between security-by-default and performance, security-by-default should win.
But in past discussions around all this the idea of cache volumes being tied to modules but still allowing modules to pass their own cache volumes around came up and is still worth considering imo. So say you are writing a module that calls to a bunch of other modules that do "go things"; you should be able to define a cache volume and pass those cache volumes to be used by modules you call.
- This of course requires that the modules you are calling accept an optional cache volume to use as an override for their default (private) one, which probably just needs to become a best practice in this scenario.
That seems like one reasonable way of maintaining security by default while still allowing opt-in performance benefits. I'm sure there's other approaches possible too.
from dagger.
Yeah SGTM, coincidentally everything required to implement enforcement of only using cache volumes you create or are explicitly passed is also what's required to safely pass sockets around (#6747), which I'm working on right now, so should be feasible to implement all this in the very near future.
from dagger.
Related Issues (20)
- 🐞 transport not supported HOT 5
- 🐞 Builds timeout on GitHub Actions HOT 6
- Remove `checkVersionCompatibility`
- Align Helm Chart version with the Dagger version + start tracking a changelog
- 🐞 initial `connect` to a newly spawned engine "sometimes" takes a lot of time
- 🐞 TypeScript module runtime: Type Error: Cannot read properties of null (reading 'trim') HOT 1
- 🐞 dagger.io/dagger v0.11.7 is not available through dagger.io HOT 12
- ✨ Support `--depth` when using `dag.git`
- Module versioning compatability HOT 1
- Tunnel hang w/ nested engines HOT 1
- Context directory HOT 32
- 🐞 Python SDK code generation is incorrect for functions with `dagger.Container` type
- flakey test: `TestPythonProjectLayout` - `The "main" module could not be found` HOT 4
- ✨ Dagger CLI: `dagger develop` with recursive code gen for multi module repositories HOT 1
- test flake: TestContainerSystemProxies
- 🐞 Regression of #7057 with v0.11.7 HOT 4
- The python quickstart fails HOT 1
- 🐞 Dagger CLI does not have a way to pass with-exec arguments containing commas HOT 4
- test flake: TestRemoteCacheRegistrySeparateImportExport - `connection refused` reaching registry HOT 2
- 🐞 GitHub and GitLab urls supplied as arguments for Directory assume `main` even if that's not the default branch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dagger.