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

Update deploy_che script #9513

Merged
17 commits merged into from
May 4, 2018
Merged

Update deploy_che script #9513

17 commits merged into from
May 4, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 22, 2018

What does this PR do?

After #9190 has been merged, existing deploy_che.sh and everything not in deploy/openshift/templates directory should go away (helper scripts and yamls) and start using new templates (deploy_che.sh).

This PR:

  1. Removes all old yamls and scripts. Only ocp.sh and deploy_che.sh are left. Both have help menus and are quite clear to follow the deployment logic
  2. Makes deploy_che.sh templates friendly, i.e. deployment happens by applying templates.
  3. Introduces args to deploy_che.sh so that once can override most commonly used ENVS and params like update strategy, pull policy, deployment image, https support, multi user flavor, etc.
  4. Makes it possible for deploy_che.sh to grab all local env variables beginning with CHE_ and pass them to Che deployment. Envs and params are printed before templates are applied.
  5. NEW! Auto-computes routing suffix by creating and exposing (and of course deleting afterwards) a test service. If ROUTING_SUFFIX is exported (for example, ocp.sh does that), it is used as is.
  6. Removes the concept of flavor in deploy_che.sh. The script deploys Che with a set of envs and params to any OpenShift cluster be it MiniShift, a local Origin, OSD, OCP or OSO. There's just one pre-req: one needs to be logged in oc, i.e. have an active session (oc whoami is the test command in the script). So, when deploying, say, to OSO or OCP/OSD, all one needs to do is to login to cluster using oc and run ./deploy_che.sh with a set of commands. It is possible that the desired namespace name already exists (in someone else's account) - it is possible to provide own with -p | --project parameter.

Tested with Origin (oc cluster up locally) and OSO Pro.

@ghost ghost requested a review from sleshchenko April 22, 2018 18:53
@benoitf benoitf added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Apr 22, 2018
@ghost ghost removed request for ashumilova and sleshchenko April 23, 2018 12:20
@ghost ghost requested a review from sleshchenko as a code owner April 24, 2018 06:20
ENV vars: this script automatically detect envs vars beginning with "CHE_" and passes them to Che deployments:
CHE_IMAGE_REPO - Che server Docker image, defaults to "eclipse-che-server"
CHE_IMAGE_TAG - Set che-server image tag, defaults to "nightly"
CHE_INFRA_KUBERNETES_PROJECT - namespace for workspace objects (defaults to eclipse-che). A separate ws namespace can be used only if username/password or token is provided
Copy link
Member

Choose a reason for hiding this comment

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

CHE_INFRA_KUBERNETES_NAMESPACE is used for Kubernetes Infra.
CHE_INFRA_OPENSHIFT_PROJECT is used for OpenShift Infra.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

${ENV}

if [ ${UPDATE_STRATEGY} == "Recreate" ]; then
${OC_BINARY} apply -f ${BASE_DIR}/templates/pvc/che-server-pvc.yaml
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the formatting is broken here. Please check

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

--rolling - rolling update strategy (Recreate is the default one)
--wait-che - track Che deployment progress until pod is healthy
--debug - deploy Che in a debug mode, create and expose debug route
--image-che= - override default Che image. Example --image-che=org/repo:tag. Tag is mandatory!
Copy link
Member

Choose a reason for hiding this comment

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

looks like = symbol is redundant

Copy link
Author

Choose a reason for hiding this comment

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

Yes, makes sense - the format is in the example anyway

Eugene Ivantsov added 2 commits April 25, 2018 10:18
@ghost ghost changed the title WIP: Update deploy_che script Update deploy_che script Apr 26, 2018
@benoitf benoitf added the kind/enhancement A feature request - must adhere to the feature request template. label Apr 30, 2018
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.

LGTM 👍

Please take a look my minor comments

ENV vars: this script automatically detect envs vars beginning with "CHE_" and passes them to Che deployments:
CHE_IMAGE_REPO - Che server Docker image, defaults to "eclipse-che-server"
CHE_IMAGE_TAG - Set che-server image tag, defaults to "nightly"
CHE_INFRA_OPENSHIFT_PROJECT - namespace for workspace objects (defaults to eclipse-che). A separate ws namespace can be used only if username/password or token is provided
Copy link
Member

Choose a reason for hiding this comment

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

I'd say that default value is not eclipse-che but the same as CHE_OPENSHIFT_PROJECT or specified with --p parameter

printInfo "Che successfully deployed and will be soon available at ${HTTP_PROTOCOL}://${CHE_ROUTE}"
exposeDebugService
if [ "${WAIT_FOR_CHE}" == "true" ]; then
wait_for_che
Copy link
Member

Choose a reason for hiding this comment

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

please add two spaces here

--rolling - rolling update strategy (Recreate is the default one)
--wait-che - track Che deployment progress until pod is healthy
--debug - deploy Che in a debug mode, create and expose debug route
--image-che - override default Che image. Example --image-che=org/repo:tag. Tag is mandatory!
Copy link
Member

Choose a reason for hiding this comment

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

looks like information about -p, --project parameter is missing.

# --------------------------------------------------------
HELP="
--help - script help menu
--project | -p - OpenShift namespace to deploy Che (defaults to eclipse-che)
Copy link
Member

Choose a reason for hiding this comment

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

Please add example the same as for --image-che, because it is not clear that value should be separated with =

@ghost ghost merged commit a22a2b3 into master May 4, 2018
@ghost ghost deleted the update_deploy_che_script branch May 4, 2018 09:36
@benoitf benoitf 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 4, 2018
@benoitf benoitf added this to the 6.5.0 milestone May 4, 2018
hbhargav pushed a commit to hbhargav/che that referenced this pull request Dec 5, 2018
* Update OpenShift Origin version to 3.9

* Deploy script uses templates

* Pass args to deploy script

* Remove old scripts and yamls

* Add missing args to ocp.sh help and and help to deploy_che.sh

* Small fixes

* Remove mistakenly added file

* Remove mistakenly added file

* Remove -a in docker ps to get registry container

* Do not pass args but export envs in ocp.sh

* Messed envs a bit

* Delete test service that is used to compute routing suffix

* Remove unnecessary port from Keycloak route

* Fixes

* Fixes

* Typo

* Minor fixes
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants