https://prefect.io logo
Title
t

Tomer Cagan

03/09/2022, 10:16 AM
Hello, I am a bit confused about how task results are stored when I use kubernetes. Can I define a mount to network storage (in the job template) and then use local storage so it is saved there? Would server be able to read it (assuming is also mounted on the same network storage)? Alternatively, we have sonatype nexus repository - can I create a result type based on that (implemented the interface?) If I do so, how can I ensure this code is available to the system (task / server)
a

Anna Geller

03/09/2022, 10:32 AM
First off, how would you architect this without Prefect? Would you use object storage (e.g., S3) or block storage (e.g., an EBS volume attached to an instance) for storing such data artifacts? I would claim that the first option is better, cheaper, more reliable, and even easier to set up. That's why I would also not use any mounted volume for that in Prefect as it introduces a lot of (unnecessary?) complexity with no extra benefit. Having said that, if you have some restrictions imposed upon you from above (aka someone told you to use a mounted volume for storing run artifacts regardless of whether this is a good idea), check out this thread: https://discourse.prefect.io/t/how-to-mount-a-folder-on-my-local-filesystem-to-a-flow-run-pod-on-kubernetes/441
t

Tomer Cagan

03/09/2022, 10:36 AM
We are hosting everything on premise using k8s so I am trying to work according to that.
I understand the advantages of using s3 or such object store but unfortunately, I don't think it is an option. I am also considering installing minio or something like that (assuming S3Result supports it)
What about the latter part of the question? Is that even possible to do?
a

Anna Geller

03/09/2022, 10:44 AM
Gotcha, it seems Jacqueline had the same use case then (even though I still believe you should be able to interact with S3 from an on-prem cluster - is it that restrictive that even S3 is not allowed?). But yes, it seems to be possible to mount a volume to your flow run pods and use it for storing local results and Jacqueline seemed to have done that successfully "I had to modify the template by dropping the command as mentioned here: https://github.com/PrefectHQ/prefect/issues/4525" If you can mount a network file system, you should be able to use it as if it was a local file system and specify the path for interacting with it.