blob: 13a6e35238a85ec35425ef958f0e0d0e503dea1e [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Authoring devfiles version 1 :: Eclipse Che Documentation</title>
<link rel="canonical" href="https://www.eclipse.org/che/docs/che-7/end-user-guide/authoring-devfiles-version-1/">
<meta name="keywords" content="end-user-guide, authoring-devfiles-version-1">
<meta name="generator" content="Antora 2.3.4">
<link rel="stylesheet" href="../../../_/css/site.css">
<link rel="stylesheet" href="../../../_/css/extra.css">
<link rel="stylesheet" href="../../../_/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="icon" href="../../../favicon.ico" type="image/x-icon">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-37306001-2"></script>
<script>function gtag(){dataLayer.push(arguments)};window.dataLayer=window.dataLayer||[];gtag('js',new Date());gtag('config','UA-37306001-2')</script>
<script>var uiRootPath = '../../../_'</script>
</head>
<body class="article">
<header class="header" role="banner">
<nav class="navbar">
<div class="navbar-brand">
<div class="navbar-item">
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
<img src="../../../_/img/icon-eclipse-che.svg" class="navbar-logo" alt="Eclipse Che logo">
<a href="https://www.eclipse.org/che/docs">Eclipse Che Documentation</a>
</div>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<div class="navbar-item hide-for-print">
<script async src="https://cse.google.com/cse.js?cx=002898025167115630151:gnr5edrg2eo"></script>
<div class="gcse-searchbox" enableAutoComplete="true"></div>
</div>
<a class="navbar-item" href="https://www.eclipse.org/che/docs">Home</a>
<a class="navbar-item" href="https://che.eclipse.org/">Blog</a>
<a class="navbar-item" href="https://github.com/eclipse/che">Source Code</a>
</div>
</div>
</nav>
<div class="gcse-searchresults"></div>
</header><div class="body">
<div class="nav-container" data-component="che-7" data-version="master">
<aside class="nav">
<div class="panels">
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<h3 class="title"><a href="../../overview/introduction-to-eclipse-che/">Documentation</a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../overview/introduction-to-eclipse-che/">Introduction to Che</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../overview/che-architecture/">Che architecture</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../hosted-che/hosted-che/">Eclipse Che hosted by Red Hat</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<button class="nav-item-toggle"></button>
<span class="nav-text">End-user Guide</span>
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../navigating-che/">Navigating Che</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../navigating-che-using-the-dashboard/">Navigating Che: dashboard</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../importing-certificates-to-browsers/">Importing certificates to browsers</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../accessing-che-from-openshift-developer-perspective/">Navigating Che from OpenShift Developer Perspective</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../che-theia-ide-basics/">Che-Theia IDE basics</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../defining-custom-commands-for-che-theia/">Defining custom commands for Che-Theia</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../version-control/">Version Control</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../che-theia-troubleshooting/">Che-Theia Troubleshooting</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../differences-in-how-che-theia-webview-works-on-a-single-host-mode-comparing-to-a-multi-host-mode/">Differences in how Che-Theia Webview works on a single-host mode comparing to a multi-host mode</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../workspaces-overview/">Using developer workspaces</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../creating-a-workspace-from-code-sample/">Creating a workspace from code sample</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../creating-a-workspace-from-remote-devfile/">Creating a workspace from a remote devfile using the dashboard</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../creating-a-workspace-from-local-devfile-using-chectl/">Creating a workspace from local devfile using chectl</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../creating-a-workspace-by-importing-the-source-code-of-a-project/">Creating a workspace by importing the source code of a project</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../configuring-a-workspace-with-dashboard/">Configuring a workspace</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../running-a-workspace-with-dashboard/">Running a workspace</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../importing-kubernetes-applications-into-a-workspace/">Importing Kubernetes applications into a workspace</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../remotely-accessing-workspaces/">Remotely accessing workspaces</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../mounting-a-secret-as-a-file-or-an-environment-variable-into-a-workspace-container/">Mounting a secret as a file or an environment variable into a workspace container</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../authenticating-on-scm-server-with-a-personal-access-token/">Authenticating on SCM Server with a personal access token</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../authoring-devfiles/">Authoring devfiles</a>
<ul class="nav-list">
<li class="nav-item is-current-page" data-depth="2">
<a class="nav-link" href="./">Authoring devfiles version 1</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../authoring-devfiles-version-2/">Authoring devfiles version 2</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../customizing-developer-environments/">Customizing developer environments</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../what-is-a-che-theia-plug-in/">What is a Che-Theia plug-in</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../adding-a-vs-code-extension-to-a-workspace/">Adding a VS Code extension to a workspace</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../adding-a-vs-code-extension-to-the-che-plugin-registry/">Adding a VS Code extension to the Che plug-ins registry</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../publishing-metadata-for-a-vs-code-extension/">Publishing a VS Code extension</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../testing-a-visual-studio-code-extension-in-che/">Testing a VS Code extension in Che</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../using-alternative-ides-in-che/">Using alternative IDEs in Che</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../support-for-jetbrains-ides/">JetBrains IDEs</a>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../using-jetbrains-intellij-idea-community-edition/">Using IntelliJ Idea Community Edition</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../using-jetbrains-intellij-idea-ultimate-edition/">Using IntelliJ Idea Ultimate Edition</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../configuring-an-existing-workspace-to-use-intellij-idea/">Configuring an existing workspace to use IntelliJ IDEA</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../using-jetbrains-webstorm/">Using WebStorm</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../provisioning-jetbrains-activation-code-for-offline-use/">Provisioning activation code for offline use</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../support-for-theia-based-ides/">Theia-based IDEs</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../adding-tools-to-che-after-creating-a-workspace/">Adding tools to Che after creating a workspace</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../using-private-container-registries/">Using private container registries</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../using-artifact-repositories-in-a-restricted-environment/">Using artifact repositories in a restricted environment</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../using-maven-artifact-repositories/">Using Maven artifact repositories</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../using-gradle-artifact-repositories/">Using Gradle artifact repositories</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../using-python-artifact-repositories/">Using Python artifact repositories</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../using-go-artifact-repositories/">Using Go artifact repositories</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../using-nuget-artifact-repositories/">Using NuGet artifact repositories</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../using-npm-artifact-repositories/">Using npm artifact repositories</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../troubleshooting-che/">Troubleshooting Che</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../viewing-che-workspaces-logs/">Viewing Che workspaces logs</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../investigating-failures-at-a-workspace-start-using-the-verbose-mode/">Troubleshooting workspace start failures</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../troubleshooting-slow-workspaces/">Troubleshooting slow workspaces</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../troubleshooting-network-problems/">Troubleshooting network problems</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<button class="nav-item-toggle"></button>
<span class="nav-text">Installation Guide</span>
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../installation-guide/supported-platforms/">Supported platforms</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../installation-guide/configuring-the-che-installation/">Configuring the Che installation</a>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../installation-guide/installing-che/">Installing Che</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../installation-guide/installing-che-in-cloud/">Installing Che in cloud</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-openshift-4-using-operatorhub/">Installing Che on OpenShift 4 using OperatorHub</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-openshift-4-using-cli/">Installing Che on OpenShift 4 using CLI</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-openshift-3-using-the-operator/">Installing Che on OpenShift 3</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-kubespray/">Installing Che on Kubespray</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-aws/">Installing Che on AWS</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-google-cloud-platform/">Installing Che on Google Cloud</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-microsoft-azure/">Installing Che on Microsoft Azure</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../installation-guide/installing-che-locally/">Installing Che locally</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-codeready-containers/">Installing Che on CodeReady Containers</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-docker-desktop/">Installing Che on Docker Desktop</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-minikube/">Installing Che on Minikube</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-minishift/">Installing Che on Minishift</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../installation-guide/installing-che-on-kind/">Installing Che on Kind</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/using-the-chectl-management-tool/">Using the chectl management tool</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/installing-che-in-a-restricted-environment/">Installing Che in restricted environment</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../installation-guide/advanced-configuration/">Advanced configuration</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/advanced-configuration-options-for-the-che-server-component/">Advanced configuration options for Che server</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-namespace-strategies/">Configuring workspace target namespace</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-storage-strategies/">Configuring storage strategies</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-storage-types/">Configuring storage types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-the-number-of-workspaces-that-a-user-can-run/">Configuring the number of workspaces that a user can run</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-the-number-of-workspaces-that-a-user-can-create/">Configuring the number of workspaces that a user can create</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-workspace-exposure-strategies/">Configuring workspace exposure strategies</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-workspaces-nodeselector/">Configuring workspaces nodeSelector</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-che-hostname/">Configuring Che hostname</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-ingresses/">Configuring Kubernetes Ingress</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/configuring-routes/">Configuring OpenShift Route</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/deploying-che-with-support-for-git-repositories-with-self-signed-certificates/">Deploying Che with support for Git repositories with self-signed certificates</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/installing-che-using-storage-classes/">Installing Che using storage classes</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/importing-untrusted-tls-certificates/">Importing untrusted TLS certificates to Che</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/switching-between-external-and-internal-communication/">Switching between external and internal ways in inter-component communication</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/setting-up-the-keycloak-che-username-readonly-theme-for-the-eclipse-che-login-page/">Setting up the Keycloak che-username-readonly theme for the Eclipse Che login page</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-container/">Mounting a Secret or a ConfigMap as a file or an environment variable into a Eclipse&#160;Che container</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/enabling-dev-workspace-engine/">Enabling Dev Workspace engine</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../installation-guide/upgrading-che/">Upgrading Che</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/upgrading-che-using-operatorhub/">Upgrading Che using OperatorHub</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/upgrading-che-using-the-cli-management-tool/">Upgrading Che using the CLI management tool</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/upgrading-che-using-the-cli-management-tool-in-restricted-environment/">Upgrading Che in restricted environment</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/upgrading-che-namespace-strategies-other-than-per-user/">Updating Che namespace strategies other than 'per user'</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../installation-guide/uninstalling-che/">Uninstalling Che</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/uninstalling-che-after-operatorhub-installation-using-openshift-web-console/">Using the OpenShift web console</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/uninstalling-che-after-operatorhub-installation-using-openshift-cli/">Using OpenShift CLI</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../installation-guide/uninstalling-che-after-chectl-installation/">Using chectl</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<button class="nav-item-toggle"></button>
<span class="nav-text">Administration Guide</span>
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../administration-guide/che-architecture-overview/">Che architecture</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/che-workspace-controller/">Che workspace controller</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/che-workspaces-architecture/">Che workspaces architecture</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../administration-guide/calculating-che-resource-requirements/">Calculating Che resource requirements</a>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../administration-guide/customizing-the-registries/">Customizing the registries</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/building-custom-registry-images/">Building custom registry images</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/running-custom-registries/">Running custom registries</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../administration-guide/retrieving-che-logs/">Retrieving Che logs</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/configuring-server-logging/">Configuring server logging</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/viewing-kubernetes-events/">Accessing Kubernetes events on OpenShift</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/viewing-operator-events/">Viewing the Operator events on OpenShift</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/viewing-che-server-logs/">Viewing Che server logs</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/viewing-external-service-logs/">Viewing external service logs</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/viewing-plug-in-broker-logs/">Viewing Plug-in broker logs</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/collecting-logs-using-chectl/">Collecting logs using chectl</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../administration-guide/monitoring-che/">Monitoring Che</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../administration-guide/tracing-che/">Tracing Che</a>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../administration-guide/backup-and-disaster-recovery/">Backup and disaster recovery</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/external-database-setup/">External database setup</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/persistent-volumes-backups/">Persistent Volumes backups</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../administration-guide/caching-images-for-faster-workspace-start/">Caching images for faster workspace start</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/defining-the-list-of-images-to-pull/">Defining the list of images</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/defining-the-memory-parameters-for-the-image-puller/">Defining the memory settings</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/installing-image-puller-using-che-operator/">Installing using the Che Operator</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/installing-image-puller-on-kubernetes-using-the-image-puller-operator/">Installing using the Kubernetes Image Puller Operator</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/installing-image-puller-on-openshift-using-operatorhub/">Installing on OpenShift 4</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/installing-image-puller-on-openshift-using-openshift-templates/">Installing on OpenShift 3</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/installing-image-puller-on-kubernetes-using-helm/">Installing using Helm</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../administration-guide/managing-identities-and-authorizations/">Managing identities and authorizations</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/authenticating-users/">Authenticating users</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/authorizing-users/">Authorizing users</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/configuring-authorization/">Configuring authorization</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/configuring-openshift-oauth/">Configuring OpenShift OAuth</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../administration-guide/removing-user-data/">Removing user data</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<button class="nav-item-toggle"></button>
<span class="nav-text">Contributor Guide</span>
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../contributor-guide/branding-che-theia/">Branding Che-Theia</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../contributor-guide/developing-che-theia-plug-ins/">Developing Che-Theia plug-ins</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../contributor-guide/testing-che-theia-plug-ins/">Testing Che-Theia plug-ins</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../contributor-guide/publishing-che-theia-plug-ins/">Publishing Che-Theia plug-ins</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../contributor-guide/adding-support-for-a-new-language/">Adding support for a new language</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../contributor-guide/adding-support-for-a-new-debugger/">Adding support for a new debugger</a>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../contributor-guide/che-extensibility-reference/">Che extensibility reference</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../contributor-guide/che-extension-points/">Che extension points</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../contributor-guide/che-theia-plug-in-api/">Che-Theia plug-in API</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../contributor-guide/debug-adapter-protocol/">Debug Adapter Protocol</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../contributor-guide/language-server-protocol/">Language Server Protocol</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<button class="nav-item-toggle"></button>
<span class="nav-text">Extensions</span>
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../extensions/eclipse-che4z/">eclipse-che4z.adoc</a>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../extensions/openshift-connector-overview/">OpenShift Connector</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extensions/features-of-openshift-connector/">Features of OpenShift Connector</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extensions/installing-openshift-connector-in-che/">Installing OpenShift Connector in Eclipse Che</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extensions/authenticating-with-openshift-connector-from-che/">Authenticating with OpenShift Connector from Eclipse Che</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extensions/creating-components-with-openshift-connector-in-che/">Creating Components with OpenShift Connector in Eclipse Che</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extensions/connecting-source-code-from-github-to-a-openshift-component-using-openshift-connector/">Connecting source code from GitHub to a OpenShift Component</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../extensions/telemetry/">Telemetry</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extensions/creating-a-telemetry-plugin/">Creating A Telemetry Plugin</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extensions/the-woopra-telemetry-plugin/">The Woopra Telemetry Plugin</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../extensions/java-lombok/">Java Lombok</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../glossary/che-glossary/">Che glossary</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title">Documentation</span>
<span class="version">master</span>
</div>
<ul class="components">
<li class="component is-current">
<a class="title" href="../../overview/introduction-to-eclipse-che/">Documentation</a>
<ul class="versions">
<li class="version is-current is-latest">
<a href="../../overview/introduction-to-eclipse-che/">master</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main class="article">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../overview/introduction-to-eclipse-che/" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="../../overview/introduction-to-eclipse-che/">Documentation</a></li>
<li>End-user Guide</li>
<li><a href="../authoring-devfiles/">Authoring devfiles</a></li>
<li><a href="./">Authoring devfiles version 1</a></li>
</ul>
</nav>
<div class="edit-this-page"><a href="https://github.com/eclipse/che-docs/edit/master/modules/end-user-guide/pages/authoring-devfiles-version-1.adoc">Edit this Page</a></div>
</div>
<div class="content">
<aside class="toc sidebar" data-title="Contents" data-levels="2">
<div class="toc-menu"></div>
</aside>
<article class="doc">
<h1 class="page">Authoring devfiles version 1</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This section explains the concept of a devfile and how to configure a Che workspace by using a devfile of the 1.0 specification.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="what-is-a-devfile_che"><a class="anchor" href="#what-is-a-devfile_che"></a>What is a devfile</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A devfile is a file that describes and define a development environment:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The source code.</p>
</li>
<li>
<p>The development components, such as browser IDE tools and application runtimes.</p>
</li>
<li>
<p>A list of pre-defined commands.</p>
</li>
<li>
<p>Projects to clone.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>A devfiles is a YAML file that Che consumes and transforms into a cloud workspace composed of multiple containers. It is possible to store a devfile remotely or locally, in any number of ways, such as:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>In a git repository, in the root folder, or on a feature branch.</p>
</li>
<li>
<p>On a publicly accessible web server, accessible through HTTP.</p>
</li>
<li>
<p>Locally as a file, and deployed using <code>chectl</code>.</p>
</li>
<li>
<p>In a collection of devfiles, known as a <a href="../../administration-guide/customizing-the-registries/#understanding-the-che-registries_che" class="page">devfile registry</a>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>When creating a workspace, Che uses that definition to initiate everything and run all the containers for the required tools and application runtimes. Che also mounts file-system volumes to make source code available to the workspace.</p>
</div>
<div class="paragraph">
<p>Devfiles can be versioned with the project source code. When there is a need for a workspace to fix an old maintenance branch, the project devfile provides a definition of the workspace with the tools and the exact dependencies to start working on the old branch. Use it to instantiate workspaces on demand.</p>
</div>
<div class="paragraph">
<p>Che maintains the devfile up-to-date with the tools used in the workspace:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Elements of the project, such as the path, git location, or branch.</p>
</li>
<li>
<p>Commands to perform daily tasks such as build, run, test, and debug.</p>
</li>
<li>
<p>The runtime environment with its container images needed for the application to run.</p>
</li>
<li>
<p>Che-Theia plug-ins with tools, IDE features, and helpers that a developer would use in the workspace, for example, Git, Java support, SonarLint, and Pull Request.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="a-minimal-devfile_che"><a class="anchor" href="#a-minimal-devfile_che"></a>A minimal devfile</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The following is the minimum content required in a devfile:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://redhat-developer.github.io/devfile/devfile#apiversion">apiVersion</a></p>
</li>
<li>
<p><a href="https://redhat-developer.github.io/devfile/devfile#metadata">metadata name</a></p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: che-in-che-out</code></pre>
</div>
</div>
<div class="paragraph">
<p>For a complete devfile example, see <a href="https://raw.githubusercontent.com/eclipse-che/che-server/main/devfile.yaml">Eclipse&#160;Che in Che devfile.yaml</a>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>A choice of use of the parameter <code>generateName</code> or <code>name</code> is optional, but only one of these parameters has to be chosen by a user and defined.
When both attributes are specified, <code>generateName</code> is ignored.
See <a href="#generating-workspace-names_che">Generating workspace names</a>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">metadata:
generatedName:</code></pre>
</div>
</div>
<div class="paragraph">
<p>or</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">metadata:
name:</code></pre>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="generating-workspace-names_che"><a class="anchor" href="#generating-workspace-names_che"></a>Generating workspace names</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To specify a prefix for automatically generated workspace names, set the <code>generateName</code> parameter in the devfile:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
generateName: che-</code></pre>
</div>
</div>
<div class="paragraph">
<p>The workspace name will be in the <code>&lt;generateName&gt;YYYYY</code> format (for example, <code>che-2y7kp</code>). <code>Y</code> is random <code>[a-z0-9]</code> character.</p>
</div>
<div class="paragraph">
<p>The following naming rules apply when creating workspaces:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>When <code>name</code> is defined, it is used as the workspace name: <code>&lt;name&gt;</code></p>
</li>
<li>
<p>When only <code>generateName</code> is defined, it is used as the base of the generated name: <code>&lt;generateName&gt;YYYYY</code></p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>For workspaces created using a factory, defining <code>name</code> or <code>generateName</code> has the same effect. The defined value is used as the name prefix: <code>&lt;name&gt;YYYYY</code> or <code>&lt;generateName&gt;YYYYY</code>. When both <code>generateName</code> and <code>name</code> are defined, <code>generateName</code> takes precedence.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="writing-a-devfile-for-your-project_che"><a class="anchor" href="#writing-a-devfile-for-your-project_che"></a>Writing a devfile for a project</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This section describes how to create a minimal devfile for your project and how to include more than one projects in a devfile.</p>
</div>
<div class="sect2">
<h3 id="preparing-a-minimal-devfile_che"><a class="anchor" href="#preparing-a-minimal-devfile_che"></a>Preparing a minimal devfile</h3>
<div class="paragraph">
<p>A minimal devfile sufficient to run a workspace consists of the following parts:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Specification version</p>
</li>
<li>
<p>Name</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="title">Example of a minimal devfile with no project</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: minimal-workspace</code></pre>
</div>
</div>
<div class="paragraph">
<p>Without any further configuration, a workspace with the default editor is launched along with its default plug-ins, which are configured on the Che Server. Che-Theia is configured as the default editor along with the <strong>Che Machine Exec</strong> plug-in. When launching a workspace within a Git repository using a factory, the project from the given repository and branch is be created by default. The project name then matches the repository name.</p>
</div>
<div class="paragraph">
<p>Add the following parts for a more functional workspace:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>List of components: Development components and user runtimes</p>
</li>
<li>
<p>List of projects: Source code repositories</p>
</li>
<li>
<p>List of commands: Actions to manage the workspace components, such as running the development tools, starting the runtime environments, and others</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="title">Example of a minimal devfile with a project</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: petclinic-dev-environment
projects:
- name: petclinic
source:
type: git
location: 'https://github.com/spring-projects/spring-petclinic.git'
components:
- type: chePlugin
id: redhat/java/latest</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="specifying-multiple-projects-in-a-devfile_che"><a class="anchor" href="#specifying-multiple-projects-in-a-devfile_che"></a>Specifying multiple projects in a devfile</h3>
<div class="paragraph">
<p>A single devfile can define multiple projects, which are cloned to the desired destination. These projects are created inside a user’s workspace after the workspace is started.</p>
</div>
<div class="paragraph">
<p>For each project, specify the following:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The type of the source repository - this can be .git or .zip. For additional information, see the <a href="#devfile-reference_che">Devfile reference</a> section.</p>
</li>
<li>
<p>The location of the source repository - an URL to a Git repository or zip archive.</p>
</li>
<li>
<p>Optionally, the directory to which the project is cloned. If none is specified, the default directory is used, which is a directory that matches the project name or project Git repository.</p>
</li>
</ul>
</div>
<div class="paragraph">
<div class="title">Example of a devfile with two projects</div>
<p>In the following example, the projects <code>frontend</code> and <code>backend</code> act as examples of a user&#8217;s projects. Each project is located in a separate repository.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The <code>backend</code> project has a specific requirement to be cloned into the <code>src/github.com/<em>&lt;github-organization&gt;</em>/<em>&lt;backend&gt;</em>/</code> directory under the source root, implicitly defined by the Che runtime.</p>
</li>
<li>
<p>The <code>frontend</code> project will be cloned into the <code><em>&lt;frontend/&gt;</em></code> directory under the source root.</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: example-devfile
projects:
- name: <em>&lt;frontend&gt;</em>
source:
type: git
location: https://github.com/<em>&lt;github-organization&gt;</em>/<em>&lt;frontend&gt;</em>.git
- name: <em>&lt;backend&gt;</em>
clonePath: src/github.com/<em>&lt;github-organization&gt;</em>/<em>&lt;backend&gt;</em>
source:
type: git
location: https://github.com/<em>&lt;github-organization&gt;</em>/<em>&lt;backend&gt;</em>.git</code></pre>
</div>
</div>
<div class="paragraph">
<div class="title">Additional resources</div>
<p>For a detailed explanation of all devfile component assignments and possible values, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/redhat-developer/devfile">Specification repository</a></p>
</li>
<li>
<p><a href="https://redhat-developer.github.io/devfile/devfile">Detailed json-schema documentation</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>These sample devfiles are a good source of inspiration:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/eclipse-che/che-devfile-registry/tree/master/devfiles">Sample devfiles for Eclipse&#160;Che workspaces used by default in the user interface</a>.</p>
</li>
<li>
<p><a href="https://github.com/redhat-developer/devfile/tree/master/samples">Sample devfiles for Eclipse&#160;Che workspaces from Red Hat Developer program</a>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><!-- vale IBM.Slash = NO --></p>
</div>
<div class="paragraph">
<p><!-- vale IBM.Terms = NO --></p>
</div>
<div class="paragraph">
<p><!-- vale Vale.Avoid = NO --></p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="devfile-reference_che"><a class="anchor" href="#devfile-reference_che"></a>Devfile reference</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This section contains devfile reference and instructions on how to use the various elements that devfiles consist of.</p>
</div>
<div class="sect2">
<h3 id="adding-schema-version-to-a-devfile_che"><a class="anchor" href="#adding-schema-version-to-a-devfile_che"></a>Adding schema version to a devfile</h3>
<div class="ulist">
<div class="title">Procedure</div>
<ul>
<li>
<p>Define the <code>schemaVersion</code> attribute in the devfile:</p>
</li>
</ul>
</div>
<div class="exampleblock">
<div class="title">Example 1. Adding schema version to a devfile</div>
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">schemaVersion: 1.0.0</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="adding-a-name-to-a-devfile_che"><a class="anchor" href="#adding-a-name-to-a-devfile_che"></a>Adding a name to a devfile</h3>
<div class="paragraph">
<p>Adding a name to a devfile is mandatory. Both <code>name</code> and <code>generateName</code> are optional attributes, but at least one of them must be defined.</p>
</div>
<div class="olist arabic">
<div class="title">Procedure</div>
<ol class="arabic">
<li>
<p>To specify a static name for the workspace, define the <code>name</code> attribute.</p>
<div class="listingblock">
<div class="title">Adding a static name to a devfile</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">schemaVersion: 1.0.0
metadata:
name: devfile-sample</code></pre>
</div>
</div>
</li>
<li>
<p>To specify a prefix for automatically generated workspace names, define the <code>generateName</code> attribute and don&#8217;t define the <code>name</code> attribute. The workspace name will be in the <code>&lt;generateName&gt;YYYYY</code> format, for example, <code>devfile-sample-2y7kp</code>, where <code>Y</code> is a random <code>[a-z0-9]</code> character.</p>
<div class="listingblock">
<div class="title">Adding a generated name to a devfile</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">schemaVersion: 1.0.0
metadata:
generateName: devfile-sample-</code></pre>
</div>
</div>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>For workspaces created using a factory, defining <code>name</code> or <code>generateName</code> has the same effect. The defined value is used as the name prefix: <code>&lt;name&gt;YYYYY</code> or <code>&lt;generateName&gt;YYYYY</code>. When both <code>generateName</code> and <code>name</code> are defined, <code>generateName</code> takes precedence.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="sect2">
<h3 id="adding-projects-to-a-devfile_che"><a class="anchor" href="#adding-projects-to-a-devfile_che"></a>Adding projects to a devfile</h3>
<div class="paragraph">
<p>A devfile is designed to contain one or more projects. A workspace is created to develop those projects. Projects are added in the <code>projects</code> section of devfiles.</p>
</div>
<div class="paragraph">
<p>Each project in a single devfile must have:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Unique name</p>
</li>
<li>
<p>Source specified</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Project source consists of two mandatory values: <code>type</code> and <code>location</code>.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>type</code></dt>
<dd>
<p>The kind of project-source provider.</p>
</dd>
<dt class="hdlist1"><code>location</code></dt>
<dd>
<p>The URL of project source.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Che supports the following project types:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>git</code></dt>
<dd>
<p>Projects with sources in Git. The location points to a clone link.</p>
</dd>
<dt class="hdlist1"><code>github</code></dt>
<dd>
<p>Same as <code>git</code> but for projects hosted on <a href="https://github.com/">GitHub</a> only. Use <code>git</code> for projects that do not use GitHub-specific features.</p>
</dd>
<dt class="hdlist1"><code>zip</code></dt>
<dd>
<p>Projects with sources in a ZIP archive. Location points to a ZIP file.</p>
</dd>
</dl>
</div>
<div class="sect3">
<h4 id="_project_source_type_git"><a class="anchor" href="#_project_source_type_git"></a>Project-source type: git</h4>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">source:
type: git
location: https://github.com/eclipse-che/che-server.git
startPoint: master <i class="conum" data-value="1"></i><b>(1)</b>
tag: 7.2.0
commitId: 36fe587
branch: 7.20.x
sparseCheckoutDir: core <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td><code>startPoint</code>: The general value for <code>tag</code>, <code>commitId</code>, and <code>branch</code>. The <code>startPoint</code>, <code>tag</code>, <code>commitId</code>, and <code>branch</code> parameters are mutually exclusive. When more than one is supplied, the following order is used: <code>startPoint</code>, <code>tag</code>, <code>commitId</code>, <code>branch</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td><code>sparseCheckoutDir</code>: The template for the sparse checkout Git feature. This is useful when only a part of a project, typically a single directory, is needed.</td>
</tr>
</table>
</div>
<div class="exampleblock">
<div class="title">Example 2. <code>sparseCheckoutDir</code> parameter settings</div>
<div class="content">
<div class="ulist">
<ul>
<li>
<p>Set to <code>/my-module/</code> to create only the root <code>my-module</code> directory (and its content).</p>
</li>
<li>
<p>Omit the leading slash (<code>my-module/</code>) to create all <code>my-module</code> directories that exist in the project. Including, for example, <code>/addons/my-module/</code>.</p>
<div class="paragraph">
<p>The trailing slash indicates that only directories with the given name (including their content) are created.</p>
</div>
</li>
<li>
<p>Use wildcards to specify more than one directory name. For example, setting <code>module-*</code> checks out all directories of the given project that start with <code>module-</code>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="paragraph">
<p>For more information, see <a href="https://git-scm.com/docs/git-read-tree#_sparse_checkout">Sparse checkout in Git documentation</a>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_project_source_type_zip"><a class="anchor" href="#_project_source_type_zip"></a>Project-source type: zip</h4>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">source:
type: zip
location: http://host.net/path/project-src.zip</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_project_clone_path_parameter_clonepath"><a class="anchor" href="#_project_clone_path_parameter_clonepath"></a>Project clone-path parameter: clonePath</h4>
<div class="paragraph">
<p>The <code>clonePath</code> parameter specifies the path into which the project is to be cloned. The path must be relative to the <code>/projects/</code> directory, and it cannot leave the <code>/projects/</code> directory. The default value is the project name.</p>
</div>
<div class="listingblock">
<div class="title">Example devfile with projects</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: my-project-dev
projects:
- name: my-project-resourse
clonePath: resources/my-project
source:
type: zip
location: http://host.net/path/project-res.zip
- name: my-project
source:
type: git
location: https://github.com/my-org/project.git
branch: develop</code></pre>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="adding-components-to-a-devfile_che"><a class="anchor" href="#adding-components-to-a-devfile_che"></a>Adding components to a devfile</h3>
<div class="paragraph">
<p>Each component in a single devfile must have a unique name.</p>
</div>
<div class="sect3">
<h4 id="_component_type_cheeditor"><a class="anchor" href="#_component_type_cheeditor"></a>Component type: cheEditor</h4>
<div class="paragraph">
<p>Describes the editor used in the workspace by defining its <code>id</code>. A devfile can only contain one component of the <code>cheEditor</code> type.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">components:
- alias: theia-editor
type: cheEditor
id: eclipse/che-theia/next</code></pre>
</div>
</div>
<div class="paragraph">
<p>When <code>cheEditor</code> is missing, a default editor is provided along with its default plug-ins. The default plug-ins are also provided for an explicitly defined editor with the same <code>id</code> as the default one (even if it is a different version). Che-Theia is configured as default editor along with the <strong>Che Machine Exec</strong> plug-in.</p>
</div>
<div class="paragraph">
<p>To specify that a workspace requires no editor, use the <a href="#attribute-editorfree_che"><code>editorFree:true</code> attribute</a> in the devfile attributes.</p>
</div>
</div>
<div class="sect3">
<h4 id="_component_type_cheplugin"><a class="anchor" href="#_component_type_cheplugin"></a>Component type: chePlugin</h4>
<div class="paragraph">
<p>Describes plug-ins in a workspace by defining their <code>id</code>. A devfile is allowed to have multiple <code>chePlugin</code> components.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: exec-plugin
type: chePlugin
id: eclipse/che-machine-exec-plugin/latest</code></pre>
</div>
</div>
<div class="paragraph">
<p>Both types above use an ID, which is slash-separated publisher, name and version of plug-in from the Che Plug-in registry. Note that the Che Plug-in registry uses the <code>latest</code> version by default for all plug-ins.</p>
</div>
<div class="paragraph">
<p>To reference a custom plug-in by ID, build and deploy a custom plug-in registry. See <a href="../../administration-guide/building-custom-registry-images/" class="page">Building custom registry images</a>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_specifying_an_alternative_component_registry"><a class="anchor" href="#_specifying_an_alternative_component_registry"></a>Specifying an alternative component registry</h4>
<div class="paragraph">
<p>To specify an alternative registry for the <code>cheEditor</code> and <code>chePlugin</code> component types, use the <code>registryUrl</code> parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: exec-plugin
type: chePlugin
registryUrl: https://my-customregistry.com
id: eclipse/che-machine-exec-plugin/latest</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_specifying_a_component_by_linking_to_its_descriptor"><a class="anchor" href="#_specifying_a_component_by_linking_to_its_descriptor"></a>Specifying a component by linking to its descriptor</h4>
<div class="paragraph">
<p>Rather than using the editor or plug-in <code>id</code> to specify <code>cheEditor</code> or <code>chePlugin</code>, provide a direct link to the component descriptor, typically named as <code>meta.yaml</code>, using the <code>reference</code> field:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: exec-plugin
type: chePlugin
reference: https://raw.githubusercontent.com.../plugin/1.0.1/meta.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>The URL in the <code>reference</code> field must be publicly accessible and should directly point to a fetchable <code>meta.yaml</code> file. URLs that redirect or do not directly point to a <code>meta.yaml</code> file will cause the workspace startup to fail. To learn more about publishing <code>meta.yaml</code> files, see <a href="../publishing-metadata-for-a-vs-code-extension/" class="page">Publishing metadata for a VS Code extension</a>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
It is impossible to mix the <code>id</code> and <code>reference</code> fields in a single component definition; they are mutually exclusive.
</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="_tuning_cheplugin_component_configuration"><a class="anchor" href="#_tuning_cheplugin_component_configuration"></a>Tuning chePlugin component configuration</h4>
<div class="paragraph">
<p>A chePlugin component may need to be precisely tuned, and in such case, component preferences can be used. The example shows how to configure JVM using plug-in preferences.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> id: redhat/java/latest
type: chePlugin
preferences:
java.jdt.ls.vmargs: '-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication'</code></pre>
</div>
</div>
<div class="paragraph">
<p>Preferences may also be specified as an array:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> id: redhat/java/latest
type: chePlugin
preferences:
go.lintFlags: ["--enable-all", "--new"]</code></pre>
</div>
</div>
<div class="paragraph">
<p><!-- vale Vale.Spelling = NO --></p>
</div>
<div class="paragraph">
<p><!-- vale Vale.Terms = NO --></p>
</div>
</div>
<div class="sect3">
<h4 id="_component_type_kubernetes"><a class="anchor" href="#_component_type_kubernetes"></a>Component type: <code>kubernetes</code></h4>
<div class="paragraph">
<p>A complex component type that allows to apply configuration from a list of Kubernetes components.</p>
</div>
<div class="paragraph">
<p>The content can be provided through the <code>reference</code> attribute, which points to the file with the component content.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: mysql
type: kubernetes
reference: petclinic.yaml
selector:
app.kubernetes.io/name: mysql
app.kubernetes.io/component: database
app.kubernetes.io/part-of: petclinic</code></pre>
</div>
</div>
<div class="paragraph">
<p>Alternatively, to post a devfile with such components to REST API, the contents of the Kubernetes <code>List</code> object can be embedded into the devfile using the <code>referenceContent</code> field:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: mysql
type: kubernetes
reference: petclinic.yaml
referenceContent: |
kind: List
items:
-
apiVersion: v1
kind: Pod
metadata:
name: ws
spec:
containers:
... etc</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_overriding_container_entrypoints"><a class="anchor" href="#_overriding_container_entrypoints"></a>Overriding container entrypoints</h4>
<div class="paragraph">
<p>As with the <a href="#component-type-dockerimage_che">understood</a> by Kubernetes or OpenShift).</p>
</div>
<div class="paragraph">
<p>There can be more containers in the list (contained in Pods or Pod templates of deployments). To select which containers to apply the entrypoint changes to.</p>
</div>
<div class="paragraph">
<p>The entrypoints can be defined as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: appDeployment
type: kubernetes
reference: app-deployment.yaml
entrypoints:
- parentName: mysqlServer
command: ['sleep']
args: ['infinity']
- parentSelector:
app: prometheus
args: ['-f', '/opt/app/prometheus-config.yaml']</code></pre>
</div>
</div>
<div class="paragraph">
<p>The <code>entrypoints</code> list contains constraints for picking the containers along with the <code>command</code> and <code>args</code> parameters to apply to them. In the example above, the constraint is <code>parentName: mysqlServer</code>, which will cause the command to be applied to all containers defined in any parent object called <code>mysqlServer</code>. The parent object is assumed to be a top level object in the list defined in the referenced file, which is <code>app-deployment.yaml</code> in the example above.</p>
</div>
<div class="paragraph">
<p>Other types of constraints (and their combinations) are possible:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>containerName</code></dt>
<dd>
<p>the name of the container</p>
</dd>
<dt class="hdlist1"><code>parentName</code></dt>
<dd>
<p>the name of the parent object that (indirectly) contains the containers to override</p>
</dd>
<dt class="hdlist1"><code>parentSelector</code></dt>
<dd>
<p>the set of labels the parent object needs to have</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>A combination of these constraints can be used to precisely locate the containers inside the referenced Kubernetes <code>List</code>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_overriding_container_environment_variables"><a class="anchor" href="#_overriding_container_environment_variables"></a>Overriding container environment variables</h4>
<div class="paragraph">
<p>To provision or override entrypoints in a Kubernetes or OpenShift component, configure it in the following way:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: appDeployment
type: kubernetes
reference: app-deployment.yaml
env:
- name: ENV_VAR
value: value</code></pre>
</div>
</div>
<div class="paragraph">
<p>This is useful for temporary content or without access to editing the referenced content. The specified environment variables are provisioned into each init container and containers inside all Pods and Deployments.</p>
</div>
</div>
<div class="sect3">
<h4 id="_specifying_mount_source_option"><a class="anchor" href="#_specifying_mount_source_option"></a>Specifying mount-source option</h4>
<div class="paragraph">
<p>To specify a project sources directory mount into container(s), use the <code>mountSources</code> parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: appDeployment
type: kubernetes
reference: app-deployment.yaml
mountSources: true</code></pre>
</div>
</div>
<div class="paragraph">
<p><!-- vale Vale.Spelling = YES --></p>
</div>
<div class="paragraph">
<p><!-- vale Vale.Terms = YES --></p>
</div>
<div class="paragraph">
<p>If enabled, project sources mounts will be applied to every container of the given component.
This parameter is also applicable for <code>chePlugin</code> type components.</p>
</div>
</div>
<div class="sect3">
<h4 id="component-type-dockerimage_che"><a class="anchor" href="#component-type-dockerimage_che"></a>Component type: dockerimage</h4>
<div class="paragraph">
<p>A component type that allows to define a container image-based configuration of a container in a workspace. The <code>dockerimage</code> type of component brings in custom tools into the workspace. The component is identified by its image.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: maven
type: dockerimage
image: quay.io/eclipse/che-java11-maven:nightly
volumes:
- name: mavenrepo
containerPath: /root/.m2
env:
- name: ENV_VAR
value: value
endpoints:
- name: maven-server
port: 3101
attributes:
protocol: http
secure: 'true'
public: 'true'
discoverable: 'false'
memoryLimit: 1536M
memoryRequest: 256M
command: ['tail']
args: ['-f', '/dev/null']</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Example of a minimal <code>dockerimage</code> component</strong></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
components:
- type: dockerimage
image: golang
memoryLimit: 512Mi
command: ['sleep', 'infinity']</code></pre>
</div>
</div>
<div class="paragraph">
<p>It specifies the type of the component, <code>dockerimage</code> and the <code>image</code> attribute names the image to be used for the component using the usual Docker naming conventions, that is, the above <code>type</code> attribute is equal to <code>docker.io/library/golang:latest</code>.</p>
</div>
<div class="paragraph">
<p>A <code>dockerimage</code> component has many features that enable augmenting the image with additional resources and information needed for meaningful integration of the <strong>tool</strong> provided by the image with Eclipse&#160;Che.</p>
</div>
</div>
<div class="sect3">
<h4 id="_mounting_project_sources"><a class="anchor" href="#_mounting_project_sources"></a>Mounting project sources</h4>
<div class="paragraph">
<p>For the <code>dockerimage</code> component to have access to the project sources, you must set the <code>mountSources</code> attribute to <code>true</code>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
components:
- type: dockerimage
image: golang
memoryLimit: 512Mi
command: ['sleep', 'infinity']</code></pre>
</div>
</div>
<div class="paragraph">
<p>The sources is mounted on a location stored in the <code>CHE_PROJECTS_ROOT</code> environment variable that is made available in the running container of the image. This location defaults to <code>/projects</code>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_container_entrypoint"><a class="anchor" href="#_container_entrypoint"></a>Container Entrypoint</h4>
<div class="paragraph">
<p>The <code>command</code> attribute of the <code>dockerimage</code> along with other arguments, is used to modify the <code>entrypoint</code> command of the container created from the image. In Eclipse&#160;Che the container is needed to run indefinitely so that you can connect to it and execute arbitrary commands in it at any time. Because the availability of the <code>sleep</code> command and the support for the <code>infinity</code> argument for it is different and depends on the base image used in the particular images, Che cannot insert this behavior automatically on its own. However, you can take advantage of this feature to, for example, start necessary servers with modified configurations, and so on.</p>
</div>
</div>
<div class="sect3">
<h4 id="_persistent_storage"><a class="anchor" href="#_persistent_storage"></a>Persistent Storage</h4>
<div class="paragraph">
<p>Components of any type can specify the custom volumes to be mounted on specific locations within the image. Note that the volume names are shared across all components and therefore this mechanism can also be used to share file systems between components.</p>
</div>
<div class="paragraph">
<p>Example specifying volumes for <code>dockerimage</code> type:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
components:
- type: dockerimage
image: golang
memoryLimit: 512Mi
mountSources: true
command: ['sleep', 'infinity']
volumes:
- name: cache
containerPath: /.cache</code></pre>
</div>
</div>
<div class="paragraph">
<p>Example specifying volumes for <code>cheEditor</code>/<code>chePlugin</code> type:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
components:
- type: cheEditor
alias: theia-editor
id: eclipse/che-theia/next
env:
- name: HOME
value: $(CHE_PROJECTS_ROOT)
volumes:
- name: cache
containerPath: /.cache</code></pre>
</div>
</div>
<div class="paragraph">
<p>Example specifying volumes for <code>kubernetes</code>/<code>openshift</code> type:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
components:
- type: openshift
alias: mongo
reference: mongo-db.yaml
volumes:
- name: mongo-persistent-storage
containerPath: /data/db</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_specifying_container_memory_limit_for_components"><a class="anchor" href="#_specifying_container_memory_limit_for_components"></a>Specifying container memory limit for components</h4>
<div class="paragraph">
<p>To specify a container(s) memory limit for <code>dockerimage</code>, <code>chePlugin</code> or <code>cheEditor</code>, use the <code>memoryLimit</code> parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: exec-plugin
type: chePlugin
id: eclipse/che-machine-exec-plugin/latest
memoryLimit: 1Gi
- alias: maven
type: dockerimage
image: quay.io/eclipse/che-java11-maven:nightly
memoryLimit: 512M</code></pre>
</div>
</div>
<div class="paragraph">
<p>This limit will be applied to every container of the given component.</p>
</div>
<div class="paragraph">
<p>For the <code>cheEditor</code> and <code>chePlugin</code> component types, RAM limits can be described in the plug-in descriptor file, typically named <code>meta.yaml</code>.</p>
</div>
<div class="paragraph">
<p>If none of them are specified, system-wide defaults will be applied (see description of <code>CHE_WORKSPACE_SIDECAR_DEFAULT__MEMORY__LIMIT__MB</code> system property).</p>
</div>
</div>
<div class="sect3">
<h4 id="_specifying_container_memory_request_for_components"><a class="anchor" href="#_specifying_container_memory_request_for_components"></a>Specifying container memory request for components</h4>
<div class="paragraph">
<p>To specify a container(s) memory request for <code>dockerimage</code>, <code>chePlugin</code> or <code>cheEditor</code>, use the <code>memoryRequest</code> parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: exec-plugin
type: chePlugin
id: eclipse/che-machine-exec-plugin/latest
memoryLimit: 1Gi
memoryRequest: 512M
- alias: maven
type: dockerimage
image: quay.io/eclipse/che-java11-maven:nightly
memoryLimit: 512M
memoryRequest: 256M</code></pre>
</div>
</div>
<div class="paragraph">
<p>This limit will be applied to every container of the given component.</p>
</div>
<div class="paragraph">
<p>For the <code>cheEditor</code> and <code>chePlugin</code> component types, RAM requests can be described in the plug-in descriptor file, typically named <code>meta.yaml</code>.</p>
</div>
<div class="paragraph">
<p>If none of them are specified, system-wide defaults are applied (see description of <code>CHE_WORKSPACE_SIDECAR_DEFAULT__MEMORY__REQUEST__MB</code> system property).</p>
</div>
</div>
<div class="sect3">
<h4 id="_specifying_container_cpu_limit_for_components"><a class="anchor" href="#_specifying_container_cpu_limit_for_components"></a>Specifying container CPU limit for components</h4>
<div class="paragraph">
<p>To specify a container(s) CPU limit for <code>chePlugin</code>, <code>cheEditor</code> or <code>dockerimage</code> use the <code>cpuLimit</code> parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: exec-plugin
type: chePlugin
id: eclipse/che-machine-exec-plugin/latest
cpuLimit: 1.5
- alias: maven
type: dockerimage
image: quay.io/eclipse/che-java11-maven:nightly
cpuLimit: 750m</code></pre>
</div>
</div>
<div class="paragraph">
<p>This limit will be applied to every container of the given component.</p>
</div>
<div class="paragraph">
<p>For the <code>cheEditor</code> and <code>chePlugin</code> component types, CPU limits can be described in the plug-in descriptor file, typically named <code>meta.yaml</code>.</p>
</div>
<div class="paragraph">
<p>If none of them are specified, system-wide defaults are applied (see description of <code>CHE_WORKSPACE_SIDECAR_DEFAULT__CPU__LIMIT__CORES</code> system property).</p>
</div>
</div>
<div class="sect3">
<h4 id="_specifying_container_cpu_request_for_components"><a class="anchor" href="#_specifying_container_cpu_request_for_components"></a>Specifying container CPU request for components</h4>
<div class="paragraph">
<p>To specify a container(s) CPU request for <code>chePlugin</code>, <code>cheEditor</code> or <code>dockerimage</code> use the <code>cpuRequest</code> parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> components:
- alias: exec-plugin
type: chePlugin
id: eclipse/che-machine-exec-plugin/latest
cpuLimit: 1.5
cpuRequest: 0.225
- alias: maven
type: dockerimage
image: quay.io/eclipse/che-java11-maven:nightly
cpuLimit: 750m
cpuRequest: 450m</code></pre>
</div>
</div>
<div class="paragraph">
<p>This limit will be applied to every container of the given component.</p>
</div>
<div class="paragraph">
<p>For the <code>cheEditor</code> and <code>chePlugin</code> component types, CPU requests can be described in the plug-in descriptor file, typically named <code>meta.yaml</code>.</p>
</div>
<div class="paragraph">
<p>If none of them are specified, system-wide defaults are applied (see description of <code>CHE_WORKSPACE_SIDECAR_DEFAULT__CPU__REQUEST__CORES</code> system property).</p>
</div>
</div>
<div class="sect3">
<h4 id="_environment_variables"><a class="anchor" href="#_environment_variables"></a>Environment variables</h4>
<div class="paragraph">
<p>Eclipse&#160;Che allows you to configure Docker containers by modifying the environment variables available in component&#8217;s configuration.
Environment variables are supported by the following component types: <code>dockerimage</code>, <code>chePlugin</code>, <code>cheEditor</code>, <code>kubernetes</code>, <code>openshift</code>.
In case component has multiple containers, environment variables will be provisioned to each container.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
components:
- type: dockerimage
image: golang
memoryLimit: 512Mi
mountSources: true
command: ['sleep', 'infinity']
env:
- name: GOPATH
value: $(CHE_PROJECTS_ROOT)/go
- type: cheEditor
alias: theia-editor
id: eclipse/che-theia/next
memoryLimit: 2Gi
env:
- name: HOME
value: $(CHE_PROJECTS_ROOT)</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p>The variable expansion works between the environment variables, and it uses the Kubernetes convention for the variable references.</p>
</li>
<li>
<p>The predefined variables are available for use in custom definitions.</p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The following environment variables are pre-set by the Che server:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>CHE_PROJECTS_ROOT</code>: The location of the projects directory (note that if the component does not mount the sources, the projects will not be accessible).</p>
</li>
<li>
<p><code>CHE_WORKSPACE_LOGS_ROOT__DIR</code>: The location of the logs common to all the components. If the component chooses to put logs into this directory, the log files are accessible from all other components.</p>
</li>
<li>
<p><code>CHE_API_INTERNAL</code>: The URL to the Che server API endpoint used for communication with the Che server.</p>
</li>
<li>
<p><code>CHE_WORKSPACE_ID</code>: The ID of the current workspace.</p>
</li>
<li>
<p><code>CHE_WORKSPACE_NAME</code>: The name of the current workspace.</p>
</li>
<li>
<p><code>CHE_WORKSPACE_NAMESPACE</code>: The Che namespace of the current workspace. This environment variable is the name of the user or organization that the workspace belongs to. Note that this is different from
the Kubernetes namespace or OpenShift project to which the workspace is deployed.</p>
</li>
<li>
<p><code>CHE_MACHINE_TOKEN</code>: The token used to authenticate the request against the Che server.</p>
</li>
</ul>
</div>
<div class="ulist">
<ul>
<li>
<p><code>CHE_MACHINE_AUTH_SIGNATURE__PUBLIC__KEY</code>: The public key used to secure the communication with the Che server.</p>
</li>
<li>
<p><code>CHE_MACHINE_AUTH_SIGNATURE__ALGORITHM</code>: The encryption algorithm used in the secured communication with the Che server.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>A devfiles may only need the <code>CHE_PROJECTS_ROOT</code> environment variable to locate the cloned projects in the component&#8217;s container. More advanced devfiles might use the <code>CHE_WORKSPACE_LOGS_ROOT__DIR</code> environment variable to read the logs (for example as part of a devfile command). The environment variables used to securely access the Che server are out of scope for devfiles and are present only for advanced use cases, which are handled by the Che plug-ins.</p>
</div>
</div>
<div class="sect3">
<h4 id="endpoints_che"><a class="anchor" href="#endpoints_che"></a>Endpoints</h4>
<div class="paragraph">
<p>Components of any type can specify the endpoints that the Docker image exposes. These endpoints can be made accessible to the users if the Che cluster is running using a Kubernetes ingress or an OpenShift route and to the other components within the workspace. You can create an endpoint for your application or database, if your application or database server is listening on a port and you need to be able to directly interact with it yourself or you allow other components to interact with it.</p>
</div>
<div class="paragraph">
<p>Endpoints have several properties as shown in the following example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
projects:
- name: my-go-project
clonePath: go/src/github.com/acme/my-go-project
source:
type: git
location: https://github.com/acme/my-go-project.git
components:
- type: dockerimage
image: golang
memoryLimit: 512Mi
mountSources: true
command: ['sleep', 'infinity']
env:
- name: GOPATH
value: $(CHE_PROJECTS_ROOT)/go
- name: GOCACHE
value: /tmp/go-cache
endpoints:
- name: web
port: 8080
attributes:
discoverable: false
public: true
protocol: http
- type: dockerimage
image: postgres
memoryLimit: 512Mi
env:
- name: POSTGRES_USER
value: user
- name: POSTGRES_PASSWORD
value: password
- name: POSTGRES_DB
value: database
endpoints:
- name: postgres
port: 5432
attributes:
discoverable: true
public: false</code></pre>
</div>
</div>
<div class="paragraph">
<p>Here, there are two Docker images, each defining a single endpoint. Endpoint is an accessible port that can be made accessible inside the workspace or also publicly (example, from the UI). Each endpoint has a name and port, which is the port on which certain server running inside the container is listening. The following are a few attributes that you can set on the endpoint:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>discoverable</code>: If an endpoint is discoverable, it means that it can be accessed using its name as the host name within the workspace containers (in the Kubernetes or OpenShift terminology, a service is created for it with the provided name).
55</p>
</li>
<li>
<p><code>public</code>: The endpoint will be accessible outside of the workspace, too (such endpoint can be accessed from the Che user interface). Such endpoints are publicized always on port <code>80</code> or <code>443</code> (depending on whether <code>tls</code> is enabled in Che).</p>
</li>
<li>
<p><code>protocol</code>: For public endpoints the protocol is a hint to the UI on how to construct the URL for the endpoint access. Typical values are <code>http</code>, <code>https</code>, <code>ws</code>, <code>wss</code>.</p>
</li>
<li>
<p><code>secure</code>: A boolean value (defaulting to <code>false</code>) specifying whether the endpoint is put behind a JWT proxy requiring a JWT workspace token to grant access. The JWT proxy is deployed in the same Pod as the server and assumes the server listens solely on the local loop-back interface, such as <code>127.0.0.1</code>.</p>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Listening on any other interface than the local loop-back poses a security risk because such server is accessible without the JWT authentication within the cluster network on the corresponding IP addresses.
</td>
</tr>
</table>
</div>
</li>
<li>
<p><code>path</code>: The path portion of the URL to the endpoint. This defaults to <code>/</code>, meaning that the endpoint is assumed to be accessible at the web root of the server defined by the component.</p>
</li>
<li>
<p><code>unsecuredPaths</code>: A comma-separated list of endpoint paths that are to stay unsecured even if the <code>secure</code> attribute is set to <code>true</code>.</p>
</li>
<li>
<p><code>cookiesAuthEnabled</code>: When set to <code>true</code> (the default is <code>false</code>), the JWT workspace token is automatically fetched and included in a workspace-specific cookie to allow requests to pass through the JWT proxy.</p>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
This setting potentially allows a <a href="https://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF</a> attack when used in conjunction with a server using POST requests.
</td>
</tr>
</table>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>When starting a new server within a component, Che automatically detects this, and the UI offers to expose this port as a <code>public</code> port automatically. This behavior is useful for debugging a web application. It is impossible to do this for servers, such as a database server, which automatically starts at the container start. For such components, specify the endpoints explicitly.</p>
</div>
<div class="paragraph">
<p>Example specifying endpoints for <code>kubernetes</code>/<code>openshift</code> and <code>chePlugin</code>/<code>cheEditor</code> types:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
components:
- type: cheEditor
alias: theia-editor
id: eclipse/che-theia/next
endpoints:
- name: 'theia-extra-endpoint'
port: 8880
attributes:
discoverable: true
public: true
- type: chePlugin
id: redhat/php/latest
memoryLimit: 1Gi
endpoints:
- name: 'php-endpoint'
port: 7777
- type: chePlugin
alias: theia-editor
id: eclipse/che-theia/next
endpoints:
- name: 'theia-extra-endpoint'
port: 8880
attributes:
discoverable: true
public: true
- type: openshift
alias: webapp
reference: webapp.yaml
endpoints:
- name: 'web'
port: 8080
attributes:
discoverable: false
public: true
protocol: http
- type: openshift
alias: mongo
reference: mongo-db.yaml
endpoints:
- name: 'mongo-db'
port: 27017
attributes:
discoverable: true
public: false</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_kubernetes_or_openshift_resources"><a class="anchor" href="#_kubernetes_or_openshift_resources"></a>Kubernetes or OpenShift resources</h4>
<div class="paragraph">
<p>To describe complex deployments, include references to Kubernetes or OpenShift resource lists in the devfile. The Kubernetes or OpenShift resource lists become a part of the workspace.</p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p>Che merges all resources from the Kubernetes or OpenShift resource lists into a single deployment.</p>
</li>
<li>
<p>Be careful when designing such lists to avoid name conflicts and other problems.</p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 1. Supported Kubernetes or OpenShift resources</caption>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Platform</th>
<th class="tableblock halign-left valign-top">Supported resources</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>deployments</code>, <code>pods</code>, <code>services</code>, <code>persistent volume claims</code>, <code>secrets</code>, <code>ConfigMaps</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenShift</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>deployments</code>, <code>pods</code>, <code>services</code>, <code>persistent volume claims</code>, <code>secrets</code>, <code>ConfigMaps</code>, <code>Routes</code></p></td>
</tr>
</tbody>
</table>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
projects:
- name: my-go-project
clonePath: go/src/github.com/acme/my-go-project
source:
type: git
location: https://github.com/acme/my-go-project.git
components:
- type: kubernetes
reference: ../relative/path/postgres.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>The preceding component references a file that is relative to the location of the devfile itself. Meaning, this devfile is only loadable by a Che factory to which you supply the location of the devfile and therefore it is able to figure out the location of the referenced Kubernetes or OpenShift resource list.</p>
</div>
<div class="paragraph">
<p>The following is an example of the <code>postgres.yaml</code> file.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: List
items:
-
apiVersion: v1
kind: Deployment
metadata:
name: postgres
labels:
app: postgres
spec:
template:
metadata:
name: postgres
app:
name: postgres
spec:
containers:
- image: postgres
name: postgres
ports:
- name: postgres
containerPort: 5432
volumeMounts:
- name: pg-storage
mountPath: /var/lib/postgresql/data
volumes:
- name: pg-storage
persistentVolumeClaim:
claimName: pg-storage
-
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
name: postgres
spec:
ports:
- port: 5432
targetPort: 5432
selector:
app: postgres
-
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pg-storage
labels:
app: postgres
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi</code></pre>
</div>
</div>
<div class="paragraph">
<p>For a basic example of a devfile with an associated Kubernetes or OpenShift list, see <a href="https://github.com/redhat-developer/devfile/tree/master/samples/web-nodejs-with-db-sample">web-nodejs-with-db-sample</a> on redhat-developer GitHub.</p>
</div>
<div class="paragraph">
<p>If you use generic or large resource lists from which you will only need a subset of resources, you can select particular resources from the list using a selector (which, as the usual Kubernetes or OpenShift selectors, works on the labels of the resources in the list).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
projects:
- name: my-go-project
clonePath: go/src/github.com/acme/my-go-project
source:
type: git
location: https://github.com/acme/my-go-project.git
components:
- type: kubernetes
reference: ../relative/path/postgres.yaml
selector:
app: postgres</code></pre>
</div>
</div>
<div class="paragraph">
<p>Additionally, it is also possible to modify the entrypoints (command and arguments) of the containers present in the resource list.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="adding-commands-to-a-devfile_che"><a class="anchor" href="#adding-commands-to-a-devfile_che"></a>Adding commands to a devfile</h3>
<div class="paragraph">
<p>A devfile allows to specify commands to be available for execution in a workspace. Every command can contain a subset of actions, which are related to a specific component in whose container it will be executed.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> commands:
- name: build
actions:
- type: exec
component: mysql
command: mvn clean
workdir: /projects/spring-petclinic</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can use commands to automate the workspace. You can define commands for building and testing your code, or cleaning the database.</p>
</div>
<div class="paragraph">
<p>The following are two kinds of commands:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Che specific commands: You have full control over what component executes the command.</p>
</li>
<li>
<p>Editor specific commands: You can use the editor-specific command definitions (example: <code>tasks.json</code> and <code>launch.json</code> in Che-Theia, which is equivalent to how these files work in VS Code).</p>
</li>
</ul>
</div>
<div class="sect3">
<h4 id="_che_specific_commands"><a class="anchor" href="#_che_specific_commands"></a>Che-specific commands</h4>
<div class="paragraph">
<p>Each Che-specific command features:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>An <code>actions</code> attribute that specifies a command to execute.</p>
</li>
<li>
<p>A <code>component</code> attribute that specifies the container in which to execute the command.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The commands are run using the default shell in the container.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
projects:
- name: my-go-project
clonePath: go/src/github.com/acme/my-go-project
source:
type: git
location: https://github.com/acme/my-go-project.git
components:
- type: dockerimage
image: golang
alias: go-cli
memoryLimit: 512Mi
mountSources: true
command: ['sleep', 'infinity']
env:
- name: GOPATH
value: $(CHE_PROJECTS_ROOT)/go
- name: GOCACHE
value: /tmp/go-cache
commands:
- name: compile and run
actions:
- type: exec
component: go-cli
command: “go get -d &amp;&amp; go run main.go”
workdir: “${CHE_PROJECTS_ROOT}/src/github.com/acme/my-go-project”</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p>If a component to be used in a command must have an alias. This alias is used to reference the component in the command definition. Example: <code>alias: go-cli</code> in the component definition and <code>component: go-cli</code> in the command definition. This ensures that Eclipse&#160;Che can find the correct container to run the command in.</p>
</li>
<li>
<p>A command can have only one action.</p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="_editor_specific_commands"><a class="anchor" href="#_editor_specific_commands"></a>Editor-specific commands</h4>
<div class="paragraph">
<p>If the editor in the workspace supports it, the devfile can specify additional configuration in the editor-specific format. This is dependent on the integration code present in the workspace editor itself and so is not a generic mechanism. However, the default Che-Theia editor within Eclipse&#160;Che is equipped to understand the <code>tasks.json</code> and <code>launch.json</code> files provided in the devfile.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: MyDevfile
projects:
- name: my-go-project
clonePath: go/src/github.com/acme/my-go-project
source:
type: git
location: https://github.com/acme/my-go-project.git
commands:
- name: tasks
actions:
- type: vscode-task
referenceContent: &gt;
{
"version": "2.0.0",
"tasks": [
{
"label": "create test file",
"type": "shell",
"command": "touch ${workspaceFolder}/test.file"
}
]
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>This example shows association of a <code>tasks.json</code> file with a devfile. Notice the <code>vscode-task</code> type that instructs the Che-Theia editor to interpret this command as a tasks definition and <code>referenceContent</code> attribute that contains the contents of the file itself. You can also save this file separately from the devfile and use <code>reference</code> attribute to specify a relative or absolute URL to it.</p>
</div>
<div class="paragraph">
<p>In addition to the <code>vscode-task</code> commands, the Che-Theia editor understands <code>vscode-launch</code> type using which you can specify the start configurations.</p>
</div>
</div>
<div class="sect3">
<h4 id="_command_preview_url"><a class="anchor" href="#_command_preview_url"></a>Command preview URL</h4>
<div class="paragraph">
<p>It is possible to specify a preview URL for commands that expose web UI. This URL is offered for opening when the command is executed.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">commands:
- name: tasks
previewUrl:
port: 8080 <i class="conum" data-value="1"></i><b>(1)</b>
path: /myweb <i class="conum" data-value="2"></i><b>(2)</b>
actions:
- type: exec
component: go-cli
command: "go run webserver.go"
workdir: ${CHE_PROJECTS_ROOT}/webserver</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>TCP port where the application listens. Mandatory parameter.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The path part of the URL to the UI. Optional parameter. The default is root (<code>/</code>).</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The example above opens <code>http://__&lt;server-domain&gt;__/myweb</code>, where <code><em>&lt;server-domain&gt;</em></code> is the URL to the dynamically created Kubernetes Ingress or OpenShift Route.</p>
</div>
<div class="sect4">
<h5 id="_setting_the_default_way_of_opening_preview_urls"><a class="anchor" href="#_setting_the_default_way_of_opening_preview_urls"></a>Setting the default way of opening preview URLs</h5>
<div class="paragraph">
<p>By default, a notification that asks the user about the URL opening preference is displayed.</p>
</div>
<div class="paragraph">
<p>To specify the preferred way of previewing a service URL:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Open Che preferences in <strong>File &#8594; Settings &#8594; Open Preferences</strong> and find <code>che.task.preview.notifications</code> in the <strong>Che</strong> section.</p>
</li>
<li>
<p>Choose from the list of possible values:</p>
<div class="ulist">
<ul>
<li>
<p><code>on</code>&#8201;&#8212;&#8201;enables a notification for asking the user about the URL opening preferences</p>
</li>
<li>
<p><code>alwaysPreview</code>&#8201;&#8212;&#8201;the preview URL opens automatically in the <strong>Preview</strong> panel as soon as a task is running</p>
</li>
<li>
<p><code>alwaysGoTo</code>&#8201;&#8212;&#8201;the preview URL opens automatically in a separate browser tab as soon as a task is running</p>
</li>
<li>
<p><code>off</code>&#8201;&#8212;&#8201;disables opening the preview URL (automatically and with a notification)</p>
</li>
</ul>
</div>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_adding_attributes_to_a_devfile"><a class="anchor" href="#_adding_attributes_to_a_devfile"></a>Adding attributes to a devfile</h3>
<div class="paragraph">
<p>Devfile attributes can be used to configure various features.</p>
</div>
<div class="sect3">
<h4 id="attribute-editorfree_che"><a class="anchor" href="#attribute-editorfree_che"></a>Attribute: editorFree</h4>
<div class="paragraph">
<p>When an editor is not specified in a devfile, a default is provided. When no editor is needed, use the <code>editorFree</code> attribute. The default value of <code>false</code> means that the devfile requests the provisioning of the default editor.</p>
</div>
<div class="listingblock">
<div class="title">Example of a devfile without an editor</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: petclinic-dev-environment
components:
- alias: myApp
type: kubernetes
reference: my-app.yaml
attributes:
editorFree: true</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_attribute_persistvolumes_ephemeral_mode"><a class="anchor" href="#_attribute_persistvolumes_ephemeral_mode"></a>Attribute: persistVolumes (ephemeral mode)</h4>
<div class="paragraph">
<p>By default, volumes and PVCs specified in a devfile are bound to a host folder to persist data even after a container restart. To disable data persistence to make the workspace faster, such as when the volume back end is slow, modify the <code>persistVolumes</code> attribute in the devfile. The default value is <code>true</code>. Set to <code>false</code> to use <code>emptyDir</code> for configured volumes and PVC.</p>
</div>
<div class="listingblock">
<div class="title">Example of a devfile with ephemeral mode enabled</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: petclinic-dev-environment
projects:
- name: petclinic
source:
type: git
location: 'https://github.com/che-samples/web-java-spring-petclinic.git'
attributes:
persistVolumes: false</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_attribute_asyncpersist_asynchronous_storage"><a class="anchor" href="#_attribute_asyncpersist_asynchronous_storage"></a>Attribute: asyncPersist (asynchronous storage)</h4>
<div class="paragraph">
<p>When <code>persistVolumes</code> is set to <code>false</code> (see above), the additional attribute <code>asyncPersist</code> can be set to <code>true</code> to enable asynchronous storage. See <a href="../../installation-guide/configuring-storage-types/" class="page">Configuring storage types</a> for more details.</p>
</div>
<div class="listingblock">
<div class="title">Example of a devfile with asynchronous storage enabled</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: petclinic-dev-environment
projects:
- name: petclinic
source:
type: git
location: 'https://github.com/che-samples/web-java-spring-petclinic.git'
attributes:
persistVolumes: false
asyncPersist: true</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_attribute_mergeplugins"><a class="anchor" href="#_attribute_mergeplugins"></a>Attribute: mergePlugins</h4>
<div class="paragraph">
<p>This property can be set to manually control how plugins are included in the workspace. When the property <code>mergePlugins</code> is set to <code>true</code>, Che will attempt to avoid running multiple instances of the same container by combining plugins. The default value when this property is not included in a devfile is governed by the Che configuration property <code>che.workspace.plugin_broker.default_merge_plugins</code>; adding the <code>mergePlugins: false</code> attribute to a devfile will disable plugin merging for that workspace.</p>
</div>
<div class="listingblock">
<div class="title">Example of a devfile with plugin merging disabled</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: 1.0.0
metadata:
name: petclinic-dev-environment
projects:
- name: petclinic
source:
type: git
location: 'https://github.com/che-samples/web-java-spring-petclinic.git'
attributes:
mergePlugins: false</code></pre>
</div>
</div>
<div class="paragraph">
<p><!-- vale IBM.Slash = YES --></p>
</div>
<div class="paragraph">
<p><!-- vale IBM.Terms = YES --></p>
</div>
<div class="paragraph">
<p><!-- vale Vale.Avoid = YES --></p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="objects-supported-in-che_che"><a class="anchor" href="#objects-supported-in-che_che"></a>Objects supported in Eclipse&#160;Che 7.33</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The following table lists the objects that are partially supported in Eclipse&#160;Che 7.33:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 11.1111%;">
<col style="width: 11.1111%;">
<col style="width: 11.1111%;">
<col style="width: 11.1111%;">
<col style="width: 55.5556%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Object</th>
<th class="tableblock halign-left valign-top">API</th>
<th class="tableblock halign-left valign-top">Kubernetes Infra</th>
<th class="tableblock halign-left valign-top">OpenShift Infra</th>
<th class="tableblock halign-left valign-top">Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Pod</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Deployment</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ConfigMap</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PVC</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Secret</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Service</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Ingress</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Minishift allows you to create Ingress and it works when the host is specified (OpenShift creates a route for it). But, the <code>loadBalancer</code> IP is not provisioned. To add Ingress support for the OpenShift infrastructure node, generate routes based on the provided Ingress.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Route</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenShift</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The OpenShift recipe must be made compatible with the Kubernetes Infrastructure: OpenShift routes replaced on Ingresses.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Template</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenShift</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Kubernetes API does not support templates. A workspace with a template in the recipe starts successfully and the default parameters are resolved.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</article>
</div>
</main>
</div>
<footer class="footer">
<div><a href="https://www.eclipse.org" target="_blank">Eclipse Foundation</a> |
<a href="https://www.eclipse.org/legal/privacy.php" target="_blank">Privacy Policy</a> |
<a href="https://www.eclipse.org/legal/termsofuse.php" target="_blank">Terms of Use</a> |
<a href="https://www.eclipse.org/legal/epl-2.0/" target="_blank">Eclipse Public License</a> |
<a href="https://www.eclipse.org/legal" target="_blank">Legal Resources</a></div>
</footer>
<script src="../../../_/js/site.js"></script>
<script async src="../../../_/js/vendor/highlight.js"></script>
</body>
</html>