Skip to content

Commit

Permalink
[WINDUP-3407]-WINDUP Themed Release (#50)
Browse files Browse the repository at this point in the history
* Allow multiple themes

* No need to use mvn property in CLI

* Use correct cli artifact

* Set Windup default theme

* Update versions

* Enhance template

* Upgrade versions
  • Loading branch information
carlosthe19916 committed Jul 26, 2022
1 parent 014a377 commit 3ccc923
Show file tree
Hide file tree
Showing 19 changed files with 170 additions and 160 deletions.
22 changes: 11 additions & 11 deletions README.md
@@ -1,7 +1,7 @@
# windup-openshift: Migration Toolkit for Applications on OpenShift
This project is useful if you want to try MTA on an OpenShift instance.
If you just want to test MTA using the [images](https://quay.io/organization/windupeng) we have made available in the quay.io repository, go straight to the [OpenShift template deployment](#openshift-template-deployment) section.
If you have made some changes to MTA 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.
This project is useful if you want to try WINDUP on an OpenShift instance.
If you just want to test WINDUP using the [images](https://quay.io/organization/windupeng) we have made available in the quay.io repository, go straight to the [OpenShift template deployment](#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.
There's also the case that you don't have an OpenShift instance available and, in this scenario, Red Hat Container Development Kit can help you working locally on your machine with any need for an OpenShift instance to test your changes to the code. In this case please follow the instructions in the [Working with Red Hat Container Development Kit](#working-with-red-hat-container-development-kit) section.

## OpenShift image construction
Expand Down Expand Up @@ -42,21 +42,21 @@ So sign up yourself to Quay.io at https://quay.io/signin/ taking care that the Q
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`)

### Point to your images
Now that your images are available on Quay.io repository, you have to reference them in MTA template in order to use these images in the deployments.
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.
1. open [`./templates/src/main/resources/web-template-empty-dir-executor.json`](templates/src/main/resources/web-template-empty-dir-executor.json) in an IDE or text editor
1. change all the `"image"` values to point to `quay.io/<your_quay_id>/` instead of `quay.io/windupeng/`

## OpenShift template deployment
There are two different ways for deploying MTA on OpenShift based upon if you have [`cluster-admin privileges`](https://docs.openshift.org/latest/architecture/additional_concepts/authorization.html#roles): if you have those privileges you can decide to follow [Template deployment in OpenShift catalog](#template-deployment-in-openshift-catalog) (because you can operate on the default `openshift` project) or [Import template in Openshift Web Console](#import-template-in-openshift-web-console) otherwise you can just go with the latter approach ([Import template in Openshift Web Console](#import-template-in-openshift-web-console))
There are two different ways for deploying WINDUP on OpenShift based upon if you have [`cluster-admin privileges`](https://docs.openshift.org/latest/architecture/additional_concepts/authorization.html#roles): if you have those privileges you can decide to follow [Template deployment in OpenShift catalog](#template-deployment-in-openshift-catalog) (because you can operate on the default `openshift` project) or [Import template in Openshift Web Console](#import-template-in-openshift-web-console) otherwise you can just go with the latter approach ([Import template in Openshift Web Console](#import-template-in-openshift-web-console))

### Choose the template
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`](templates/src/main/resources/web-template-empty-dir-executor.json) | OpenShift | The recommended template to deploy MTA on OCP<br>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`](templates/src/main/resources/web-template-empty-dir-executor-shared-storage.json) | OpenShift with `ReadWriteMany (RWX)` storage| This template deploys MTA on OCP using a shared storage between the `executor` pod and the `web console` one to share the analysis data |
| Template | Requirements | Description |
| --- | --- |-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`web-template-empty-dir-executor.json`](templates/src/main/resources/web-template-empty-dir-executor.json) | OpenShift | The recommended template to deploy WINDUP on OCP<br>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`](templates/src/main/resources/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 |

### Template deployment in OpenShift catalog
1. login to Openshift: `$ oc login`
Expand Down Expand Up @@ -91,13 +91,13 @@ Once you have a fully working CDK instance, you can follow the next steps:
1. now, before proceeding, you have to follow the above instructions about [OpenShift template deployment](#openshift-template-deployment)
1. once you have successufully deployed, you can change the deployments to point to your local images.
Go to `Deployments` web page and:
1. choose `mta-web-console` deployment page
1. choose `windup-web-console` deployment page
1. select `Actions` => `Edit` from the top right button (ref.)
![screenshot_action_edit](https://user-images.githubusercontent.com/7288588/39518963-2cfb1030-4e05-11e8-9c6b-a8d071d4fc3b.png)
1. check the `Deploy images from an image stream tag` box and select the values for the `Image Stream Tag` comboboxes selecting your project's name as `Namespace`, `windup-web-openshift` for `Image Stream` and `latest` for `Tag`
![screenshot_imagestream](https://user-images.githubusercontent.com/7288588/39518990-49f385fa-4e05-11e8-9a80-d04992f90f0c.png)
1. push the `Save` button at the bottom of the page
1. repeat these steps for `mta-web-console-executor` deployment using `windup-web-openshift-messaging-executor` as `Image Stream` combox value
1. repeat these steps for `windup-web-console-executor` deployment using `windup-web-openshift-messaging-executor` as `Image Stream` combox value

Now your deployments are using the Docker images you have built locally on your machine and, whenever you update these images, new deployments will be triggered automatically when `docker push` command executes.

Expand Down
4 changes: 2 additions & 2 deletions cli/pom.xml
Expand Up @@ -39,7 +39,7 @@
<name>${docker.name.windup.cli}</name>
<build>
<from>registry.access.redhat.com/ubi8/openjdk-11:latest</from>
<cmd>/opt/migrationtoolkit/bin/mta-cli</cmd>
<cmd>/opt/migrationtoolkit/bin/windup-cli</cmd>
<assembly>
<targetDir>/</targetDir>
<descriptor>assembly/assembly.xml</descriptor>
Expand All @@ -66,7 +66,7 @@
<classifier>offline</classifier>
<type>zip</type>
<version>${version.windup.cli}</version>
<outputDirectory>${project.build.directory}/mta-cli</outputDirectory>
<outputDirectory>${project.build.directory}/windup-cli</outputDirectory>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/docker/assembly/assembly.xml
Expand Up @@ -6,7 +6,7 @@
<!-- Add distribution files -->
<fileSets>
<fileSet>
<directory>${project.build.directory}/mta-cli/${product-name}-cli-${version.windup.cli}/</directory>
<directory>${project.build.directory}/windup-cli/${product-name}-cli-${version.windup.cli}/</directory>
<outputDirectory>opt/migrationtoolkit/</outputDirectory>
</fileSet>
</fileSets>
Expand Down
6 changes: 3 additions & 3 deletions messaging-executor/pom.xml
Expand Up @@ -38,7 +38,7 @@
<name>${docker.name.windup.web.executor}</name>
<build>
<from>registry.access.redhat.com/ubi8/openjdk-11:latest</from>
<cmd>/opt/mta-cli/bin/openshift-launch.sh</cmd>
<cmd>/opt/windup-cli/bin/openshift-launch.sh</cmd>
<assembly>
<targetDir>/</targetDir>
<descriptor>assembly/assembly.xml</descriptor>
Expand All @@ -63,11 +63,11 @@
<groupId>org.jboss.windup.web</groupId>
<artifactId>windup-web-executor</artifactId>
<version>${project.version}</version>
<outputDirectory>${project.build.directory}/mta-cli</outputDirectory>
<outputDirectory>${project.build.directory}/windup-cli</outputDirectory>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
<excludes>**/logging.properties,**/mta-cli</excludes>
<excludes>**/logging.properties,**/windup-cli</excludes>
</configuration>
</execution>
</executions>
Expand Down
8 changes: 4 additions & 4 deletions messaging-executor/src/main/docker/assembly/assembly.xml
Expand Up @@ -6,16 +6,16 @@
<!-- Add distribution files -->
<fileSets>
<fileSet>
<directory>${project.build.directory}/mta-cli/</directory>
<outputDirectory>opt/mta-cli</outputDirectory>
<directory>${project.build.directory}/windup-cli/</directory>
<outputDirectory>opt/windup-cli</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/classes/root/</directory>
<outputDirectory>opt/mta-cli/</outputDirectory>
<outputDirectory>opt/windup-cli/</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/classes/bin/</directory>
<outputDirectory>opt/mta-cli/bin</outputDirectory>
<outputDirectory>opt/windup-cli/bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
Expand Down
2 changes: 1 addition & 1 deletion messaging-executor/src/main/resources/bin/livenessProbe.sh
@@ -1,6 +1,6 @@
#!/bin/bash

PING_DIR=/opt/mta-cli/ping
PING_DIR=/opt/windup-cli/ping
SUFFIX=`date +%s%N`
PING_FILE=$PING_DIR/ping.$SUFFIX
PONG_FILE=$PING_DIR/pong.$SUFFIX
Expand Down
14 changes: 7 additions & 7 deletions messaging-executor/src/main/resources/bin/openshift-launch.sh
Expand Up @@ -10,16 +10,16 @@ JMS_HOST=${!JMS_HOST}

SERIALIZER=${MESSAGING_SERIALIZER}
DATA_DIR=/opt/eap/standalone/data
PING_DIR=/opt/mta-cli/ping
PING_DIR=/opt/windup-cli/ping

echo "Starting executor with messaging server $JMS_HOST as user $JMS_USER"

MTA_OPTS=`/opt/run-java/java-default-options`
export MTA_OPTS="${MTA_OPTS/-XX:MaxMetaspaceSize=100m/-XX:MaxMetaspaceSize=256m}"
WINDUP_OPTS=`/opt/run-java/java-default-options`
export WINDUP_OPTS="${WINDUP_OPTS/-XX:MaxMetaspaceSize=100m/-XX:MaxMetaspaceSize=256m}"

echo "MTA_OPTS: $MTA_OPTS"
echo "WINDUP_OPTS: $WINDUP_OPTS"

/opt/mta-cli/bin/mta-cli -Dmessaging.serializer=${MESSAGING_SERIALIZER} \
/opt/windup-cli/bin/windup-cli -Dmessaging.serializer=${MESSAGING_SERIALIZER} \
-Dwindup.data.dir=${DATA_DIR} \
--messagingExecutor \
--user ${JMS_USER} --password ${JMS_PASSWORD} --host ${JMS_HOST} \
Expand All @@ -28,5 +28,5 @@ echo "MTA_OPTS: $MTA_OPTS"
--statusUpdateQueue jms/queues/statusUpdateQueue \
--cancellationTopic jms/topics/executorCancellation \
--pingDir ${PING_DIR} \
-Dwindup.result.get.url=http://${JMS_HOST}:8080/mta-ui/api/windup/executions/get-execution-request-tar \
-Dwindup.result.post.url=http://${JMS_HOST}:8080/mta-ui/api/windup/executions/post-results
-Dwindup.result.get.url=http://${JMS_HOST}:8080/windup-ui/api/windup/executions/get-execution-request-tar \
-Dwindup.result.post.url=http://${JMS_HOST}:8080/windup-ui/api/windup/executions/post-results
2 changes: 1 addition & 1 deletion messaging-executor/src/main/resources/bin/stop.sh
@@ -1,4 +1,4 @@
#!/bin/bash

PING_DIR=/opt/mta-cli/ping
PING_DIR=/opt/windup-cli/ping
touch $PING_DIR/shutdown.marker

0 comments on commit 3ccc923

Please sign in to comment.