Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Devfile format to generate a workspace #11549

Closed
41 of 42 tasks
slemeur opened this issue Oct 9, 2018 · 5 comments
Closed
41 of 42 tasks

Support Devfile format to generate a workspace #11549

slemeur opened this issue Oct 9, 2018 · 5 comments
Labels
kind/epic A long-lived, PM-driven feature request. Must include a checklist of items that must be completed.

Comments

@slemeur
Copy link
Contributor

slemeur commented Oct 9, 2018

Goal

Today we have two kind of recipes to bootstrap a cloud developer workspace and make it portable: Chefile and Factories.

Over the last few month, we've been also iterating on the definition of a devfile format which defines the different tools needed to develop a container based application. That work has been initiated along with the requirements of Workspace.Next. You can find the defined format here: https://github.com/l0rd/devfile/

The goal of this epic is to support the devfile format in Eclipse Che on all the different ways we have to create/generate a workspace.

User Stories

With the following requirements:

  • a repository like github.com/che-samples/spring-petclinic
  • a devfile hosted under the repository

User Stories:

  1. A developer can generate a workspace by just calling a url: che.host/f?repo_url
  2. A developer can create a workspace by providing the url to the repository
  3. A developer can create a workspace by importing the devfile
  4. A developer can generate a workspace by sending a devfile to a rest API

Not in scope for now:

  1. A developer can generate the devfile based on an existing workspace
  2. A developer can import a repository without a devfile and be guided to select the tools he needs to create the properly tooled workspace
  3. A developer can change the configuration of the workspace and changes are reflected + versioned in the devfile
  4. A developer should be exposed to the devfile format when he is configuring a workspace
  5. A developer can create a workspace based on multi-repo with multi devfiles

Sub-Tasks

A developer can generate a workspace by just calling a url: che.host/f?repo_url
A developer should be able to get a workspace from a repository where there is a devfile. Today a user is able to get a workspace by giving the url of the repository to the factory engine. It should be able to understand if the repository is having a devfile and if it has, use it to create the properly tooled workspace.

A developer can create a workspace by providing the url to the repository
We have different ways to create a new workspace from the dashboard. The user should be able to create a workspace by providing the URL to a repository. Che will be able to create the workspace from a project's devfile hosted in the repository.

  • In the workspace creation page, when user provides the URL to a repository with a devfile, the devfile should be used to configure the workspaces.

A developer can create a workspace by importing the devfile
A developer should be able to provide the content of a devfile or import a devfile to create a workspace.

  • In the workspace list, we could add an "import" button which will allow to import a devfile either by uploading or copy/pasting the content of the file.

A developer can generate a workspace by sending a devfile to a rest API
A developer should be able to send to a restAPI:

  • a devfile
  • a url of a repository with a devfile
    An get as a result a workspace created and the url to access it.

Phase 1

Phase 2

@slemeur slemeur added the kind/epic A long-lived, PM-driven feature request. Must include a checklist of items that must be completed. label Oct 9, 2018
@slemeur
Copy link
Contributor Author

slemeur commented Oct 9, 2018

Related to #4362

@l0rd
Copy link
Contributor

l0rd commented Oct 9, 2018

Some thoughts:

  • I think that stories 1. and 4. are related (it's about a new API), and 2. and 3. are related as well (about the client that call these API, the user dashboard). I think that 1. and 4. are prerequisites and should be handled with higher priority. And probably 2. and 3. will be implemented by a different team. Maybe we should split them in 2 different epics?

  • What it's expected if a developer modify the devfile from Che IDE? Or if he creates a new devfile? Should the workspace config be changed and the user asked if he wants to reload the workspace? If not what will happen when the workspace is stopped and restarted? What if the URL of the github repo in the devfile (the project source) is changed?

  • It looks like there isn't nothing to change with respect to chefile and factories. Devfile will be an alternative to these two features. Is it correct? Maybe we could make it explicit

@skabashnyuk
Copy link
Contributor

Before we start use-case grouping I would like to have an agreement on some technical aspects.

I would say all stories can be divided into such categories.

  • we have Devfile content
  • we have an HTTP link to Devfile
  • Devfile is under vcs. (This use case has the biggest effect on technical solution)

Next, we have two ways to have a working workspace from Devfile.

  1. Get content of Devfile, transform it to workspace config 1 to 1 before workspace start.
  2. Get content of Devfile during workspace start

From what I see, I think the second solution is better, especially for the most interesting case when Devfile is under vcs.

My proposal is to add new optional entry to workspace configuration.

  1. For the case when we have Devfile content
        "devfile": {
          "type": "devfile",
          "content": "Content of devfile"
          "parameters": {}
        }
  1. For the case when we have a http link for Devfile
        "devfile": {
          "type": "url",
          "content": "https://github.com/che-samples/console-java-simple/Devfile"
          "parameters": {}
        }
  1. For the case when Devfile is under vcs
        "devfile": {
          "type": "git",
          "content": "https://github.com/che-samples/console-java-simple.git"
          "parameters": {}
        }
        "devfile": {
          "type": "hg",
          "content": "http://selenic.com/hg"
          "parameters": {}
        }
        "devfile": {
          "type": "svn",
          "content": "svn://xxx.xxx.xxx.xxx/Repository/"
          "parameters": {}
        }

Then on workspace start, we will have some DevFile Broker(dependent on type) that will play alongside with our ChePlugin broker to get effective workspace configuration.
The questions here:

  • who, when and how many times are going to clone sources.
  • how to generate Devfile from workspace with Devfile under vcs.

@l0rd
Copy link
Contributor

l0rd commented Oct 10, 2018

Get content of Devfile during workspace start

devfile=description of your workspace. How are you going to start the workspace if you haven't read the devfile yet?

DevFile Broker(dependent on type) that will play alongside with our ChePlugin broker

Ok but keep in mind that plugins list is defined in the devfile too

who, when and how many times are going to clone sources.

When a git repo is specified we should clone first (who: the devfile broker, where: in the /projects volume, how many times: just one I hope :-) ) and start the workspace (editor + plugins) as a second step.

how to generate Devfile from workspace with Devfile under vcs

I am not sure I get your question. The scenario for generating the devfile is out of scope right?

@sleshchenko
Copy link
Member

@skabashnyuk @slemeur @l0rd I believe it's a good time to revise this epic and close it, maybe create another one for some improvements since every issue linked here is fixed or closed by che-bot because of inactivity for 180 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/epic A long-lived, PM-driven feature request. Must include a checklist of items that must be completed.
Projects
None yet
Development

No branches or pull requests

4 participants