JetBrains CodeCanvas 2024.1 Help

Configure Dev Environments

Dev environment template

Before users can start working on a project in remote dev environments, the namespace administrator should create a dev environment template.

A dev environment template is a set of predefined settings used as a basis for creating the environments. The template defines: a dev environment image, an IDE, resources, a Git repository and branch, and other settings.

When users create a dev environment, they can choose from the templates available for their account.

Selecting a template in Gateway

Create a template

  1. Find the namespace in which you want to create a repository.

  2. On the sidebar namespace menu, select Templates and click New template.

  3. Specify basic settings:

    Basic settings
    • Name – a name for the template. Try to make it descriptive and include the project name in it – in JetBrains Gateway users choose from the unsorted list of all templates available for their account.

    • Git repository – a Git repository with the project sources.

    • Instance type – a dev environment instance type (CPU, memory, disk). The list of available instance types is defined by the system administrator. Learn more

    • IDE and IDE Version – an IDE and its version that will be used to open the project in a dev environment. If you leave Default as an IDE version, the system will use the version specified as default by the system administrator. Learn more

  4. Click Create.

  5. Specify other template settings.

    Create a template
    Project settings
    • Checkout branch – the branch that CodeCanvas must check out from the project repository.

    • Project root – after a user starts a dev environment, the IDE opens a project root directory. By default, the project root is the repository root. Here you can specify an alternative project root location (relative to the repository root). This might be helpful for mono-repositories which include multiple projects.

    • Environment variables – a list of environment variables that will be set in the dev environment. Plain text values only. Use it to pass non-sensitive data, e.g., URLs, paths, or various configuration settings. For sensitive data, use personal parameters.

    Performance and costs

    You can speed up the startup of dev environments based on this template with:

    • Warm-up – a process of pre-building data for a dev environment. Learn more

    • Standby pool – a pool of running dev environments that are ready to be used. Learn more

    • Auto-stop – specify the Inactivity timeout (minutes)– the period of inactivity after which the dev environment will be automatically stopped.

      Important: The dev environment will be stopped anyway after 48 hours of continuous work. A system administrator can change this default limit during the installation using the application.config.codecanvas.execution.k8s.worker.activeDeadline parameter of the Helm chart.

      What does inactivity mean?

      A dev environment is considered inactive if:

      • The user doesn't perform any actions in the IDE client (mouse clicks, keyboard input) or in SSH sessions (commands execution).

      • The user closes the client; that is, they close the IDE window (while keeping the dev environment running) or put the computer to sleep/turn it off.

      Inactivity time doesn't include any other background activities. For example, if the user runs a build and minimizes the IDE window, the dev environment will be stopped after the inactivity timeout regardless of the build process.

      Known issue: If a process writes to the console, the dev environment is considered active. Temporary workaround: Closing the IDE client starts the inactivity timer anyway.

    Personal parameters

    A list of environment variables and files with sensitive personal data required for development, e.g., user credentials, API keys, and so on. Learn more

    Access

    Define who can use this template to create dev environments:

    • Only selected users – explicitly specify users who can use this template.

      Even if a user is not in the list, they can still view and use templates in the namespace if they fall under one of the following categories:

      • System administrators

      • Namespace administrators of this namespace

      • Users with the Manage all repository connections and Manage all dev environment templates permissions in this namespace

      This refers only to the CodeCanvas user interface. They won't see these templates in the JetBrains Gateway.

    • All users (conditions apply) – all CodeCanvas users can use this template.

      If All users (conditions apply) is selected, any user in CodeCanvas can create a dev environment and view the Git repository contents. They can do this even if they don't have access to the repository on the Git server. To prevent this, you can restrict access to the Git repository using the repository's Read restrictions setting. Learn more

    Lifecycle scripts
    • Scripts that run at a certain stage of the dev environment lifecycle. Learn more

    Advanced
    • SSH – if enabled, users can connect to dev environments using SSH.

    • VM options – configuration options of Java Virtual Machine (JVM) that runs the IDE. For example, you can increase the heap size allocated for the IDE, e.g., -Xms2048m, -Xmx4096m.

    • Dev container image – a Docker image for a dev environment container. If you don't provide a custom image, CodeCanvas uses the default image. Learn more

    • Cloud policy – a policy that defines access to cloud resources, e.g., a database in Amazon RDS, a storage in Amazon S3, and so on. All the required credentials will be automatically injected into the dev environment. A system administrator can define cloud policies for the namespace. Learn more

  6. Click Save or Save and run dev environment to save the template and quickly create a dev environment based on it.

Last modified: 02 July 2024