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

Issue #42 Eclipse Che add-on #43

Merged
merged 1 commit into from Oct 18, 2017
Merged

Issue #42 Eclipse Che add-on #43

merged 1 commit into from Oct 18, 2017

Conversation

sunix
Copy link

@sunix sunix commented Oct 12, 2017

Fix #42

Early stage of a minishift addon, feedbacks are welcome.

@coolbrg
Copy link
Contributor

coolbrg commented Oct 12, 2017

@sunix , Thanks for the PR. Could you also add README of it?

# Required-Vars:

echo NOTE: To delete this addon, execute:
echo oc delete project/mini-che
Copy link
Contributor

Choose a reason for hiding this comment

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

lets not create or delete project, we just create tempaltes and leave


echo Creating mini-che project
oc new-project mini-che --description="Eclipse Che on minishift" --as=developer

Copy link
Contributor

Choose a reason for hiding this comment

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

lets not create or delete project, we just create templates and leave

echo minishift console
echo -
echo Then you should be able the open the Che dashboard here:
echo http://che-mini-che.#{ip}.nip.io
Copy link
Contributor

Choose a reason for hiding this comment

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

we can avoid line #11 to # 26 and just do
oc apply -f templates/che-single-user.json -n openshift

che.predefined.stacks.reload_on_start: 'false'
docker-connector: openshift
enable-workspaces-autostart: 'false'
hostname-http: 'che-mini-che.${DOMAIN}'
Copy link
Contributor

Choose a reason for hiding this comment

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

fixing domain ip will make che deployable only one project

enable-workspaces-autostart: 'false'
hostname-http: 'che-mini-che.${DOMAIN}'
keycloak-disabled: 'true'
keycloak-github-endpoint: 'https://sso.openshift.io/auth/realms/fabric8/broker/github/token'
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid it for minishift as its not applicable

hostname-http: 'che-mini-che.${DOMAIN}'
keycloak-disabled: 'true'
keycloak-github-endpoint: 'https://sso.openshift.io/auth/realms/fabric8/broker/github/token'
keycloak-oso-endpoint: 'https://sso.openshift.io/auth/realms/fabric8/broker/openshift-v3/token'
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid it for minishift as its not applicable

spec:
containers:
- env:
- name: CHE_DOCKER_IP_EXTERNAL
Copy link
Contributor

Choose a reason for hiding this comment

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

this we can do via Template parameters like

{
   "name": "CHE_DOCKER_IP_EXTERNAL",
   "value": "${CHE_OPENSHIFT_PROJECT}-${DOMAIN_NAME}"
}

configMapKeyRef:
key: che-workspace-auto-snapshot
name: che
image: 'docker.io/eclipse/che-server:nightly'
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be from Image streams rather than particular image to handle image and tags better

@kameshsampath
Copy link
Contributor

@sunix
awesome!! but got some comments and added review to the files as well.

  • I would love to have a ImageStream added with list of Che Server images and DeploymentConfig using it.

I have a similar version here https://github.com/kameshsampath/minishift-che-addon, wondering we could merge them together.

kameshsampath added a commit to kameshsampath/minishift-addons that referenced this pull request Oct 13, 2017
@kameshsampath kameshsampath mentioned this pull request Oct 13, 2017
@LalatenduMohanty
Copy link
Member

@sunix Closing this PR as #44 supersedes this PR in the of what you and Kamesh discussed in the #minishift channel.

@LalatenduMohanty
Copy link
Member

Re-opening the PR as per @sunix's request.

@kameshsampath
Copy link
Contributor

@sunix - do you see any comments on this ticket, right now am working on a small pod that can be deployed along with Che- which sanitises the stack (like what replace_stacks.sh) does .

Copy link
Contributor

@coolbrg coolbrg left a comment

Choose a reason for hiding this comment

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

@sunix , Could you add README ?

@sunix
Copy link
Author

sunix commented Oct 17, 2017

@budhrg Yes, currently merging #44 with this one, testing and will provide readme once everything works fine

echo [CHE] Switching to mini-che...
oc project mini-che

echo [CHE] Deploying Che on minishift (image docker.io/eclipse/che-server:nightly)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a reminder to remove nightly tag. Probably use exact version.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sunix - i have one query around project creation here. say if the user deletes the project then he might not have this instance so he has to create via Add To Project or reapply the addon( am not sure this is possible). WDYT?

echo -
echo You can watch in the OpenShift console via:
echo minishift console
echo -
Copy link
Contributor

Choose a reason for hiding this comment

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

This is coming as it is . You don't need - here.


This addon provides an easy way to install Eclipse Che on MiniShift.

Eclipse Che provides a complete Cloud IDE.
Copy link
Member

Choose a reason for hiding this comment

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

"cloud IDE"

# Eclipse Che Addon

This addon create Eclipse Che templates, image streams and a project running Che in Minishift. In short this helps in setting up Eclipse Che
on minishift inline with https://www.eclipse.org/che/docs/setup/openshift/index.html#deploy-che-on-minishift[Deploy Che on Minishift]
Copy link
Member

Choose a reason for hiding this comment

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

