Lab 1 Whatsup Watson Hands-On Lab
Table of contents 1. Create the Whatsup Watson Bluemix Application... Error! Bookmark not defined. 2
Step 1. Deploy to Bluemix using DevOps GUI This procedure provides a method to deploy the WhatsupWatson app using thedevops GUI. 1. In your browser go to Bluemix URL http://bluemix.net and login if necessary. 2. Make sure you re in the Dashboard tab (if not click on the Dashboard link at the top of the page to take you there). 3. Open another tab in your browser and go to the project at WhatsupWatson by typing the URL https://hub.jazz.net/git/tvganesh/whatsupwatson/. 3
4. Click Fork Project. Name your project appropriately. 5. Uncheck Make it private and Add features for Scrum development. Select and check Deploy to Bluemix. Then click Create. 4
6. Open the manifest.yml file using the GUI editor and enter the name of your app (for example, "DrWatson" or "Doctor", as appropriate). 7. Use a unique name for the host field. Commit and push the changes. 5
8. Now click Deploy button to deploy your code. 9. In a few moments, OK is displayed and WhatsupWatson appears in the Bluemix dashboard as Not Running. 6
10. Next, Add a Service from the Bluemix dashboard above, then add the Watson service as described below in Step 2. 7
Step 2: Add a service from the Bluemix Dashboard You can add a service from the Bluemix dashboard, as follows: Lab 1 : Whatsup Watson 1. On the Bluemix dashboard, you should see the WhatsupWatson app. This will appear in the dashboard as Not running. 2. Now click Add a Service and under Watson, add Question and Answer. 8
3. Add Watson Question and Answer-ri to the WhatsupWatsonapp. Lab 1 : Whatsup Watson 4. You are prompted with the message Restage Application. Click OK. Once you have the app running, you should be able to get started with Doc Watson. 9
Step 3. Run the application To run the Watson Question and Answer application, click on the route. In this case, the route is anbdrwatson.mybluemix.net. Step 4. Dr. Watson at your service This should bring up the Watson Question and Answer, and the application will run as shown below. No further changes are needed to run the app. 10
Appendix: Step 1a. Deploy the app to Bluemix using the cf command This procedure provides an alternative method to deploying the WhatsupWatson app using Git and Cloud Foundry command line utility tools. 1. To use the Git command line, download the code from my DevOps Services project into a local directory named whatsup. Run the following command: git clone https://hub.jazz.net/git/tvganesh/whatsupwatson/ The code can also be cloned from my WhatsupWatson project on GitHub: git clone https://github.com/tvganesh/whatsupwatson 2. Download and install the Cloud Foundry (cf) command-line tool, which will be used to upload and manage the app. To validate if Cloud Foundry was installed successfully, run the following command: cf version 3. Log in to Bluemix using the cf CLI command. cf login -a https://api.ng.bluemix.net 4. Go to the directory where you have cloned the code for WhatsupWatson app. Use your favorite editor and edit manifest.yml. Choose an appropriate name for your app (for example, DrWatson or Doctor), change the name field, and save the file. Also provide a unique name for the host field. You could add your initials as a suffix to make it unique. In this case, WhatsupWatson is used for both the app name and the host field. 5. Now push the app to Bluemix using cf: cf push WhatsupWatson --no-start 6. Create an instance of Watson's Question and Answer service by typing the following command: cf create-service question_and_answer question_and_answer001 question_and_answer_free_plan 7. Bind the question_and_answer service instance question_and_answer001 to the Bluemix app, WhatsupWatson. In this case, you would enter: cf bind-service WhatsupWatson question_and_answer001 8. Now start the application: cf start WhatsupWatson 11