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

Adjust Workspace.Next model classes to latest updates in the Workspace.Next vision #10246

Merged
merged 3 commits into from Jul 4, 2018

Conversation

garagatyi
Copy link

What does this PR do?

This PR rework Workspace.Next model classes in accordance with #9964 .
Also, it replaces kubsrv service with Apache web server that hosts Workspace.Next Feature/ChePlugin files. They are stored in YAML format instead of JSON (comparing to kubsrv).
Also added support of Che Server protocol and path, so it is possible to run Classic GWT IDE in Workspace Next now.
PR contains a dockerfile for building marketplace placeholder service and it is possible to replace content with other files, so developers can play with it during development.
Additional unit tests were also added.

What issues does this PR fix or reference?

#9964

Release Notes

Docs PR

Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
@garagatyi
Copy link
Author

ci-test

@benoitf benoitf added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/enhancement A feature request - must adhere to the feature request template. labels Jul 2, 2018
@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:10246
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
@garagatyi garagatyi changed the title [WIP] Adjust Workspace.Next model classes to latest updates in the Workspace.Next vision Adjust Workspace.Next model classes to latest updates in the Workspace.Next vision Jul 3, 2018
@garagatyi
Copy link
Author

@sleshchenko @l0rd @ibuziuk @skabashnyuk Please, review the PR

assertEquals(memoryLimitAttribute, Integer.toString(MEMORY_LIMIT_MB * 1024 * 1024));
}

private ChePlugin testChePlugin() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, testChePlugin sounds like it should test ChePlugin, but in facts, it creates test ChePlugin object. It does not make much sense since it is test sources but maybe just createChePlugin would be clearer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will change it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Map<String, List<String>> parameters = new HashMap<>();
for (CheFeature feature : features) {
for (CheServiceReference serviceReference : feature.getSpec().getServices()) {
if (serviceReference.getParameters().isEmpty()) {
for (ChePluginReference pluginReference : feature.getSpec().getServices()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be feature.getSpec().getServices() method renamed to feature.getSpec().getFeature()?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to update Feature related model as we are going to remove this entity from the model according to the discussion in workspace next walking skeleton #10123

@@ -70,7 +70,7 @@ public boolean equals(java.lang.Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
CheServiceReference cheServiceReference = (CheServiceReference) o;
ChePluginReference cheServiceReference = (ChePluginReference) o;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cheServiceReference -> chePluginReference
Please make sure that all usages of service is replaced with plugin

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to update Feature related model as we are going to remove this entity from the model according to the discussion in workspace next walking skeleton #10123

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but it's not about feature model changing, but about variable name =)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Copy link
Contributor

@l0rd l0rd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I have 2 comments that we can discuss and address in separate issues:

  • you are including the switch to apache for the marketplace (that was not part of the model adujstment) but I think it should live in a separate github repository
  • you are basing everything on the kubectl deployment type instead of using helm whereas I think helm should be the default

@ibuziuk
Copy link
Member

ibuziuk commented Jul 4, 2018

I wanted to test the PR on minishift by deploying che-server with feature-api in the same namespace and creating workspace via:

`curl 'http://che-mini-che.192.168.42.3.nip.io/api/workstribute=features:org.eclipse.che.che-theia/0.0.3' -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"environments":{"default":{"recipe":{"contentType":"application/x-yaml","type":"openshift","content":"---\nkind: List\nitems:\n-\n  apiVersion: v1\n  kind: Pod\n  metadata:\n    name: wsnextdemo\n  spec:\n    containers:\n      -\n        image: eclipse/ubuntu_jdk8\n        name: app"},"machines":{"wsnextdemo/app":{"attributes":{}}}}},"defaultEnv":"default","name":"workspace-next"}'

image

Workspace is started correctly but for some reason I do not have Theia server with URL to IDE:

{
  "links": {
    "self": "http://che-mini-che.192.168.42.3.nip.io/api/workspace/workspacekjyngxxri64tbduv",
    "ide": "http://che-mini-che.192.168.42.3.nip.io/che/workspace-next",
    "environment/outputChannel": "ws://che-mini-che.192.168.42.3.nip.io/api/websocket",
    "environment/statusChannel": "ws://che-mini-che.192.168.42.3.nip.io/api/websocket"
  },
  "attributes": {
    "features": "org.eclipse.che.che-theia/0.0.3",
    "updated": "1530720068026",
    "created": "1530719995093"
  },
  "namespace": "che",
  "id": "workspacekjyngxxri64tbduv",
  "temporary": false,
  "status": "RUNNING",
  "runtime": {
    "machines": {
      "wsnextdemo/app": {
        "attributes": {
          "memoryLimitBytes": "1073741824"
        },
        "servers": {},
        "status": "RUNNING"
      }
    },
    "warnings": [],
    "activeEnv": "default",
    "machineToken": "",
    "links": []
  },
  "config": {
    "defaultEnv": "default",
    "environments": {
      "default": {
        "machines": {
          "wsnextdemo/app": {
            "attributes": {},
            "servers": {},
            "volumes": {},
            "installers": [],
            "env": {
              "CHE_MACHINE_NAME": "wsnextdemo/app"
            }
          }
        },
        "recipe": {
          "type": "openshift",
          "content": "---\nkind: List\nitems:\n-\n  apiVersion: v1\n  kind: Pod\n  metadata:\n    name: wsnextdemo\n  spec:\n    containers:\n      -\n        image: eclipse/ubuntu_jdk8\n        name: app",
          "contentType": "application/x-yaml"
        }
      }
    },
    "name": "workspace-next",
    "projects": [],
    "commands": [],
    "links": []
  }
}

Any ideas what I'm doing wrong ?
Please, do not consider this comment as smth. that should prevent merging. I just getting acquainted with workspace next and might be doing smth. wrong

@garagatyi garagatyi merged commit 9fe9021 into eclipse-che:master Jul 4, 2018
@garagatyi garagatyi deleted the wsnextNewModel branch July 4, 2018 16:14
@garagatyi
Copy link
Author

@l0rd I switched to Apache because didn't want to do model changes for kubsrv service in Golang. I think it is easier to support for the time being. Can you elaborate what exactly you would want to move to another repository?
I used kubectl since it is simpler for me, but yeah, we should support helm too.

@garagatyi
Copy link
Author

@ibuziuk I answered in MM channel

@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Jul 4, 2018
@benoitf benoitf added this to the 6.8.0 milestone Jul 4, 2018
@l0rd
Copy link
Contributor

l0rd commented Jul 4, 2018

@garagatyi I would move the content of folder deploy/kubernetes/kubectl/wsnext/ to a distinct repository and setup the CI to build the Dockerfile. I will add that as a ws.next skeleton task.

hbhargav pushed a commit to hbhargav/che that referenced this pull request Dec 5, 2018
…e.Next vision (eclipse-che#10246)

Rework model, of CheService and renamed it to ChePlugin. 
Replace features hosting to apache server to be able to host plugin files and avoiding having model files for Go lang.
Host YAMLs instead of JSONs. Downloads and parse ChePlugin YAMLs instead of JSONs from the marketplace.
Improve unit tests coverage. 
Add support of Che Server protocol and path, so it is possible to run Classic GWT IDE in Workspace Next now.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
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.

None yet

7 participants