DEV Community

Cover image for 🌤️ IDX and Cloud Workstations: two Google tools empowering Cloud Development
Jean-Phi Baconnais for Zenika

Posted on

🌤️ IDX and Cloud Workstations: two Google tools empowering Cloud Development

Are you familiar with Cloud Development Environments (CDEs)? They have been around for over 20 years and have taken advantage of the rise of the cloud to deploy and establish themselves in the developer's toolset.

🖥️ Develop on the cloud

For my part, I often develop on cloud environments. I was lucky to come across Gitpod in 2019 and I have been using it everyday since, whether for Zenika projects, personal projects or open source projects.

For what reasons? Gitpod can easily be used to contribute to projects hosted on GitHub and GitLab (as well as Bitbucket which I have never used). A browser extension allows you to generate a "Gitpod" button that automatically creates a development environment with the project cloned and ready. It may seem like a small thing, but it turns out to be quite handy!

Developing in the cloud allows you to escape from a lot of configuration of the right version of JDK, node, etc and to take the burden of all these installations off of my computer’s hard drives. It also allows me to reuse my 15-year-old Mac to develop! And it’s a time-saver when you are constantly switching contexts and projects.

For a team, there are also some very interesting advantages, including sharing configuration. When you are working on a project, sometimes you might need a specific extension or programming language set up. With a cloud development environment, you can share the configuration along with the source code. Your teammates will benefit from this when they open the project. No more READMEs with the list of extensions to install manually.

⛅ Google CDE

In addition to Gitpod, other CDEs have emerged, and of course Google has gotten involved. At the last Cloud Next, Google announced the general availability of its IDX project. IDX is a CDE that allows you to develop on projects hosted on GitHub (I am hoping that a GitLab integration is planned).

In this article, I will not compare the different CDEs available. My purpose here is to show how Google has invested in this field.

IDX

IDX is available at the following address: https://idx.google.com/. You only have to connect with a Google account.

IDX project

In addition to being a CDE, IDX facilitates the creation of components. For example, for Go, we are guided in the creation of a new project:

IDX - new workspace

After this step, IDX opens the newly created project:

IDX - Go project

Once you're in a project (whether new or existing on a GitHub repository), you are presented with a VScode interface. A project tree is visible on the left, a terminal is at the bottom of the screen, and a preview of your application on the right.

Just like using VScode on your own computer

IDX, like most CDEs, identifies the type of your project and the language used to prepare a command that will be executed when the project is opened. This may seem like a simple action, but it saves you from having to type the command you know, or if you don't know it, from having to look for it in the README.md file, forgetting an argument or value, and ending up with an application that doesn't start. In short, with this, you can be sure that your project is running and visible when you open the project.

*Just like using VScode on your own computer, but better 😁

🛠️ The configuration

As for configuration, everything is done in the .nix file. This file is not created by Google and is not proprietary. Nix is an open-source package manager available at https://nix.dev/.

In CDEs, all configuration files contain roughly the same information:

  • Commands to be executed when opening the project: for example, npm install or maven clean install.
  • Extensions useful for the project: for example, the golang extension.
  • Environment variables: these are variables that define the runtime environment of a program.
  • A base image: this is the container image that the project will run in. With IDX, this is the Nix version: stable-23.11 for example. With other CDEs, it could be a Golang image.

IDX - Nix configuration

One of IDX's features is the availability of integrations. These include Cloud Run, a serverless solution from Google Cloud Platform that allows you to quickly deploy a component without having to manage the infrastructure. For the moment, I haven’t tested it. We can see other extensions like Firebase, Gemini API and Google Maps Platform:

NIX - integrations

Cloud Workstations

Cloud Workstations is another CDE service created by Google. The difference with the IDX project is that Cloud Workstations covers a different use case, creating cloud development environments for companies.

The first step is to create a configuration: a Workstation. This is created after declaring general information such as its name, a Kubernetes cluster previously created on Google Cloud's Google Kubernetes Engine (GKE) product, and the machine type (memory, CPU, etc.).

Workstation - create configuration

Workstation - machine configurtion

The environment can also configure a default Docker image on which projects using this Workstation will be based. Google has created a general-purpose one, but it is possible to override this with an image of your choice.

Workstation - environment settings

From a security standpoint, Workstations can be configured to restrict access to individuals or groups of people.

Workstation - IAM policy

Once this template is initialized, it is possible to create workstations from this configuration.

Workstation - create worksation

Once these steps have been completed, the different workstations are visible and can be stopped or started, either by the users of these workstations or by GCP administrators. An interesting use case (and necessary in my opinion) is to have a scheduled shutdown at the end of the day. Because yes, these elements are deployed on GCP, have a consumption and therefore a cost.

Workstation - my workspaces

Your workstation starts up in just a few tens of seconds for the default image provided by Google. Your environment startup time will depend on the size of your base Docker image.

Once started, the IDE configured in the template opens on your workstation and you are ready to develop in an environment identical to that of the other people in your team or company. For now, you can use the following IDEs with Cloud Workstation : VsCode and Jetbrains Gateway, a Jetbrains Client to open several CDEs.

⁉️ Which one to choose?

The answer to this question is very simple. If you want to develop quickly, take IDX (provided that your project is hosted on GitHub).

This tool can also be preferred for personal and open source projects. The configuration of your environment is available in a Nix file present in the project and visible to anyone wanting to work on it.

At the time of writing this blog post, IDX is free and includes an integration with Gemini, Google's AI.

In a business context, Cloud Workstation is recommended. The people responsible for the Google Cloud infrastructure will be able to create, customize and supervise the Kubernetes cluster(s) allowing teams to work on their projects. These Workstations are secured via IAM policies and can be updated to provide new configurations, whether pertaining to extensions or the power of the machines. Of course, these infrastructures have a price. In this page, Google gives an example of the Cloud Workstation usage and for one developer. The bill could be around 200 dollars a month (so 2 400 dollars a year). It could be “expensive” for personal usage or when you are a freelance developer.

But for a company with 100 developers, the price could be reduced to 75 dollars / developer / month. The price decrease comes from the cost of the cluster, which is present for 1 or 100 developers.

Compared to the cost of 100 developing computers to buy and maintain, Cloud Workstation is very interesting. Companies are starting to look at these Cloud solutions for their development team who can keep their personal computers for longer.

This is a big move for developers. They can use their favorite IDE, with nothing to configure except one client and use a project configured on the Cloud. I think that facilitation is very important to have the best experience on this switch. L’Oréal, a big company, decided to make this move and explains their choice in a blog post published in January, 2023.

Thanks to William & Moustapha for the review

Top comments (0)