“GitHub Codespaces”? “Prebuilds”? What do all of those words mean?
GitHub has a service called Codespaces where they host a Linux VM for you. You can configure them using dev containers. This lets you specify the dev environment that works for your repository (in our case, a Dockerfile and some commands to run). A prebuild is effectively a building of the dev container that GitHub caches for people to use so they don’t have to do all the initial building and such.
Why should I care?
Two reasons. One, because GitHub Codespaces works entirely in the browser thanks to https://vscode.dev , this is a very easy way to get someone going during sprints. You can go from the repo’s page on GitHub to a running terminal that has the python binary and docs already built in less than a minute (I consistently launch in under 45 seconds). I have also provided some initial settings and extensions for VS Code to make it as easy as possible for someone to get up and sprinting on the code base.
Two, it means everyone has access to a Linux dev environment now. I have also gone ahead and installed the toolchain for WASI in there since that also works under Linux.
Does this mean we have a Dockerfile for CPython development?
Yep! It’s Fedora-based as a thanks to our friends on the Fedora project and to get free technical support.
No! While the default experience is “VS Code in the browser”, you can actually use VS Code desktop if you prefer (see the docs). JetBrains IDEs are also supported.
And if you’re a terminal editor person, you can always just launch VS Code and maximize the terminal and ignore everything else.
How much does Codespaces cost?
Everyone gets 120 CPU-hours free every month (and this is time having the Codespace open and running, not simply processing, since you’re reserving a VM). The available machines start at 2 cores, so that’s 60 hours/month. There are also 4, 8, and 16-core machines if you want such things and use more of your quota.
If you find you are liking Codespaces but are running out of free quota, please reach out to the SC and let us know as we can talk about getting you some funding for more usage.
Yes. You can go to Sign in to GitHub · GitHub and look at the “Codespaces” part to see how much quota you have.
Yes. While we are paying to have the prebuilds, that’s not a prerequisite to use Codespaces with a repository.
If you’re used to PowerShell we could consider installing that as an available shell (we also install zsh and fish by default). You can then configure VS Code with which shell you want to be the default for you (e.g. I have VS Code set to launch fish automatically instead of bash).
Correct, there’s no X server running to then somehow forward the window to the user’s machine. There might be a way to set that up, though, for someone who knows that much about X servers.
Yep, just like how it won’t work for macOS or Windows-specific sprinters either.
Thanks for adding this, I use codespaces extensively and now it will be much faster.
Our CI uses Ubuntu based image and so does the default GitHub Codespaces and I am very much used to ubuntu, did you consider using an ubuntu based image instead?
It would be nice to have same toolchain as used on CI for development.
Couple of things which are missing from image and would be useful to have in the docker image are gh cli and wget which I use frequently to review PRs.
I generally uses Debian or Ubuntu. Are these commands not usable in Fedora?
Or is my codespace broken?
[root@codespaces-abcfa4 shared]# ps
bash: ps: command not found
[root@codespaces-abcfa4 shared]# top
bash: top: command not found
[root@codespaces-abcfa4 shared]# vmstat
bash: vmstat: command not found