Local hello-world
This example demonstrates a simple deployment of local HTTP server with a hello-world page on it.
Prerequisites
This example expects the following prerequisites:
- A cloudify manager setup ready. This can be either a Cloudify Hosted service trial account, a Cloudify Premium Manager, or a Cloudify Community Manager.
CLI or Management Console?
Cloudify allows for multiple user interfaces. Some users find the Cloudify Management Console (web based UI) more intuitive while others prefer the Cloudify CLI (Command Line Interface). This tutorial and all following ones will describe both methods.
Community version - Some of the options described in the guide are not available in the community version management console (web UI). An example would be setting up secrets. You can still perform all of the functionality using the Cloudify CLI.
Cloudify Management Console
This section explains how to run the above described steps using the Cloudify Management Console. The Cloudify Management Console and Cloudify CLI can be used interchangeably for all Cloudify activities.
Upload Blueprint
A Cloudify blueprint is a general purpose model for describing systems, services or any orchestrated object topology. Blueprints are represented as descriptive code (yaml based files) and typically stored and managed as part of the source repository. The blueprint is available here.
The flow required to setup a service consists of:
- Upload the blueprint describing the service to the Cloudify Manager.
- Create a deployment from the uploaded blueprint. This generates a model of the service topology in the Cloudify database and provides the “context” needed for running workflows.
- Run the install workflow for the created deployment to apply the model to the infrastructure.
Let’s run these one by one.
To upload a blueprint to the Cloudify manager, select the Local Blueprints page, and use the Upload button.
- Blueprint package: link
- Blueprint name: simple-hello-world-example
- Blueprint YAML file: blueprint.yaml
Deploy & Install
Once the blueprint is uploaded, it will be displayed in the Blueprints widget. to deploy the blueprint click the Create deployment button next to the blueprint you wish to deploy. Specify a deployment name, update any inputs, and click Deploy & Install
You will be directed to the Deployment page and will be able to track the progress of the execution.
The deployment you have created should be displayed in the deployments list in the Deployments page.
Validate
In this example we have setup a simple HTTP service hosting a static site.
To access your new service, simply browse to http://localhost:8000/
Teardown
To remove the deployment and destroy the orchestrated service, run the Uninstall workflow by clicking the Execute workflow menu next to the deployment, expanding Default workflows, and selecting Uninstall.
Cloudify CLI
Upload Blueprint and Deploy
A Cloudify blueprint is a general purpose model for describing systems, services or any orchestrated object topology. Blueprints are represented as descriptive code (YAML-based files) and are typically stored and managed as part of the source code repository. The blueprint is available here.
Uploading a blueprint to Cloudify can be done by direct upload or by providing the link in the source code repository. The flow to do that is:
- Upload the blueprint.
- Create a deployment from the uploaded blueprint. This generates a model of the service topology in the Cloudify database and provides the “context” needed for running workflows.
- Run the install workflow for the created deployment to apply the model to the infrastructure.
In order to perform this flow as a single unit, we will use the install command.
cfy install https://github.com/cloudify-community/blueprint-examples/releases/download/5.0.5-14/simple-hello-world-example.zip -n blueprint.yaml
Note: Usually, in order to connect and deploy instances on cloud platforms (such as AWS, Azure etc.) we need to upload the appropriate Cloudify plugins, but in this example the infrastructure is local and not interacting with any cloud provider.
Validate
In this example we have setup a simple HTTP service hosting a static site.
Firstly, in order to see that the deployment was successfully created, run:
$ cfy deployments list
Listing all deployments...
Deployments:
+----------------------------+----------------------------+--------------------------+--------------------------+------------+----------------+------------+-----------+
| id | blueprint_id | created_at | updated_at | visibility | tenant_name | created_by | site_name |
+----------------------------+----------------------------+--------------------------+--------------------------+------------+----------------+------------+-----------+
| simple-hello-world-example | simple-hello-world-example | 2020-04-05 14:34:49.487 | 2020-04-05 14:34:49.487 | tenant | default_tenant | admin | |
+----------------------------+----------------------------+--------------------------+--------------------------+------------+----------------+------------+-----------+
Showing 1 of 1 deployments
To access your new service, simply browse to http://localhost:8000/
Teardown
To remove the deployment and destroy the orchestrated service, run the uninstall command:
cfy uninstall simple-hello-world-example