This project is useful if you want to try WINDUP on an OpenShift instance.
If you just want to test WINDUP using the images we have made available in the quay.io repository, go straight to the OpenShift template deployment section.
If you have made some changes to WINDUP and you want to test them on an OpenShift instance, in the next paragraph you'll find all the information for building your own container images so that you're free to test your code.
For building this project and creating Docker images you have to have a Docker instance running locally on your machine so that you can pull the built images.
Next you'll find some basic instructions to install Docker based on your local OS.
- Install Docker:
$ sudo dnf install docker
- Configure
docker
group (ref. Manage Docker as a non-root user):$ sudo groupadd docker
$ sudo usermod -aG docker $USER
- Log out and log back in so that your group membership is re-evaluated
- Test Docker is working:
$ docker run hello-world
For any issue related to installation, you can refer to Docker documentation.
For any other platform you can follow the detailed instructions provided in the Install Docker guide from Docker.
You need an account on https://quay.io/ in order to push your images and have them available for deployment from the OCP templates.
So sign up yourself to Quay.io at https://quay.io/signin/ taking care that the Quay username you choose will be the <your_quay_id>
value in the next steps.
- Login on https://access.redhat.com/login
- Go to Registry Service accounts
- Create a New Service Account if you don't have one
- Click on the service account and go to "Docker Login" tab.
- Copy the bash command
- Paste that command in a shell window on your local machine and execute it
- Now your local Docker installation will have the credentials in ~/.docker/config.json
- Build this project:
$ mvn clean install -Ddocker.name.windup.web=<your_quay_id>/windup-web-openshift -Ddocker.name.windup.web.executor=<your_quay_id>/windup-web-openshift-messaging-executor
- Push images to docker hub:
$ docker login
$ docker push <your_quay_id>/windup-web-openshift
$ docker push <your_quay_id>/windup-web-openshift-messaging-executor
If you want you can also set the tag for the built images (e.g. if you are working on a specific branch and you want to create images tagged with the branch name), you just have to add the tag name to the docker.name.windup.web
and docker.name.windup.web.executor
system properties' values (i.e. from the above example -Ddocker.name.windup.web=<your_quay_id>/windup-web-openshift:tag_value -Ddocker.name.windup.web.executor=<your_quay_id>/windup-web-openshift-messaging-executor:tag_value
)
- Login to Quay.io container repository executing
$ docker login quay.io
- Build the CLI multi-arch container and push it to Quay repository
$ mvn clean install -DskipTests -f cli/ -Dmulti-arch -Ddocker.name.windup.cli=quay.io/<your_quay_id>/windup-cli-openshift
Now that your images are available on Quay.io repository, you have to reference them in WINDUP template in order to use these images in the deployments.
- open
./templates/src/main/resources/web-template-empty-dir-executor.json
in an IDE or text editor - change all the
"image"
values to point toquay.io/<your_quay_id>/
instead ofquay.io/windupeng/
There are two different ways for deploying WINDUP on OpenShift based upon if you have cluster-admin privileges
: if you have those privileges you can decide to follow Template deployment in OpenShift catalog (because you can operate on the default openshift
project) or Import template in Openshift Web Console otherwise you can just go with the latter approach (Import template in Openshift Web Console)
There are different templates available to be imported in your OpenShift instance. The table below summarizes the different use cases for each template
Template | Requirements | Description |
---|---|---|
web-template-empty-dir-executor.json |
OpenShift | The recommended template to deploy WINDUP on OCP The analysis data between the executor pod and the web console one are sent using REST web services |
web-template-empty-dir-executor-shared-storage.json |
OpenShift with ReadWriteMany (RWX) storage |
This template deploys WINDUP on OCP using a shared storage between the executor pod and the web console one to share the analysis data |
- login to Openshift:
$ oc login
- create the template:
$ oc create -f ./templates/src/main/resources/web-template-empty-dir-executor.json -n openshift
Now, if you go to OpenShift Web Console home page, you'll see Windup (ref. screenshot-0) in the list of the available templates and so you can deploy it to a project just like any other template.
screenshot-0: in OpenShift Web Console (v4.10) Browse Catalog
page you can see the Windup
icon
- copy the raw content of file web-template-empty-dir-executor.json
- paste it in the "Import YAML / JSON" wizard in Openshift Web Console (ref. screenshot-1)
- save and wait for the deployment to end
screenshot-1: in OpenShift Web Console (v4.10) Import YAML / JSON
wizard you can paste template raw content