Skip to content

Conversation

@JPinkney
Copy link
Contributor

@JPinkney JPinkney commented Feb 23, 2021

What does this PR do?

This PR implements the basic of the CRUD (Create, read, update delete) actions in the dashboard for devworkspaces as well as a few other functionality.

  • 6a758cb implements support for:
    • Creating a devworkspace in custom workspace tab
    • Listing all devworkspaces
    • Starting/Stopping devworkspaces
    • Deleting devworkspaces
    • Providing configuration for allowing admins to switch between Devfile v1/Devfile v2 support
      • If DevWorkspace operator is enabled and the Devfile is a Devfile v2 then it will use the devworkspace-client for making the calls
    • A default project is created when a user loads the dashboard (if one doesn't already exist).
    • Injecting default plugins and editors if none are found
      • Currently this implementation will always add che-machine-exec and theia
    • Initial factory support
      • Everything seems to be working expect for one bug when the devworkspace is opened in a new tab before being shown in the iframe
      • Still need to use the che routing class when creating the workspace
  • 8723920 is devworkspace support in monaco
    • When the devworkspace-operator is enabled both the devfile v1 and devfile v2 schemas are enabled
    • Editor is set to read-only when viewing the devfile

Minor issues

  • timestamp is not updating when you start/stop a devworkspace

Things to do

To test:

echo "
spec:
  k8s:
    singleHostExposureType: 'gateway'
  devWorkspace:
    enable: true
  server:
    serverExposureStrategy: single-host
    cheImage: 'docker.io/maxura/che-server'
    cheImageTag: 'che-dashboard-pull-175'
    cheImagePullPolicy: Always
"
> /tmp/devworkspace-che.yaml

chectl server:deploy --platform=openshift --installer=operator --che-operator-cr-patch-yaml=/tmp/devworkspace-che.yaml

Install devworkspace-operator on the cluster:

git clone https://github.com/che-incubator/devworkspace-che-operator
cd devworkspace-che-operator
kubectl create namespace devworkspace-che
make install deploy
kubectl apply -n devworkspace-che -f ./samples/che-manager-openshift.yaml
# then try dashboard
kubectl get routes

Then you can use: https://raw.githubusercontent.com/JPinkney/sample-devfile-repo/master/devfile.yaml as a sample devfile

You can also use: http://localhost:3333/#/load-factory/?url=https://github.com/JPinkney/sample-devfile-repo for simple factory

What issues does this PR fix or reference?

Fixes eclipse-che/che#18858

It also implement Factory flow eclipse-che/che#18846
Fixes eclipse-che/che#19147

Release Notes

Docs PR

Includes:
- Creating, Listing, Starting, Stopping, Deleting Devworkspaces

Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@github-actions
Copy link

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.11 53.79 41.93 39.75 54.57 52.2 55.9 53.56
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.81 0 0 23.81
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 24.53 0 7.14 21.57
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevfileRegistries/index.ts 39.62 0 54.55 39.62
src/store/Workspaces/index.ts 7.32 0 0 7.35

@che-bot
Copy link
Contributor

che-bot commented Feb 23, 2021

✅ E2E dashboard-next tests succeed 🎉

See Details

  • Jenkins job

  • logs and configs

  • Che dashboard-next image:docker.io/maxura/che-dashboard:175

  • Che server image: docker.io/maxura/che-server:175

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@github-actions
Copy link

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.11 53.72 41.93 39.5 54.57 52.2 55.9 53.5
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.81 0 0 23.81
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 24.19 0 7.14 21.67
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevfileRegistries/index.ts 39.62 0 54.55 39.62
src/store/Workspaces/index.ts 7.32 0 0 7.35

@che-bot
Copy link
Contributor

che-bot commented Feb 23, 2021

✅ E2E dashboard-next tests succeed 🎉

See Details

  • Jenkins job

  • logs and configs

  • Che dashboard-next image:docker.io/maxura/che-dashboard:175

  • Che server image: docker.io/maxura/che-server:175

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

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 tried to test with Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175 on RHPDS but it did not work stably for me:

  1. DevWorkspace displayed as Starting even if it's stopped or failed.
    Screenshot_20210224_145153
    Screenshot_20210224_145042
    After sometime I was not able to reproduce it

  2. I was not able to create a devworkspace with devfile v2 if it does not have any component or command

schemaVersion: 2.0.0
metadata:
  generateName: theia

Error: Failed to create a new workspace from the devfile: Cannot read property 'push' of undefined

  1. After DevWorkspace is removed on the cluster, it's still on the Dashboard (which is not really a bug but since we request each second, would be great if we're able to update dashboard state).

Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@github-actions
Copy link

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.08 53.58 41.89 39.24 54.52 52.15 55.88 53.35
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.08 0 0 23.08
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 22.22 0 6.67 20
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevfileRegistries/index.ts 39.62 0 54.55 39.62
src/store/Workspaces/index.ts 7.32 0 0 7.35

