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

Add support of dockerimage tool in Devfile #12649

Merged
merged 4 commits into from
Feb 13, 2019

Conversation

sleshchenko
Copy link
Member

@sleshchenko sleshchenko commented Feb 11, 2019

What does this PR do?

The main purpose of this PR is adding support of dockerimage tool in Devfile.

But it also contains the following Devfile API improvements:

  1. Improve devfile.json:
  • Deny additional properties for Tool;
  • Make tool implementation specific fields required accordingly to type value;
  • Limit actions number in command to 1 item since we don't support more yet;
  1. Add testing of Devfile JSON Schema. It allows us to guarantee that no any restrictions are broken because of a typo in devfile.json or validator implementation we use (I faced an issue that we declare our devfile.json as JSON Spec 07 Draft but validator that we use don't support if/then/else statements and just skip them.
    It also allows seeing an error message that is thrown by a validator in the source code, like instance failed to match exactly one schema (matched 0 out of 3) when chePlugin tool does not have id required field. It is a definitely confusing message and we should consider rewriting devfile.json/use another validator/customize current one to make a message more clear.

As an example of che-in-che Devfile with dockerimage

Che-in-Che Devfile with dockerimage tool used
specVersion: 0.0.1
name: che-in-che
projects:
  - name: che
    source:
      type: git
      location: 'https://github.com/eclipse/che.git'
tools:
  - name: theia-editor
    type: cheEditor
    id: org.eclipse.che.editor.theia:1.0.0
  - name: exec-plugin
    type: chePlugin
    id: che-machine-exec-plugin:0.0.1
  - name: che-dev
    type: dockerimage
    image: eclipse/che-dev:nightly
    env:
      - name: TEST_ENV_VAR
        value: -\_-_-_/-
    endpoints:
      - name: tomcat
        port: 8080
        attributes:
          public: 'true'
    volumes:
      - name: maven
        containerPath: /home/user/.m2
    memoryLimit: 1536M
    mountSources: true
commands:
  - name: build
    actions:
      - type: exec
        tool: che-dev
        command: cd /projects/che && mvn -Pnative clean install
        workdir: /projects/che

To test changes the following link might be used {CHE_HOST}/f?url=https://github.com/sleshchenko/che/tree/dockerimage-che-in-che

What issues does this PR fix or reference?

#12389

Release Notes

Added support of dockerimage tool in Devfile. It allows defining one container tool much easier than using other tools types. The detailed description of Devfile format see https://redhat-developer.github.io/devfile.

Docs PR

I think devfile.json contains all the needed changes.

@sleshchenko sleshchenko added kind/enhancement A feature request - must adhere to the feature request template. status/in-progress This issue has been taken by an engineer and is under active development. labels Feb 11, 2019
@sleshchenko sleshchenko self-assigned this Feb 11, 2019
@sleshchenko sleshchenko force-pushed the dockerimageTool branch 2 times, most recently from 4067583 to 5d0e44a Compare February 11, 2019 15:10
@eclipse-che eclipse-che deleted a comment from todo bot Feb 11, 2019
@eclipse-che eclipse-che deleted a comment from todo bot Feb 11, 2019
@eclipse-che eclipse-che deleted a comment from todo bot Feb 11, 2019
@eclipse-che eclipse-che deleted a comment from todo bot Feb 11, 2019
@eclipse-che eclipse-che deleted a comment from todo bot Feb 11, 2019
@eclipse-che eclipse-che deleted a comment from todo bot Feb 11, 2019
@eclipse-che eclipse-che deleted a comment from todo bot Feb 11, 2019
@sleshchenko sleshchenko changed the title WIP Add support of dockerimage tool in Devfile Add support of dockerimage tool in Devfile Feb 11, 2019
@sleshchenko sleshchenko added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. and removed status/in-progress This issue has been taken by an engineer and is under active development. labels Feb 11, 2019
@sleshchenko
Copy link
Member Author

@mshaposhnik I've fixed/answered your comments and added an ability to export workspace with dockerimage recipe. Please review again.

@sleshchenko
Copy link
Member Author

ci-test

@che-bot
Copy link
Contributor

che-bot commented Feb 13, 2019

Results of automated E2E tests of Eclipse Che Multiuser on OCP:
Build details
Test report
docker image: eclipseche/che-server:12649
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@sleshchenko
Copy link
Member Author

Success Rate: 99.369% 🎉
@eclipse/eclipse-che-qa Please review #12649 (comment)

Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
@sleshchenko sleshchenko merged commit cc5ed54 into eclipse-che:master Feb 13, 2019
@sleshchenko sleshchenko deleted the dockerimageTool branch February 13, 2019 14:24
@che-bot che-bot added this to the 6.19.0 milestone Feb 13, 2019
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants