Monday, February 11, 2019

Service Deployement on local machine using Cloudify CLI

Prerequisite: It is assumed that Docker and Cloudify CLI is already installed on the local machine.
Basic knowledge of Docker commands.

If Cloudify is NOT yet install follow the previous post HERE.
If Docker is NOT yet install follow the previous post HERE.


In this post we will see how to deploy a web service on the local machine using Cloudify CLI. We will follow the TOSCA standard of blueprint file.


The deployment can be done in two ways: (a) using command line console and (b) using Cloudify web interface. We will deploy a simple web service or the blueprint available in 
or 

Deploy the Hello World Example on your local machine using console 
 
Step - 1 : Open terminal byAlt+Ctrl+t
pressing the key combination
Step - 2 : Run the following command to start 

sudo docker run --name cfy_manager_local \
    -d --restart unless-stopped \
    -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
    --tmpfs /run \
    --tmpfs /run/lock \
    --security-opt seccomp:unconfined \
    --cap-add SYS_ADMIN \
    -p 80:80 \
    -p 8000:8000 \
    cloudifyplatform/community:18.10.4

Step - 3 : Run following command the install the Hello World web service

sudo docker exec -it cfy_manager_local sh -c "cfy install https://github.com/chinmaya-dehury/local-simple-python-webserver-blueprint/archive/master.zip"
The entire Git directory will be copied to /opt/manager/resource directory

Step - 4 : Open the web browser and goto localhost:8000. You can see the output.


Deploy the Hello World Example on your local machine using web interface 
Step - 1: Open web Browser:
Step - 2: Goto localhost or enter the IP of the local computer
Step - 3: Enter admin as username and password


Step - 4: After login, the interface would look like below.


Step - 5: Click on "upload Blueprint" option 
Step - 6: Enter the URL  https://github.com/chinmaya-dehury/local-simple-python-webserver-blueprint/archive/master.zip
Change the Blueprint name to "local-simple-python-webserver-blueprint"
Click On "Upload" button




Step - 7: Click on "Deployments" Page. Then Click on "Create Deployment" option



Step - 8: Enter "MyfirstDeploymentUI" as the deployment name
    From the dropdown list of blueprints, select the newly created blueprint.
    Click on "Deploy"  button.


Step - 9: Click on "Install" option.


Step - 10: Now click on "Execute" button.

Step -11:  Enter localhost:8000 in your browser.
The web server application is deployed. The output should look like below.




No comments:

Post a Comment