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

Preview url on server #14713

Merged
merged 35 commits into from
Oct 24, 2019
Merged

Preview url on server #14713

merged 35 commits into from
Oct 24, 2019

Conversation

sparkoo
Copy link
Member

@sparkoo sparkoo commented Sep 30, 2019

What does this PR do?

Constructs preview url for commands at start-up time. It reuses already defined endpoints or create new Service + Ingress/Route pair, when no suitable existing endpoint found.

test image: quay.io/mvala/che-server:previewurl

example devfile with dockerimage component
---
apiVersion: 1.0.1-beta
metadata:
  name: dummy-go-server
projects:
  -
    name: dummy-http-server
    source:
      type: git
      location: "https://github.com/sparkoo/dummy-http-server.git"
components:
  -
    type: dockerimage
    image: quay.io/eclipse/che-golang-1.10:nightly
    alias: go-cli
    mountSources: true
    memoryLimit: 256Mi
commands:
  -
    name: run on 8081 and /hello path
    previewUrl:
      port: 8081
      path: "/hello"
    actions:
      -
        type: exec
        component: go-cli
        command: "go run main.go 8081 /hello"
        workdir: ${CHE_PROJECTS_ROOT}/dummy-http-server

example devfile with kubernetes component (change component type to `openshift` for openshift component should be enough)
---
apiVersion: 1.0.1-beta
metadata:
  name: dummy-go-k8s
projects:
  -
    name: dummy-http-server
    source:
      type: git
      location: "https://github.com/sparkoo/dummy-http-server.git"
components:
  -
    type: kubernetes
    alias: go-k8s
    mountSources: true
    referenceContent: |
          kind: List
          items:
          - kind: Pod
            apiVersion: v1
            metadata:
              name: go-runner
            spec:
              containers:
                - name: go-110-server
                  image: quay.io/eclipse/che-golang-1.10:nightly
                - name: go-112-server
                  image: quay.io/eclipse/che-golang-1.12:nightly
commands:
  -
    name: run on 8080 and /hello
    previewUrl:
      port: 8080
      path: /hello
    actions:
      -
        type: exec
        component: go-k8s
        command: "go run main.go 8080 /hello"
        workdir: ${CHE_PROJECTS_ROOT}/dummy-http-server



What issues does this PR fix or reference?

#14893

This Theia issue has to be fixed to get previewurl fully working #14892

Docs PR

@che-bot che-bot added kind/enhancement A feature request - must adhere to the feature request template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Sep 30, 2019
Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

I like this approach more than previous with logic in WorkspaceService

@che-bot
Copy link
Contributor

che-bot commented Oct 4, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:

@che-bot
Copy link
Contributor

che-bot commented Oct 4, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:

@che-bot
Copy link
Contributor

che-bot commented Oct 5, 2019

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 5, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:

@che-bot
Copy link
Contributor

che-bot commented Oct 5, 2019

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E tests of Eclipse Che Multiuser on OCP has failed:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E tests of Eclipse Che Multiuser on OCP has failed:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@skabashnyuk
Copy link
Contributor

@sparkoo can you add some examples of devfile in pr description?

@sparkoo
Copy link
Member Author

sparkoo commented Oct 7, 2019

@sparkoo can you add some examples of devfile in pr description?

yes, done

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 7, 2019

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@sparkoo sparkoo changed the title 🚧 Preview url 2 (at startup time) 🚧 Preview url Oct 7, 2019
@sparkoo sparkoo marked this pull request as ready for review October 7, 2019 23:31
sparkoo and others added 25 commits October 24, 2019 10:00
Signed-off-by: Michal Vala <mvala@redhat.com>
…le generator

Signed-off-by: Michal Vala <mvala@redhat.com>
…or class

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
…resses, preload ingresses/routes to avoid multiple k8s api querying

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
…ntext

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
…inks map

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
…s with abstract ancestor

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
@che-bot
Copy link
Contributor

che-bot commented Oct 24, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

@che-bot
Copy link
Contributor

che-bot commented Oct 24, 2019

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@sparkoo sparkoo merged commit 5d38d7a into eclipse-che:master Oct 24, 2019
@sparkoo sparkoo deleted the previewUrl2 branch October 24, 2019 09:40
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. 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.

7 participants