After 15 months in preview, GitHub releases Codespaces – probably the fanciest new shiny since Actions

Teams and Enterprise only for now

GitHub's Codespaces, cloud-based development environments that have been in preview since May 2020, are finally here. Prices range from $0.18 to $2.88 per hour.

First introduced at the GitHub Satellite virtual event in 2020, Codespaces are perhaps the biggest new feature of GitHub since Actions in 2018.

The idea of developing in an online environment is far from new. Microsoft (owner of GitHub) offered this as Visual Studio Online from late 2019, while Gitpod has offered online environments since July 2018.

The long gestation of Codespaces has resulted in a number of improvements since the first preview. Secrets management, a missing feature at the beginning, is now built into GitHub. Users can define secrets in their GitHub settings and associate them with repositories, and these then appear in Codespaces as environment variables. It is important for security not to include credentials in the repository itself.

A GitHub Codespace

Codespaces has been released for paid-for plans, not yet for individuals

GitHub released Codespaces yesterday for organisations using Team and Enterprise plans. Individuals can continue to use the Codespaces beta if they have succeeded in obtaining access. GitHub said: "We'll share updates on what's coming in the near future."

Codespaces are free until 10 September, though limited to 10 per user account. After that they will be charged pay-as-you-go when active, with prices starting at $0.18 per hour for 2 cores and 4GB RAM, to 32 cores and 64GB at $2.88 per hour, both billed per second. Using the highest spec for, say, eight hours a day, five days a week, would work out around $6,000 per year, while the cheapest option would come to $375 or thereabouts.

Codespaces prices, which apply from September 10th

Codespaces prices, which apply from 10 September

GitHub has another neat feature called, which will remain free. When in a code repository, press the full stop character and an editor opens using a lightweight Codespace. What this means is that any file can be edited in the browser using a cut-down browser version of Visual Studio Code – which is very like the desktop version, bearing in mind that it was written using web technology with exactly this purpose in mind. There is no run or debug option in this lightweight environment, and clicking to debug prompts a dialog offering to continue either by cloning the repository locally or by starting a full Codespace.

The docs say: "When you create a Codespace, a shallow clone of your repository is made on a Linux virtual machine that is both dedicated and private to you." Although this is a VM, the development environment is a container, using either a default image or one that the developer defines. The container is persistent but the VM is recreated every time the Codespace is restarted, which means it is fully patched and up to date. The VM is terminated automatically after 30 minutes of inactivity.

Press dot in any repository and get a basic VS Code editor

Press dot in any repository and get a basic VS Code editor. This is a free feature.

There are multiple ways to work with a Codespace. The default is browser-based VS Code remoted to the Codespace. Another option is to launch the Codespace as a PWA (Progressive Web Application), which can help with things like keyboard shortcuts and permissions. A third possibility is to run Visual Studio Code on the desktop with remoting into the Codespace. All three are similar but give a slightly different developer experience. The browser-based version has some limitations, such as inability to launch another browser instance in debug mode, for security reasons. It is not essential to use VS Code at all: it is possible to use ssh (secure shell) to open a remote terminal and use an editor like Vim or Emacs.

GitHub's senior director of engineering, Corey Wilkerson, said yesterday that GitHub itself has migrated most of its internal development from macOS to Codespaces. He said there were frustrations with the macOS approach.

"Mysterious breakage was so common and catastrophic that we'd codified an option for our bootstrap script: --nuke-from-orbit," he claimed. The move to Codespaces was "an opportunity to treat our dev environments much like we do infrastructure — a commodity we can churn." However, the early Codespaces experiments were frustrating since the code for GitHub itself is "almost 13GB" and cloning the repository took 20 minutes. This was the reason for another feature, now in preview, called prebuilds, which builds a Codespace automatically every time a change is pushed to the repository. This is then ready for use by a new developer.

"New hires can go from zero to a functioning development environment in less time than it takes to install Slack," said Wilkerson.

We gave the current Codespaces a quick try. It was quick with our smallish ASP.NET core repository and worked immediately. Once created, restarting the Codespace takes only 10-15 seconds. Running and debugging worked first time, and the database connection was sorted by adding a secret as described above. We also successfully used a Codespace on iPad Air, using side-by-side windows to run and debug a browser-based application. The version of Linux in the default Codespace is Ubuntu 18.04, which seems a tad old given that 20.04 LTS has been available for over a year.

It is a powerful model, though potentially expensive, and although the remote and disposable development approach solves some problems, it also introduces friction of its own. One is what happens if GitHub has reliability issues, as happened on 10 August with Actions (three hours of "degraded performance") and today with Codespaces (two hours of "degraded performance"). Still, bearing in mind the pressure on developers, maybe a little enforced downtime has some appeal. ®

Similar topics

Other stories you might like

  • Heart FM's borkfast show – a fine way to start your day

    Jamie and Amanda have a new co-presenter to contend with

    There can be few things worse than Microsoft Windows elbowing itself into a presenting partnership, as seen in this digital signage for the Heart breakfast show.

    For those unfamiliar with the station, Heart is a UK national broadcaster with Global as its parent. It currently consists of a dozen or so regional stations with a number of shows broadcast nationally. Including a perky breakfast show featuring former Live and Kicking presenter Jamie Theakston and Britain's Got Talent judge, Amanda Holden.

    Continue reading
  • Think your phone is snooping on you? Hold my beer, says basic physics

    Information wants to be free, and it's making its escape

    Opinion Forget the Singularity. That modern myth where AI learns to improve itself in an exponential feedback loop towards evil godhood ain't gonna happen. Spacetime itself sets hard limits on how fast information can be gathered and processed, no matter how clever you are.

    What we should expect in its place is the robot panopticon, a relatively dumb system with near-divine powers of perception. That's something the same laws of physics that prevent the Godbot practically guarantee. The latest foreshadowing of mankind's fate? The Ethernet cable.

    By itself, last week's story of a researcher picking up and decoding the unintended wireless emissions of an Ethernet cable is mildly interesting. It was the most labby of lab-based demos, with every possible tweak applied to maximise the chances of it working. It's not even as if it's a new discovery. The effect and its security implications have been known since the Second World War, when Bell Labs demonstrated to the US Army that a wired teleprinter encoder called SIGTOT was vulnerable. It could be monitored at a distance and the unencrypted messages extracted by the radio pulses it gave off in operation.

    Continue reading
  • What do you mean you gave the boss THAT version of the report? Oh, ****ing ****balls

    Say what you mean

    NSFW Who, Me? Ever written that angry email and accidentally hit send instead of delete? Take a trip back to the 1990s equivalent with a slightly NSFW Who, Me?

    Our story, from "Matt", flings us back the best part of 30 years to an era when mobile telephones were the preserve of the young, upwardly mobile professionals and fixed lines ruled the roost for more than just your senior relatives.

    Back then, Matt was working for a UK-based fixed-line telephone operator. He was dealing with a telephone exchange which served a relatively large town. "I ran a reasonably ordinary, read-only command to interrogate a specific setting," he told us.

    Continue reading

Biting the hand that feeds IT © 1998–2021