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
Project ID:
fdd52bdc-3766-40b0-9727-44e1356a5da3
fdd52bdc-3766-40b0-9727-44e1356a5da3
woah how did you do the transcription
hahah manually copied the messages...
haha
so that's how i had it in my docker-compose
so at the end of the day, two services still need to be able to access the same file system right?
and I need to have these two files to connect
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 filesright but both services still need to access the same filesystem
no, the only interaction was passing these two files on init
on
go-stroom
boot, it needs to have these two filesi cant see how that doesnt mean the same thing as what im saying
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
i think youll need to combine the two services into one for now, with something like multirun or parallel
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
aren't they both docker images?
oh, so you mean create another docker image that bundles them together into one docker image, and run that docker image?
indeed
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?
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
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?
yes
this would actually solve my problem
oh i though you knew that
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
i see
ok thanks i will play around with that