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

Used manually written Devfile POJOs instead of generated ones. #13048

Merged
merged 3 commits into from
Apr 3, 2019

Conversation

sleshchenko
Copy link
Member

@sleshchenko sleshchenko commented Apr 2, 2019

What does this PR do?

Use manual written Devfile POJOs instead of generated ones.

Is this PR tested?

Yes, I used the following Devfiles for testing:

Devfile multiple K8s components
specVersion: 0.0.1
name: multiple-k8s-tools
projects:
  - name: nodejs-mongo-app
    source:
      type: git
      location: 'https://github.com/ijason/NodeJS-Sample-App.git'
components:
  - 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: mongodb
    type: kubernetes
    reference: mongo.yaml
    referenceContent: |
      ---
      apiVersion: v1
      kind: List
      items:
      -
        apiVersion: apps/v1
        kind: Deployment
        metadata:
          labels:
            name: mongo
          name: mongo-controller
        spec:
          template:
            metadata:
              labels:
                name: mongo
              name: mongo-controller
            spec:
              containers:
              - image: mongo
                name: mongo
                ports:
                - name: mongo
                  containerPort: 27017
                volumeMounts:
                    - name: mongo-persistent-storage
                      mountPath: /data/db
              volumes:
                - name: mongo-persistent-storage
                  persistentVolumeClaim:
                    claimName: mongo-persistent-storage
      -
        apiVersion: v1
        kind: Service
        metadata:
          name: mongo
          labels:
            name: mongo
          name: mongo
        spec:
          ports:
            - port: 27017
              targetPort: 27017
          selector:
            name: mongo
      -
        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: mongo-persistent-storage
        spec:
          accessModes:
           - ReadWriteOnce
          resources:
            requests:
              storage: 3Gi
  - name: nodejs
    type: openshift
    reference: node-js.yaml
    referenceContent: |
      apiVersion: v1
      kind: List
      items:
      -
        apiVersion: apps/v1
        kind: Deployment
        metadata:
          name: web
          labels:
            app: nodejs
        spec:
          replicas: 2
          selector:
            name: web
          template:
            metadata:
              labels:
                app: nodejs
              name: web-controller
            spec:
              containers:
              - image: node:0.10.40
                command: ['tail', '-f', '/dev/null']
                args: []
                name: web
                ports:
                - containerPort: 3000
                  name: http-server
                volumeMounts:
                 - mountPath: /projects
                   name: projects
              volumes:
               - name: projects
                 persistentVolumeClaim:
                   claimName: projects
      - apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: projects
        spec:
          accessModes:
           - ReadWriteOnce
          resources:
            requests:
              storage: 2Gi
      -
        apiVersion: v1
        kind: Service
        metadata:
          name: web
          labels:
            name: web
        spec:
          type: LoadBalancer
          ports:
            - name: web
              port: 80
              targetPort: 3000
              protocol: TCP
          selector:
            app: nodejs
      - apiVersion: v1
        kind: Route
        metadata:
          name: che
        spec:
          to:
            kind: Service
            name: web
          port:
            targetPort: web
commands:
  - name: run
    actions:
      - type: exec
        component: nodejs
        command: cd /projects/nodejs-mongo-app/EmployeeDB/ && npm install && sed -i -- ''s/localhost/mongo/g'' app.js && node app.js
        workdir: /projects/che
Devfile multiple dockerimage components
specVersion: 0.0.1
name: multiple-dockerimages
projects:
  - name: nodejs-mongo-app
    source:
      type: git
      location: 'https://github.com/ijason/NodeJS-Sample-App.git'
components:
  - 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: mongodb
    type: dockerimage
    image: mongo
    endpoints:
      - name: mongo
        port: 27017
        attributes:
          public: "false"
          discoverable: "true"
    mountSources: false
    volumes:
      - name: mongo-storage
        containerPath: /data/db
    memoryLimit: 250Mi
  - name: nodejs-app
    type: dockerimage
    image: node:0.10.40
    command: ['tail', '-f', '/dev/null']
    args: []
    endpoints:
      - name: app
        port: 3000
        attributes:
          public: "true"
    mountSources: true
    memoryLimit: 512Mi
commands:
  - name: run
    actions:
      - type: exec
        component: nodejs-app
        command: cd ${CHE_PROJECTS_ROOT}/nodejs-mongo-app/EmployeeDB/ && npm install && node app.js
Devfile with overridden entrypoints for K8s component
specVersion: 0.0.1
name: entrypoint-test
projects:
- name: revapi
  source:
    type: git
    location: https://github.com/revapi/revapi.git
tools:
- name: theia
  type: cheEditor
  id: org.eclipse.che.editor.theia:1.0.0
- name: exec
  type: chePlugin
  id: che-machine-exec-plugin:0.0.1
- name: mvn
  type: kubernetes
  local: recipe
  localContent: |
    kind: Pod
    metadata:
      name: mvn-pod
    spec:
      containers:
      - image: maven:3.6.0-jdk-11
        name: mvn-container
  entrypoints:
  - command: ['tail']
    args: ['-f', '/dev/null']

What issues does this PR fix or reference?

It is related to #13018

Release Notes

N/A

Docs PR

N/A

@sleshchenko sleshchenko added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. labels Apr 2, 2019
@sleshchenko sleshchenko self-assigned this Apr 2, 2019
@sleshchenko sleshchenko changed the title Used manual written Devfile POJOs instead of generated ones. Used manually written Devfile POJOs instead of generated ones. Apr 2, 2019
@sleshchenko
Copy link
Member Author

ci-test

@che-bot
Copy link
Contributor

che-bot commented Apr 2, 2019

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

@SkorikSergey
Copy link
Contributor

Selenium tests execution on Eclipse Che Multiuser on OCP (https://ci.codenvycorp.com/job/che-pullrequests-test-ocp/1680//Selenium_20tests_20report/) doesn't show any regression against this Pull Request.

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
Copy link
Member Author

Rebased against master (without any changes) before merge

@sleshchenko
Copy link
Member Author

ci-build

@sleshchenko sleshchenko merged commit ff5a760 into eclipse-che:master Apr 3, 2019
@sleshchenko sleshchenko deleted the devfileObjects branch April 3, 2019 11:45
@vkuznyetsov vkuznyetsov mentioned this pull request Apr 4, 2019
12 tasks
@che-bot
Copy link
Contributor

che-bot commented Apr 12, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants