Replies: 4 comments 3 replies
-
Hi @bashscr - it is expected behavior for the volume to be deleted when the workspace is deleted. When deleting a workspace, Coder runs However, the volume can be persisted between workspace stop/starts to persist source code and data in an ephemeral environment such as a container. Can you confirm whether the volume is being persisted between stop/starts? |
Beta Was this translation helpful? Give feedback.
-
Hey @ericpaulsen thanks for getting back! Yes, I can confirm that shutting down the EC2 or stop/starting the Workspace does not affect the volume - it's persistent. I am aware of the expected behavior of the volume being created/tied to the Workspace, but I was hoping there would be a way to have a dedicated volume per-user that I could mount to every Workspace created by that user. The temporary volume that gets created when the Workspace is created - I don't mind that being destroyed when the Workspace is destroyed. With that being said, I'm not sure of the best way to tackle this. I essentially want every user inside of our environment to have a shared volume across all of their Workspaces, that's unaffected by the lifecycle of Coder Workspaces. Just in-case any Workspace is ever deleted, then users will not lose anything. Not only this, but it would be beneficial to have settings shared/sync across Workspaces for things like VS Code, or anything else that can be personalized/used across multiple Container images. I hope this makes sense, and if not, please let me know and I'll try to explain it better. Thank you again for your time. |
Beta Was this translation helpful? Give feedback.
-
To achieve something very similar I have a drive in the coder host. Where I have separate directories for each user. I mount those directories to each workspace of that user on a path This is the snippets I am using to mount the volume. https://github.com/matifali/coder-templates/blob/4ea5f571ed441758e0a1d44d0c858b3275940869/deeplearning/main.tf#L352-L357 The full template is available at. https://raw.githubusercontent.com/matifali/coder-templates/main/deeplearning/main.tf |
Beta Was this translation helpful? Give feedback.
-
@bashscr did you ever figure out a way to do this? I am in the same boat and trying to use an NFS directory to do this but seems a bit tricky in coder since I need to create a pv and then a pvc for the deployment. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have a question regarding shared/persistent volumes for Workspaces. For context, I am using an EC2 on AWS with Coder installed directly on it, as well as Docker.
I tried looking through the documentation, as well as the issues tab on GitHub, but I wasn't able to find anything to the best of my knowledge. Essentially what I am trying to do is have a persistent volume that's tied to an individual user, that will be mounted to each Workspace inside Coder.
So, if a developer spins up a Workspace from a Template and specifies two different images (i.e., a Linux image with Python installed & another Linux image with Go installed; they can have a persistent volume to store their Git repositories on, VS Code settings/extensions, and anything else that would be needed. Basically, each image we have stored in our GitLab Container Registry is responsible for having all of the pre-requisites for that image (software/tools, dependencies, etc.). Outside of that, I would like a way for each user to have a dedicated volume that does not get deleted when a Workspace is turned off or shutdown.
For my "docker_volume" resource, I already have the lifecycle snippet in there - but the volume will be deleted if the Workspace is deleted.
TLDR; I would like to have a dedicated Docker volume per-user that can be mounted/accessed across all of their Workspaces. When a Workspace is shutdown or deleted, this volume should not be affected/deleted only unmounted from the Workspace itself.
Is this something that's possible to be done through Coder or do I need to use a different approach? Any thoughts or ideas here would be appreciated. If I made anything unclear, or you have any questions, please don't hesitate to ask me here. Thank you very much for your time and assistance, I look forward to hearing back!
Beta Was this translation helpful? Give feedback.
All reactions