Accessing files inside the volume

what's the best way to export build artifacts from one service to another? during build process, a tls.cert and a .macaroon file are generated, which i need to pass to another service to be able to connect them as i understand, volumes can't be shared, they are scoped per-service, right? Brody — Today at 14:23 correct, if you could share a volume to multiple services (you will be able to at some point, its planned) then you just write those files to the volume and read them back from the other service, but thats not currently possible so maybe make those files available via a local only api? then your service can just download the files from the other service i am using a pre-built docker image for that piece of the system, so that's gonna be tricky is there a way to mount a volume remotely? i can just generate artifacts once and manually send them using env variable Brody — Today at 14:28 like you could just generate those files locally and upload them into the volume? no, the opposite way, that service autogenerates them on start, if they're not present, but then i can keep the volume in place so that the artifacts don't change Brody — Today at 14:31 unless im misunderstanding something, that is what a volume is for, persistent storage yeah, but i also need to be able to pass those files to another service using volume can help me not needing to pass them on each restart is there any way to read files from a volume, other that editing the code of the service?
29 Replies
Percy
Percy9mo ago
Project ID: fdd52bdc-3766-40b0-9727-44e1356a5da3
caffeinum
caffeinum9mo ago
fdd52bdc-3766-40b0-9727-44e1356a5da3
Brody
Brody9mo ago
woah how did you do the transcription
caffeinum
caffeinum9mo ago
hahah manually copied the messages...
Brody
Brody9mo ago
haha
caffeinum
caffeinum9mo ago
No description
caffeinum
caffeinum9mo ago
No description
caffeinum
caffeinum9mo ago
so that's how i had it in my docker-compose
Brody
Brody9mo ago
so at the end of the day, two services still need to be able to access the same file system right?
caffeinum
caffeinum9mo ago
and I need to have these two files to connect
No description
caffeinum
caffeinum9mo ago
macaroon is basically a cookie, and tls.cert is a custom signed ssl cert required to connect them lnd is not a service i control, i can edit docker file slightly, but i don't wanna change the source code accessing the same file system is not super required, it's just how it's done in docker compose, cause that was the easiest i can pass the file content using env variables, it's not a problem cause it's only two files
Brody
Brody9mo ago
right but both services still need to access the same filesystem
caffeinum
caffeinum9mo ago
no, the only interaction was passing these two files on init on go-stroom boot, it needs to have these two files
Brody
Brody9mo ago
i cant see how that doesnt mean the same thing as what im saying
caffeinum
caffeinum9mo ago
i mean if it's possible, yes, they need to access the same file system but you said it's not, so i am thinking of other ways to pass this data e.g. during runtime, there's no need to access the same file system, it's only a boot-time requirement
Brody
Brody9mo ago
i think youll need to combine the two services into one for now, with something like multirun or parallel
caffeinum
caffeinum9mo ago
i don't want to mix two codebases, it's gonna be a too much of a mess again, i don't need to access the same filesystem, i just need to be able to download the file once from the volume
Brody
Brody9mo ago
aren't they both docker images?
caffeinum
caffeinum9mo ago
oh, so you mean create another docker image that bundles them together into one docker image, and run that docker image?
Brody
Brody9mo ago
indeed
caffeinum
caffeinum9mo ago
ooooph
Brody — Today at 14:28 like you could just generate those files locally and upload them into the volume?
Okay, and is this possible?
Brody
Brody9mo ago
yes https://railway.app/template/Nan7Bs
By default, the storage location is set to the storage subdirectory in the root of the volume, but by setting a service variable USE_VOLUME_ROOT to 1 you can opt to use the root of the volume as the storage location instead
caffeinum
caffeinum9mo ago
is there the same thing, but w/ bash access so that i can ping local services? wait, so you're telling me i can actually connect a volume to one service, let it generate files, then disconnect the volume and reconnect to another service?
Brody
Brody9mo ago
yes
caffeinum
caffeinum9mo ago
this would actually solve my problem
Brody
Brody9mo ago
oh i though you knew that
caffeinum
caffeinum9mo ago
that's why i was saying i don't need simultaneous filesystem acces i didn't know that cause i didn't reliase it's possible to move them
Brody
Brody9mo ago
i see
caffeinum
caffeinum9mo ago
ok thanks i will play around with that
Want results from more Discord servers?
Add your server
More Posts