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

Prepare environment for async storage of project sources #16972

Merged
merged 12 commits into from
Jul 15, 2020
Merged

Conversation

vparfonov
Copy link
Contributor

@vparfonov vparfonov commented May 19, 2020

Signed-off-by: Vitalii Parfonov [email protected]

What does this PR do?

This PR will introduce a new experimental feature which should provide fast I/O and give ability to persist your changes. In other words this is new kind of storage with fast I/O like in Ephemeral Mode but with saving changes like in traditional Persistent Mode.

For this we introduce special plugin which will be automatically added to workspace configuration in case user select this type of storage. Plugin will initiate restore command on workspace startup and backup all sources on workspace stop, also changes will be periodically backup during workspace is running (e.g. each 5 or 10 minutes).

During restore procedure events with information about restore process sent via WebScoket connection and client (like Che Theia) can show this information in UI.

For backup/restore procedure used rsync (https://rsync.samba.org/) via SSH connection.

The special pod will start in OpenShift environment in user namespace, it will respond for storing files. In other words plugin it’s rsync client, storage pod - rsync server.

Here initial for plugin and storage: Initial contribution for workspace sync feature #2

For establishing secure connection special pair of SSH keys will be generated if they don't exist and mount to the plugin container (private part) and to the storage pod (public part).

IMPORTANT: This feature at the moment will work only with common PVC strategy.

If other (or current workspace) configured to the to use the traditional persistent mode,
to prevent getting 'Multi-Attach error for volume' asynchronous storage pod will be shutdown. After deleting asynchronous storage pod procedure of starting workspace will be continued as usual.

To try this PR you can use this devfile:

metadata:
  name: jerry-second-ws
attributes:
  persistVolumes: 'false'
  asyncPersist: 'true'
components:
  - id: che-incubator/typescript/latest
    type: chePlugin
  - mountSources: true
    endpoints:
      - name: angular
        port: 4200
    memoryLimit: 1Gi
    type: dockerimage
    alias: nodejs
    image: 'quay.io/eclipse/che-nodejs10-community:7.12.1'
apiVersion: 1.0.0

Ready to use images:
che-server: vparfonov/che-server:0708
che-plugin-registry: vparfonov/che-plugin-registry:0708

What issues does this PR fix or reference?

Release Notes

Docs PR

@che-bot che-bot added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label May 19, 2020
@che-bot
Copy link
Contributor

che-bot commented May 19, 2020

❌ E2E Happy path tests failed ❗

See Details

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

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

@vparfonov vparfonov removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label May 19, 2020
@che-bot che-bot added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label May 26, 2020
@che-bot
Copy link
Contributor

che-bot commented May 26, 2020

✅ E2E Happy path tests succeed 🎉

See Details

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

@che-bot
Copy link
Contributor

che-bot commented May 26, 2020

✅ E2E Happy path tests succeed 🎉

See Details

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

@vparfonov vparfonov marked this pull request as ready for review May 27, 2020 08:37
@vparfonov vparfonov changed the title Prepare environment for async storage of project sources [WIP] 🚧 Prepare environment for async storage of project sources May 27, 2020
@che-bot
Copy link
Contributor

che-bot commented May 27, 2020

✅ E2E Happy path tests succeed 🎉

See Details

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

@che-bot
Copy link
Contributor

che-bot commented May 28, 2020

✅ E2E Happy path tests succeed 🎉

See Details

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

@che-bot
Copy link
Contributor

che-bot commented May 28, 2020

❌ E2E Happy path tests failed ❗

See Details

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

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Jun 30, 2020

❌ E2E Happy path tests failed ❗

See Details

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

ℹ️ Use comment "[crw-ci-test]" to rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Jul 7, 2020

❌ E2E Happy path tests failed ❗

See Details

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

ℹ️ Use comment "[crw-ci-test]" to rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Jul 7, 2020

✅ E2E Happy path tests succeed 🎉

See Details

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

@che-bot
Copy link
Contributor

che-bot commented Jul 7, 2020

✅ E2E Happy path tests succeed 🎉

See Details

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

@sparkoo
Copy link
Member

sparkoo commented Jul 15, 2020

Does it work only on OpenShift?

@vparfonov
Copy link
Contributor Author

Does it work only on OpenShift?

Yes, at the moment

@ibuziuk
Copy link
Member

ibuziuk commented Jul 15, 2020

@vparfonov could you please create an issue for the k8s support

@sparkoo
Copy link
Member

sparkoo commented Jul 15, 2020

Does it work only on OpenShift?

Yes, at the moment

Is there any hard technical reason? Like are you using some OpenShift only stuff? I would assume to go k8s first.

@che-bot
Copy link
Contributor

che-bot commented Jul 15, 2020

❌ E2E Happy path tests failed ❗

See Details

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

ℹ️ Use comment "[crw-ci-test]" to rerun happy path E2E test.

@vparfonov
Copy link
Contributor Author

Does it work only on OpenShift?

Yes, at the moment

Is there any hard technical reason? Like are you using some OpenShift only stuff? I would assume to go k8s first.

Any technical reason, we want to try it this on che.openshift.io firstly

@vparfonov
Copy link
Contributor Author

@vparfonov could you please create an issue for the k8s support

#17408

@vparfonov
Copy link
Contributor Author

[crw-ci-test]

@che-bot
Copy link
Contributor

che-bot commented Jul 15, 2020

✅ E2E Happy path tests succeed 🎉

See Details

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

@sparkoo
Copy link
Member

sparkoo commented Jul 15, 2020

Does it work only on OpenShift?

Yes, at the moment

Is there any hard technical reason? Like are you using some OpenShift only stuff? I would assume to go k8s first.

Any technical reason, we want to try it this on che.openshift.io firstly

yes, but usually, the base code implements k8s and only places where there are any OpenShift specifics we extend k8s class with OpenShift stuff. This looks like #17408 will be fixed by moving OpenShift classes into kubernetes module and bind them in KubernetesInfraModule. It's not a blocker, it just look like unnecessary complication and does not follow usual procedure.

@vparfonov
Copy link
Contributor Author

@metlos @skabashnyuk @sparkoo @mshaposhnik any other comments ?

Copy link
Member

@sparkoo sparkoo left a comment

Choose a reason for hiding this comment

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

I don't like that documentation is moved to another issue. It violates the "definition of done" what we're trying to define and honor. But let's move this forward.

Copy link
Contributor

@metlos metlos left a comment

Choose a reason for hiding this comment

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

Just a few nitpicks in the validator + guarding against NPEs in map lookups. Otherwise LGTM.

}

private void runtimesPerUserValidation() throws ValidationException {
if (runtimesPerUser > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be evaluated in the constructor just once.

}

private void pvcStrategyValidation() throws ValidationException {
if (!COMMON_STRATEGY.equals(pvcStrategy)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be evaluated in the constructor just once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vparfonov
Copy link
Contributor Author

Just a few nitpicks in the validator + guarding against NPEs in map lookups. Otherwise LGTM.

Create issue for these changes #17420

@vparfonov vparfonov merged commit 3dd86e8 into master Jul 15, 2020
@vparfonov vparfonov deleted the rsync_ssh branch July 15, 2020 15:50
@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 Jul 15, 2020
@l0rd l0rd added the new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes label Jul 19, 2020
vparfonov added a commit that referenced this pull request Jul 20, 2020
Signed-off-by: Vitalii Parfonov <[email protected]>
vparfonov added a commit that referenced this pull request Jul 21, 2020
* Various fixes after meging PR #16972
* Improving condition for che.limits.user.workspaces.run.count checking

Signed-off-by: Vitalii Parfonov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.