JetBrains Space Help

Dev Environments

Dev environments are virtual machines running in the Space cloud. You can use these machines for software development instead of your local machine:

  • Your local machine works as a frontend. It runs only a thin client that is connected to a dev environment.

  • The dev environment works as a backend. It runs all heavy-weight IDE operations: processes the source code, builds indexes, compiles the code, and so on.

Dev environment structure

Supported IDEs

Space dev environments can provide backend for the following IDEs:

Get started

  1. (Windows preliminary step) JetBrains Fleet requires an SSH agent to be running on your local machine. On macOS and Linux, the SSH agent is usually running by default. On Windows, you need to run it manually. For example, to start the ssh-agent each time after reboot, use the following PowerShell snippet (run as Administrator):

    Get-Service ssh-agent | Set-Service -StartupType Automatic Start-Service ssh-agent Get-Service ssh-agent ssh-add $env:USERPROFILE\.ssh\your_ssh_key_id

    Learn more

  2. Install JetBrains Toolbox App to your local machine.

  3. Open your project in Space and find the required repository.

  4. On the repository page, click the Start coding button.

  5. Select the Dev environment tab and click Set up:

    startCodingDevEnvironment.png
  6. In the New Dev Environment window, select a project branch, a suitable instance type, JetBrains Fleet as an IDE and click Create. JetBrains Toolbox App will automatically install the required Fleet version to your machine.

  1. Install JetBrains Toolbox App to your local machine.

  2. Use JetBrains Toolbox App to install JetBrains Gateway.

  3. Open your project in Space and find the required repository.

  4. On the repository page, click the Start coding button.

  5. Select the Dev environment tab and click Set up:

    startCodingDevEnvironment.png
  6. In the New Dev Environment window, select a project branch, a suitable instance type, a required IntelliJ-based IDE and click Create. JetBrains Toolbox App will automatically install the required IDE to your machine.

That's it! Space will create a dev environment and start the selected IDE.

Note that these instructions don't include configuring your run environment, namely, choosing the proper Docker image. That's why the environment container will use the default image and the IDE will require some time to build project indexes. So, we recommend that you configure the environment for your project before using it.

How does it work

  • Creating a dev environment

    Every project repository page in Space has the Start coding button. By clicking on it and navigating to Dev environment → Set up you create a new dev environment. Learn more

  • Dedicated virtual machine and a container

    When you create a dev environment, Space assigns a dedicated virtual machine to your Space account. Dev environments are individual – only you can access your environments (though, it's possible to share your environment with other users for collaborative work).

    A dev environment is a Docker container that runs inside the dedicated virtual machine. By default, if you haven't specified a proper image, the dev environment uses the default image for the container.

  • Dev environment storage

    Each dev environment has assigned storage. When a dev environment is started for the first time, Space clones the project repository to the storage and mounts it to the dev environment.

    The directory structure looks as follows (only relevant directories are shown):

    / ├─── root // user directory with project indexes (saved during the warm-up or hibernation) │... ├─── mnt │ └─── space // saved during the warm-up or hibernation │ ├─── system // non-user system files │ └─── work │ └─── {git-repo-name} // cloned git repository (working directory) ...
  • Preparing a dev environment for a project

    Before creating a dev environment, you can configure it for your project. Typically, this should be done only once for a project.

    To configure the environment, use the .space/*.devfile.yaml file. It includes the information about an instance type, a Docker image, an IDE, and so on. Learn more about devfiles

    The devfile also lets you describe the warm-up procedure. The warm-up does whatever is needed to speed up loading the project: builds project indexes, downloads dependencies, and so on. The result of the warm-up job is a disk snapshot (a warm-up snapshot) that is mounted to the dev environment. Learn more about warm-up snapshots

  • Connecting to a dev environment

    After the dev environment is started, Space suggest you to connect to it using an editor of your choice: JetBrains Fleet or one of the IntelliJ-based IDEs with JetBrains Gateway.

  • Developing in a dev environment

    When you make changes to the code in the local editor (the frontend), they are sent to the dev environment (the backend) that takes care of the rest. Your local editor only renders the user interface and handles the communication with the backend.

  • Dev environment lifecycle

    If there's no activity with a dev environment for more than 30 minutes, Space hibernates the environment: It performs graceful shutdown for the container (docker stop), and releases the virtual machine. The dev environment automatically saves the contents of the working directory and user home directory. All uncommitted changes will be available after you restart the environment.

Last modified: 04 March 2024