Develop in Dev Environments
A dev environment is a containerized workspace hosted remotely. It includes source code, an IDE backend, and required development tools. You can use dev environments for software development instead of your local machine:
Your local machine works as a frontend. It runs only a client (e.g., JetBrains Gateway) 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.
This section covers the most common user tasks related to developing in dev environments:
- Prepare Local Machine
- Open Code
- Push Changes
- Stop Dev Environment
- Personalize IDE
- Access via SSH
- Forward Ports
- Develop Desktop Apps
- Get Logs
How dev environments work
Creating a dev environment
Normally, you start your work by running JetBrains Gateway – a client application that connects to CodeCanvas and let you create a dev environment for a specific project. Learn more
Dedicated container
When you create a dev environment, CodeCanvas assigns a dedicated container to your account. Dev environments are individual – only you can access your environments.
By default, if the administrator hasn't specified a specific Docker image, the dev environment uses the default image for the container.
Dev environment storage
Each dev environment has an assigned storage. When a dev environment is started for the first time, CodeCanvas 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 stop) │... ├─── mnt │ └─── jetbrains // saved during the warm-up or stop │ ├─── system // non-user system files │ └─── work │ └─── {git-repo-name} // cloned git repository (working directory) │... ├─── var │ └─── lib │ └─── docker // Docker data ...Preparing a dev environment for a project
Before creating a dev environment, you can configure it for your project. Typically, this should be done by a namespace administrator once for a project. Learn more
Connecting to a dev environment
After the dev environment is started, you connect to it using JetBrains Gateway (for JetBrains IDEs) or VS Code.
You can also connect to a dev environment using SSH. Learn more
Developing in a dev environment
When you make changes to the code in the local client (the frontend), they're sent to the dev environment (the backend) that takes care of the rest. Your local client only renders the user interface and handles the communication with the backend.
When you push changes to the repository for the first time, CodeCanvas asks you to provide your Git credentials. Learn more
Dev environment lifecycle
If there is no activity with a dev environment for more than 30 minutes (the default timeout), CodeCanvas stops the environment: It performs graceful shutdown for the container (
docker stop
). 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.The activity in this context means any interaction with the dev environment via the IDE or SSH. For example, if you run a build and minimize the IDE window, the environment will be stopped after 30 minutes regardless of the build status.
Note that the dev environment will be stopped anyway after 48 hours of continuous work (this default timeout can be changed by a system administrator).