Create a dedicated workspace for each user
I am investigating to see if I would be able to replace Gitpod with Coder for my workshop needs.
A first test for me can be a conference I have from 8 to 10th July.
I have a workshop with something like 20 attendees.
I already know how to have my custom docker image (at least if I use DockerHub and for now it's ok) on my own Coder (using Kubernetes)
What I need now is to be able to prepare 20 accounts, with 20 dedicated workspaces.
My question: is possible to create a workspace for a specific user (CLI or API is fine)?
53 Replies
<#1252546885466587237>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
for the creation part, my eyes were jumping over the "create" word in the CLI part of the doc because my brain was looking for "create workspace" 🙂
For those reading this post in search of the same thing, it is as simple as
now I need to see the permissions of the user allow them to just connect to the workspace and nothing else, and what kind of URL I can share to them.
the create command fails.
here is what I've done
to have the name of the template
then:
with all default values as per the web UI (which works)
the result and error is:
hey @Thierry Chantier, any reason for not letting the users create it themselves ?
well I guess if it's a workshop it's a better experience if they don't need to create it themselves
what version of Coder are you running ?
might be a stupid question but did you input "2 GB" or "2" ?
I'm not at work now, will check tomorrow morning. But I'm pretty sure I have done a helm upgrade today
It was from the interactive shell. For now it is not important, I'll tune proper RAM needs later. The same workspace is launched from the web UI
I meant is it a multiselect or user input ?
I was thinking maybe it's not getting the same data into the template than with the web
does the workspace get created afterwards ?
there's a GH issue regarding this problem and it seems the workspace is still getting created
https://github.com/coder/coder/issues/12282
GitHub
Issue creating workspaces via the CLI · Issue #12282 · coder/coder
After sending workspace parameters, the workspace begins creation process, but it stops after a while with error: STDERR: Encountered an error running "coder create" prepare build: dry-ru...
I will check this issue tomorrow. I’m quite sure it did not appeared afterwards.
alright, another thing you might want to do is check the
provisionerd
logs to see if there's anything interesting in there
@Atif do you have any idea on how we can make the CLI spit out some debug logs for this?version is v2.11.2+d53c94b
I found how to start it from the CLI but I have no idea on where to check logs
i think the provisionerd logs should be available from the Coder server's logs
so the pod called coderd or something like that
hey @Thierry Chantier, any luck?
I ended my week at Voxxed days conference. no time for it. But I remember this discord act as support ticketing, so I will see tomorrow if I can close my two topics, then open new question later when I will have enough time to follow up
sure thing!
you can use the /close command in those threads, feel free to @ me when opening a new one
though your issue really seems like a bug
after conferences time and holidays, I'm back on the topic.
I upgraded to but I still have the error.
I did not find any information in the documentation to properly access provisionerd logs.
@Thierry Chantier sorry if I missed this, but did you enter 2 or 2GB?
Pasting the template here (sanitize it) can help @Phorcys
if you want to make it really simple, just hardcode the CPU/Mem/Disk quantities in the template and not make them Coder parameters.
If you give a choice, they always take the bigger ones.
No worries. I will check on Monday
so for the values, I did not typed them as it is already in the starter template and only selected in the cli.
To avoid any confusion, I modified my template to remove such parameters as I won't use them in the end.
still the same error and I don't know where to look to read logs.
I'm copying here the template, it comes from kubernetes starter template
since you're in kubernetes, are there any remnants like a pod
kubectl get pods -n coder
and if so, get logs
kubectl logs <pod name> -n coder
or describe like if crashloop backoff
kubectl describes pods <pod name> -n coder
I thought @Phorcys was referring to a specific daemon and was looking for dedicated logs access.
The only logs I found in the pod logs is :
oh yeah no sorry provisionerd is ran by the Coder daemon
oh okay, it's a multiselect
@Thierry Chantier, just to confirm, has it ever worked in the past?
I never had it working.
I mean of course the create action from the cli
alright, i think i might know why
i'll do some testing on my end to confirm
@Thierry Chantier how are you deploying Coder?
I have tried with your template (which seems to just be the default k8s template?) and it works properly on my end.
I have deployed Coder through Helm in a dedicated
coder
workspace.I have configured the template accordingly to how I deployed Coder, so I set the namespace to
coder
could you restart Coder with the following environment variables and retry to start your workspace?
TF_LOG=debug
CODER_VERBOSE=true
CODER_PROVISIONER_DAEMON_VERBOSE=true
These variables respectively do the following things :
1. Enable debug logs for Terraform
2. Enable more verbose logs for Coder
3. Enable more verbose logs for provisionerd
, unsure whether it is useful since you don't run provisionerd
standalone
let me know how this goes, maybe we can plan a 1:1 call if needed.I’ll do that tomorrow, and answer all your questions. Thanks a lot
feel free to ping me!
So, here the status and answers.
First, I deploy Coder using the Helm method on a Kubernetes at my company, OVHcloud.
It is a managed Kubernetes cluster, the same we provide to our cusomer.
I plan to use Coder in workshop with my team when we go to conferences.
I applied your env variables and I have clues now.
First, using the CLI I now have this error:
Of course, no error of that kind when using the web UI.
So I modified the variable kubernetes_persistent_volume_claim with a hardcoded value (juste for a single test, I got the idea of variable resource name)
And then the error was now on kubernetes_deployment.
In both cases, the value is
It may explain why it works in your case.
But I don't get why it works from the web UI and not the CLI.
Did I provide enough information? Do you have a clue?
I guess we are in different timezones (and it's ok) so I try different things and I watch a lot the logs.
I noticed this warning :
As I installed and upgraded everything by the rules, even re-creating my template to have all starters up to date, I was not expecting that
Thanks for the details, I am familiar with OVHCloud but do not have an account there.
For the timezone, I suppose you're in France ?
first of all, it seems that our example template is not up-to-date because
data.coder_workspace_owner.me
is deprecated
I will update the example and send it to you in a bityou have 14h 😉
just fyi, I'm French and live in France but I'm part-time at Coder and only get to work outside of usual work hours ;-)
which works for most of US, but not great for France!
yeah you can probably ignore this one
When I upgrade Coder, do I also upgrade the starter templates?
well, sometimes yes but the templates mostly change when the Terraform provider does, and it does not change a lot / allows for most deprecated stuff for a while
generally just update the templates when they show a deprecation notice
but in this case it does show a notice and the template wasn't updated
(cc: @Atif we could probably setup some CI tests to avoid keeping deprecated templates around)
just a quick question
what's the name of your workspace?
workshop_ia
?yep, correct
welp
oh... _ is invalid ?
I think this might be the stupidest thing ever
yes
it seems like the CLI let you create something you shouldn't have been able to create
yes... looks like that was it
we really need to fix this!
@Thierry Chantier could you test this and let me know if that was the problem?
I will and it will be my first task tomorrow
then I will fill a github issue if you don't to have something better in cli 😉
don't worry, I'm already writing the issue ;-)
really sorry for the inconvenience ;-(
If it was the issue, I'm happy because I will be able to move on other questions 😉
it's great if you can move on!
but it's still bad to lose this much time on such a simple thing!
here is the issue
GitHub
CLI:
coder create
does not check/sanitize workspace name before c...Discord thread coder create checks for the name after running the terraform plan, which is fine in most cases even though it makes you lose some time. Here is what would usually happen to an user :...
ah yeah nevermind the example on GH does seem to be up-to-date, i read it wrong
using Coder is only one of my projects, but I'm glad to be able to accelerate this project
let me know if you have any questions -- I'm excited to see what you'll do with it!
I could not wait until tomorrow 😉
now I have to remove the extensive logs I have 🙂
Fixed :)
Thanks a lot for all the discussion, I will close this topic because I believe it is the way you handle this "help" channel
yes, we basically handle it like GH issues
easier to track
easier on Discord? it does not feels as good as GitHub to me but hey, who am I? 😉
/close
it is not like that 😄
yeah agreed there's some stuff we'll change to make it better
@Phorcys closed the thread.