GithubHelp home page GithubHelp logo

fabric8-services / che-tenant-maintainer Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 5.0 211 KB

Tool and associated rest endpoint to migrate Che workspace metadata from single-tenant to multi-tenant server

License: Apache License 2.0

Shell 8.13% Batchfile 3.03% Ceylon 87.56% Java 0.57% Dockerfile 0.71%

che-tenant-maintainer's People

Contributors

amisevsk avatar davidfestal avatar ibuziuk avatar jmelis avatar

Watchers

 avatar  avatar  avatar

che-tenant-maintainer's Issues

Need to add endpoint for cleanup workspaces that have been running for more than fixed period of time

Need to add endpoint for cleanup workspaces that have been running for more than fixed period of time. Basically, endpoint should be able to get all the running workspace pods in the user namespace and delete all openshift resources related to the workspace (oc delete all -l che.workspace_id) if workspace pod is running for more than fixed period of time (by default 1 day, but it would be great to make it configurable via parameter). The only obligatory parameter would be identity_id passed via X-Identity-Id header. oso-proxy is going to be used as masterUrl and with Che SA Token [1] for all openshift related operations.

[1] https://github.com/fabric8-services/che-tenant-maintainer/blob/master/source/io/fabric8/tenant/che/migration/namespace/cheServiceAccountToggle.ceylon#L73

Issue with PV not correctly deleted when trying to delete workspace

1 - Create a new space in OSIO prod-preview
1a - choose create new codebase,
1b - select sprint boot, REST API, select build pipeline
1c- once create go to open workspace to make sure the workspace is correctly initialized.

2 - Following instructions given by David @davidfestal in as per HK issue to clean workspace, the steps as followed:
2a - login to prod-preview with:

oc login https://api.dsaas-stg.openshift.com —token=XXX

2b - Get pod name for che-tenant-maintainer from dssas preview and port forward:

oc port-forward  che-tenant-maintainer-3-ldkgn 8080

2c - Call the API with OSIO prod-preview token of the user to delete + username in headers:

curl -X POST -d "@curl_clean_workspaces.txt" http://localhost:8080/cleanWorkspaces -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -H "X-User-Namespace: ckrych-preview-che" -verbose
{"code":0,"message":"","details":"should remove workspace7bx5hsjf2wybyr9k\nshould remove workspacels2b15013jxefd2b\n”}

with curl_clean_workspaces.txt:

{
  "delete-all-workspaces": "true",
  "debug-logs": "true"
}

got a 200 with this error:

{"code":1,"message":"Failure during cleaning of workspace files: Command failed with the following code: 1 and termination message: rm: cannot remove '/pvroot/workspacemynwdmj476xfysuh/projects': Permission denied\nrm: cannot remove '/pvroot/workspacemynwdmj476xfysuh/che-logs/dev-machine': Permission denied\n","details":"removing workspacemynwdmj476xfysuh\n"}
when looking at https://che.prod-preview.openshift.io/dashboard/#/workspaces no workspace is displayed (it looks like it was deleted).

Expected: No error displayed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.