#How can I export a folder from a service?
1 messages · Page 1 of 1 (latest)
👋 do you start the service with dagger call $svc up?. If that's the case you can add a cache volume to the service and then have a different function which exports the data from the cache volume to your local machine
there's a catch where Dagger won't let you export things from a cache volume directly from a dagger.Directroy you first need to cp them into the container and then export that,
ie:
func (m *MyModule) Export() *dagger.Directory {
return dag.Container().WithMountedCache("cache", mycache).
WithExec([]string{"cp", "-r" , "/cache", "/export"}).
Directory("/export)
}
^ as you can see from the above, I'm copying the /cache content to a different folder which is not a cache volume and exporting that instead.
Hi @earnest osprey !
Yes, I'm starting the service as you mentioned.
If I understand this correctly, the idea is to add a mounted cache to the jupyter service where the notebooks are. Then use another function to move the contents from the cache to a container directory and export it.
Is this what you meant?