@che-bot
Copy link
Contributor

che-bot commented Feb 24, 2021

✅ E2E dashboard-next tests succeed 🎉

See Details

  • Jenkins job

  • logs and configs

  • Che dashboard-next image:docker.io/maxura/che-dashboard:175

  • Che server image: docker.io/maxura/che-server:175

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

@github-actions
Copy link

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.08 53.58 41.89 39.24 54.52 52.15 55.88 53.35
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.08 0 0 23.08
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 22.22 0 6.67 20
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevfileRegistries/index.ts 39.62 0 54.55 39.62
src/store/Workspaces/index.ts 7.32 0 0 7.35

@che-bot
Copy link
Contributor

che-bot commented Feb 24, 2021

✅ E2E dashboard-next tests succeed 🎉

See Details

  • Jenkins job

  • logs and configs

  • Che dashboard-next image:docker.io/maxura/che-dashboard:175

  • Che server image: docker.io/maxura/che-server:175

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

@che-bot
Copy link
Contributor

che-bot commented Feb 25, 2021

❌ E2E dashboard-next tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.08 53.54 41.89 39.24 54.52 52.1 55.88 53.31
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.08 0 0 23.08
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 22.22 0 6.67 20
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevfileRegistries/index.ts 39.62 0 54.55 39.62
src/store/Workspaces/index.ts 7.32 0 0 7.35

@github-actions
Copy link

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

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.

Approving since it supports the flow which is needed for milestone 1:

  1. Create a workspace with custom workspace with devfile v2, or with factory flow.
  2. Propagate workspace status
  3. Open a workspace.

