/MicroProfileOnAzure

Instructions to set up and run MicroProfile (Thorntail) on OpenShift on Azure

Primary LanguageShell

Eclipse MicroProfile (WildFly Swarm) on Azure

NOTE: Use Chrome or Firefox for the instructions below. They will not work with Safari

Congratulations! You have just received your free Azure trial pass to try Eclipse MicroProfile on Azure.

These instructions are grouped in four sections:

A. Redeeming your Azure Pass

B. Instantiating an all-in-one OpenShift Origin cluster on Azure

C. Using the Red Hat OpenShift Application Runtimes Launcher to generate the WildFly Swarm sample project

D. Deploying sample project to all-in-one OpenShift Origin cluster on Azure

A. Redeeming your Azure Pass

  1. Open a browser and navigate to: www.microsoftazurepass.com and click on the "Start" button

  1. On the following screen, enter your Microsoft account credential, e.g. hotmail email or Skype email or LinkedIn email:

  1. Then enter your corresponding password. If this is your personal computer, I strongly recommend you click on "Keep me signed in":

  1. If the next "Updating Terms" screen is displayed, just click on the "Next" button:

  1. Then click on the "Yes" button in the "Stay signed in?" dialog:

  1. On this screen, click on the "Confirm Microsoft account" button

  1. Enter your Promo Code from your Azure trial pass and click on "Claim your Promo Code" button:

  1. Once your Azure trial pass Promo Code is accepted, click on the "Activate" button:

  1. The activation process will display the following screen:

  1. When the activation process completes, you will see the Azure Pass Agreement screen. Check the "I Agree" checkbox and click on "Sign Up" button

  1. Once your sign-up is processed, you will be re-directed to your Azure Portal:

B. Instantiating an all-in-one OpenShift Origin cluster on Azure

  1. Create a Single VM OpenShift Origin deployment using the Azure Portal

This template deploys OpenShift Origin on Azure.

Console

Subscription

Accept the default subscription ID value. Note: this field is not shown in the picture above.

Resource Group

Select "Create new" resource group if one does not currently exist. Enter "origin" or a name of your choosing in the input field.

Location

The geographic location in which to deploy OpenShift Origin.

Admin User

Supply a username which will be used for both SSH access and for the OpenShift Origin web console.

Admin Password

Supply a password which will be used for the Origin web console.

Ssh Key Data

You will need a SSH RSA public key for access if one currently does not exist on your system. Please supply your Public SSH key only. For example, in Linux the key can be located at ~/.ssh/id_rsa.pub. Make sure to copy and paste the ENTIRE contents of the file ~/.ssh/id_rsa.pub into this input field.

SSH Key Generation (Optional)
  1. Windows
  2. Linux
  3. Mac

Vm Size

Specify a VM size. A default value is provided. If another size or type of vm is required ensure that the Location contains that instance type.

Once all of these values are set, then check the box to "Agree to the terms and conditions" and then click the Purchase button.

Acknowledgements: Thanks to the following individuals for the base template: Daniel Falkner, Glenn West, Harold Wong, and Ivan McKinley

  1. Deploy OpenShift Origin template to Azure A notification will pop up in the top right notifying you of the deployment:

The deployment will take 15-20 minutes. Once completed, the notification will display:

Click on "Go to resource group" button in the notification above to open up the window for the origin resource group (or you can also click on the "Resource groups" under "Favorites" on the leftmost vertical Azure portal menu, and then click on "origin" to open the origin resource group). You will see the following:

On the top right of the origin resource group window, you will see a heading "Deployments". Click on "1 Succeeded" under this heading to see the deployments:

Now, click on the "Microsoft.Template" link to display the contents of the template. Then click on the "Outputs" to see the URL of the OpenShift Origin console:

At this point, copy the string from the "ORIGINCONSOLE" field, open a browser window and paste the string in the Address field. If your browser warns you about the site being insecure, go ahead and continue to the insecure site. At this point, you should see the login prompt to log in to the all-in-one OpenShift Origin cluster:

For Username and Password, the "Admin User" and "Admin Password" you supplied in the template above. Click on "Log In" and you should see:

C. Using the Red Hat OpenShift Application Runtimes Launcher to generate the WildFly Swarm sample project

  1. Go to https://developers.redhat.com/launch

  1. Click on "LAUNCH YOUR PROJECT" button to launch a mission

  1. At this point, if not already logged in, you need to click on the "Log In or Register" button. Enter your valid credentials as indicated on window and click on "LOG IN" button (if you don't have an account, click on "Create one now". Once you create your account, return to this window and log in with your newly created credentials)

  1. On this next screen, click on "I will build and run locally"

  1. In the missions screen, scroll down until you see the mission "REST API Level 0". Check on the "REST API Level 0" mission and click on the "Next" button

  1. Select the "WildFly Swarm" runtime tile and then click the "Next" button

  1. In the "Project Info" window, accept all the defaults and click on the "Next" button

8. In the Review window, click on the "Download as ZIP File" button. This will download a ZIP file named "booster-rest-http-wildfly-swarm.zip" to your Downloads directory on your laptop/desktop

  1. As the final step in this section, you will see the "Next Steps" screen

You have completed your first "REST API Level 0" mission and created and downloaded its associated Wildfly Swarm project to your laptop/desktop.

D. Deploying sample project to all-in-one OpenShift Origin cluster on Azure

Pre-requisite 1: You need to have "oc" installed on your laptop/desktop for the following instructions to work. Please refer to Installing the OpenShift Origin CLI if you need to do so.

Pre-requisite 2: You also need to have Maven installed on your laptop/desktop by using dnf/yum or by using the instructions provided at Installing Apache Maven.

Note: during this section, if you see a notification saying "Server connection interrupted" pop up on the OpenShift Origin console, just dismiss it by clicking on the X

  1. Unzip the downloaded ZIP file from the previous section into a directory of your choosing. For the runing example below, the ZIP file was unzipped into a directory named "Downloads". Change directory to "booster-rest-http-wildfly-swarm" and "oc login" to the all-in-one OpenShift Origin cluster running on Azure (the URL for the cluster is the string from the "ORIGINCONSOLE" field from step 2 in section B above):

  1. Create a new project in the OpenShift Origin cluster called "my-wfs-proj". Creating the project will also set your working project to it. Then issue the command to build, create the container images, deploy and run the project to the cluster: "mvn clean fabric8:deploy -Popenshift", as follows:

  1. After about 15 minutes, you will see the following lines indicating its successful build and deployment:

  1. Go back to your browser tab with the OpenShift Origin console and refresh it. You will now see the "my-wfs-proj" project listed under the "My Projects" panel.

  1. Click on the name of "my-wfs-proj" to open the following window that displays its route to the right of the application name. A route is the external address to access the project user interface:

  1. Click on the route (long string that starts with "http:" and ends with ".nip.io". This will open a browser tab with the project "Greeting Service" landing page:

  1. Enter your name in the field "Name" and click the "Invoke" button. Under the "Result:" heading, you will see a message that says: "Hello, !", as follows:

Conclusion

Congratulations! You have successfully used the Red Hat OpenShift Application Runtimes Launcher to create a sample WildFly Swarm project, which you then deployed to an all-in-one OpenShift Origin cluster running on Azure.

If you would like to inspect the project source code, please use an IDE of your choosing, e.g. Eclipse, IntelliJ, and open the project, which, in the example above, is located at directory ${HOME}/Downloads/booster-rest-http-wildfly-swarm.

Lastly, to learn more, go to:

Red Hat OpenShift Application Runtimes

WildFly Swarm/Thortail

Azure