[Deploy Che on Minishift](https://www.eclipse.org/che/docs/setup/openshift/index.html#deploy-che-on-minishift)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes :) this syntax is of Ascii doc :)

@gbraad gbraad changed the title Eclipse Che addon Issue #42 Eclipse Che addon Oct 17, 2017
@sunix sunix force-pushed the che-addon branch 2 times, most recently from f2f8213 to 4571b7e Compare October 17, 2017 16:08
@l0rd
Copy link
Contributor

l0rd commented Oct 17, 2017

@sunix it looks like you are using the default Che stacks. If that's the case it will always take a couple of minutes to start a workspace on minishift (the time for the ssh agent to timeout). That would be a poor UX and something that should be addressed. If there is no time to do it in this PR I would recommend to mention the problem in the README.md and open an issue to track that.

@kameshsampath
Copy link
Contributor

@l0rd - am right now working on a small utility that can be deployed as side car(pod) or can be used as cli for Che which can do the refresh stack + some more things I have planned. will share the same with you and @sunix once i have basic version working.

@gbraad
Copy link
Member

gbraad commented Oct 18, 2017

@l0rd we can actually use anyuid, so what else would prevent us from SSH to properly start?

$ minishift addons enable anyuid
$ minishift addons enable che

This results in the terminal of the Blank workspace showing:

user@che-ws-trncd29y1gxh90pi-3982296087-s77rd:/projects$ ps ax
...
   10 ?        S      0:00 sudo /usr/sbin/sshd -D
   12 ?        S      0:00 /usr/sbin/sshd -D
...

and for the CentOS-based workspace:

user@che-ws-trncd29y1gxh90pi-3982296087-s77rd:/projects$ ps ax
...
  421 ?        S      0:00 sudo -E /usr/sbin/sshd -D
  422 ?        S      0:00 /usr/sbin/sshd -D
...

# Eclipse Che Addon

This addon create Eclipse Che templates, image streams and a project running Che in Minishift. In short this helps in setting up Eclipse Che
on minishift inline with [Deploy Che on Minishift](https://www.eclipse.org/che/docs/setup/openshift/index.html#deploy-che-on-minishift)
Copy link
Contributor

Choose a reason for hiding this comment

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

on Minishift inline with.

Minishift as brand name and minishift for CLI purpose.

@coolbrg
Copy link
Contributor

coolbrg commented Oct 18, 2017

Got this error while starting with Java + Mysql stack. Yesterday too, got similar error. After restarting the workspace, it is not starting properly.

screenshot from 2017-10-18 11-16-49

@gbraad
Copy link
Member

gbraad commented Oct 18, 2017

@budhrg I do not get the same error... for me it is a simple:

Could not start workspace wksp-pdlq. Reason: Start of environment 'default' failed. Error: null

Happens for the Java and the .NET Core images,

@kameshsampath
Copy link
Contributor

@budhrg and @gbraad - since che is a upstream project the default docker images can't be used directly in OpenShift as they all run as root. to mitigate that as part of the installation we have a step to replace the stacks --> https://www.eclipse.org/che/docs/setup/openshift/index.html#deploy-che-on-minishift, the addon currently does not do that step. For now the workaround is to run the replace_stacks step, having said that am working on to get a sidecar deployed along with che which will take care of this ( still testing it)

@l0rd - please add/correct if I have missed anything.

@gbraad
Copy link
Member

gbraad commented Oct 18, 2017

@kameshsampath I am running with anyuid and therefore I can use root inside the containers. For example, the CentOS container allows me to use sudo yum install golang glide and I can use it to compile Minishift.

@gbraad
Copy link
Member

gbraad commented Oct 18, 2017

image

@hferentschik hferentschik changed the title Issue #42 Eclipse Che addon Issue #42 Eclipse Che add-on Oct 18, 2017
@hferentschik
Copy link
Member

I have a feeling this add-on is at the wrong place. Given that the Che add-on is essential to us, I'd argue that it should be added in the main Minishift repo as a default add-on. This will also allow us to add integration test and it will make things easier for productization.

ATM, there is nothing in place to productize this community driven add-on repository.

@hferentschik
Copy link
Member

hferentschik commented Oct 18, 2017

I take my comment #43 (comment) back. It does not make sense. ;-) Given the current state of things this is probably the best space.

It would be nice if the README would add some information on what works and what not. For example workspace persistence is an issue with Minishift, right?


Clone this repository onto your local machine and then install the add-on via:

$ minishift addons install <path_to_directory_containing_this_readme>
$ minishift addons enable che


`enable` will setup eclipse che at next minishift start
`enable` will setup eclipse che at next Minishift start
Copy link
Member

@gbraad gbraad Oct 18, 2017

Choose a reason for hiding this comment

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

I think this should be:

enable will setup Eclipse Che at next minishift start

or:

enable will setup Eclipse Che when you start Minishift the next time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, for all CLI operation, it should minishift.

Copy link
Author

Choose a reason for hiding this comment

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

ok i make that fix

@@ -25,33 +26,49 @@ The best way of using this add-on is via the [`minishift add-ons apply`](https:/

<a name="install-add-on"></a>
### Install add-on
Che default stacks require root privilege to run sshd. Without root privilege, workspaces will take more time to timeout and start.
One workaround would be to enable the `anyuid` addon. Another way would be to [replace the existing stacks](#replace-stacks) with the ones without the `sshd` agent.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does anyuid work? Someone has tested if sshd get started? Because we explicitely start the container as unprivileged in the OpenShiftConnector.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sunix - we also can add one more template parameter called MAVEN_MIRROR_URL , we have just added made the che stack images to use MAVEN_MIRRORS like how other openshift images does

Copy link
Author

Choose a reason for hiding this comment

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

@l0rd I've tested with ayuid and startup is faster for sure

Copy link
Author

Choose a reason for hiding this comment

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

@kameshsampath not sure to get this, but maybe this should be part of another PR ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@l0rd , is this related to it #43 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

ok thanks @budhrg and @sunix

Signed-off-by: Sun Seng David TAN <sutan@redhat.com>
@coolbrg coolbrg merged commit 0984944 into minishift:master Oct 18, 2017
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.

None yet

7 participants