But we accept fact that some corner cases do not work, like edit workspace name (but UI don't forbid it).

Next step is propagate default plugins as DWT CRs in the same namespace where DW lives, since it's workflow we agreed on F2F and there is no plan to deploy DWT registry for milestone 1.

@sleshchenko
Copy link
Member

[dashboard-next-ci-test]

@sleshchenko
Copy link
Member

After rebasing on master pre-creating namespaces no longer works because of the changes in #172 (files). I'm still trying to figure out a solution

I've created issue to handle missing pieces for milestone 1, feel free to comment or update if I'm missing something eclipse-che/che#19147

@che-bot
Copy link
Contributor

che-bot commented Mar 4, 2021

❌ E2E dashboard-next tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

JPinkney and others added 2 commits March 5, 2021 11:00
@sleshchenko sleshchenko force-pushed the devworkspace-client2 branch from 7ce566f to 9cff09a Compare March 5, 2021 09:12
@che-bot
Copy link
Contributor

che-bot commented Mar 5, 2021

❌ E2E dashboard-next tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.13 53.02 41.95 38.86 54.52 51.95 55.92 52.78
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.08 0 0 23.08
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 20 0 6.67 18.07
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevWorkspacePlugins.ts 0 0 0 0
src/store/DevfileRegistries/index.ts 38.18 0 54.55 38.18
src/store/Workspaces/index.ts 6.82 0 0 6.85

@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

@sleshchenko
Copy link
Member

[dashboard-next-ci-test]

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.

It must be ready to merge if it at least does not break dashboard when DevWorkspace is enabled. I'm testing it.

DevWorkspace can't be tested properly due a bug on DevWorkspace Che Operator, Lukas is taking a look.

@che-bot
Copy link
Contributor

che-bot commented Mar 5, 2021

❌ E2E dashboard-next tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@che-bot
Copy link
Contributor

che-bot commented Mar 5, 2021

❌ E2E dashboard-next tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.13 53.11 41.95 38.86 54.52 51.95 55.92 52.87
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.08 0 0 23.08
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 20 0 6.67 18.07
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevWorkspacePlugins.ts 0 0 0 0
src/store/DevfileRegistries/index.ts 38.89 0 54.55 38.89
src/store/Workspaces/index.ts 7.01 0 0 7.04

@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

@sleshchenko sleshchenko force-pushed the devworkspace-client2 branch from 5921240 to 9cff09a Compare March 5, 2021 12:19
@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.13 53.02 41.95 38.86 54.52 51.95 55.92 52.78
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.08 0 0 23.08
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 20 0 6.67 18.07
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevWorkspacePlugins.ts 0 0 0 0
src/store/DevfileRegistries/index.ts 38.18 0 54.55 38.18
src/store/Workspaces/index.ts 6.82 0 0 6.85

@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Code coverage diff between base branch:master and head branch: devworkspace-client2

File % Stmts % Branch % Funcs % Lines
total 56.13 53.12 41.95 39.08 54.52 51.95 55.92 52.88
src/components/DevfileEditor/index.tsx 22.05 22.61 10.47 11.7 11.76 11.76 22.11 22.68
src/containers/FactoryLoader.tsx 86.63 86.63 77.32 76.77 100 100 86.47 86.47
src/pages/GetStarted/CustomWorkspaceTab/index.tsx 86.67 84.21 58.7 61.76 83.33 83.33 86.49 84
src/pages/WorkspacesList/Rows.tsx 70.18 70.18 30 28.13 85.71 85.71 70.18 70.18
src/services/cheWorkspaceClient/index.ts 27.5 6.67 18.18 25.97
src/services/helpers/devworkspace.ts 23.08 0 0 23.08
src/services/workspace-client/cheWorkspaceClient.ts 37.5 0 28.57 36.36
src/services/workspace-client/devWorkspaceClient.ts 20 0 6.67 18.07
src/services/workspace-client/index.ts 26 7.14 9.09 22.92
src/store/DevWorkspacePlugins.ts 0 0 0 0
src/store/DevfileRegistries/index.ts 38.89 0 54.55 38.89
src/store/Workspaces/index.ts 7.01 0 0 7.04

@che-bot
Copy link
Contributor

che-bot commented Mar 5, 2021

✅ E2E dashboard-next tests succeed 🎉

See Details

  • Jenkins job

  • logs and configs

  • Che dashboard-next image:quay.io/crw_pr/che-dashboard:175

  • Che server image: quay.io/crw_pr/che-server:175

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

1 similar comment
@github-actions
Copy link

github-actions bot commented Mar 5, 2021

Docker image build succeeded: docker.io/maxura/che-server:che-dashboard-pull-175

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.

Dashboard on minikube works fine for me now.
Approving but it's needed to make sure Dashboard works fine on OpenShift with DevWorkspace support disabled.

@l0rd l0rd mentioned this pull request Mar 5, 2021
24 tasks
@JPinkney
Copy link
Contributor Author

JPinkney commented Mar 5, 2021

I re-tested again with OpenShift and che.devworkspaces.enabled set to true and everything seemed working. I also tested with che.devworkspaces.enabled set to false on OpenShift and everything seemed to be working as well. I've created the last CQ's needed: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23110 and https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23109

@sleshchenko sleshchenko merged commit 2121d43 into master Mar 9, 2021
@sleshchenko sleshchenko deleted the devworkspace-client2 branch March 9, 2021 12:03
@che-bot che-bot added this to the 7.28 milestone Mar 9, 2021
@che-bot
Copy link
Contributor

che-bot commented Mar 9, 2021

❌ E2E dashboard-next tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[dashboard-next-ci-test]" to rerun the 'dashboard-next' e2e tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvements to devfile v2 factory flow support Initial Dashboard support for DevWorkspaces

6 participants