Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

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

Open
ibuziuk opened this issue Oct 3, 2018 · 7 comments

Comments

@ibuziuk
Copy link
Collaborator

ibuziuk commented Oct 3, 2018

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

@ibuziuk
Copy link
Collaborator Author

ibuziuk commented Oct 3, 2018

@davidfestal maybe you will be able to provide some guidance about local dev flow for che-tenant-maintainer ?

@davidfestal
Copy link
Collaborator

Sure.
Basically, you should:

If the Eclipse Auto-Build is enabled, you would have the various language services (completion, etc ...)

Additionally, the buildLocally.sh and buildAndPushToDocker.sh command will be the most useful for command line builds.

Anyway, I should have completed the Readme long ago. Sorry about that.

I'll also add a Che Json file, so that the project can be opened directly in Che with appropriate commands. This might also be an alternate solution to do light changes. Since the last releases, Che has basic Ceylon support with syntax coloring.

@ibuziuk
Copy link
Collaborator Author

ibuziuk commented Oct 3, 2018

@davidfestal I believe it is possible to run locally via startRestEndpointsLocally.sh but what about debugging ?

@davidfestal
Copy link
Collaborator

Local debugging might be hard in the given case, if we use the Che SA token. In this case I assume remote debugging (as in Java) should work.

However, in the overall design of the maintainer, there is the ability to pass a given namespace + token + OS token to the request or through environment variables. So in this case, you would be able to run the endpoint locally and point to a remote prod-preview Che / OS namespace. Of course this would require that you would still have edit rights on your Che namespace.

@ibuziuk
Copy link
Collaborator Author

ibuziuk commented Oct 4, 2018

@davidfestal could you please clarify how exactly the project should be imported ? after installing plugins I do not see dedicated wizard for importing ceylon projects

@davidfestal
Copy link
Collaborator

the maintainer is already an Eclipse project with the Ceylon nature, so just import it as Existing project

@amisevsk
Copy link
Collaborator

Partial PR here: #26

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants