Skip to content

Commit d5996de

Browse files
Deduplicate examples (#2397)
* Write fundamentals doc * Refactor AWS basics example to use new format * Add verification section Co-authored-by: acritelli <anthony@cloudify.co>
1 parent ec49733 commit d5996de

16 files changed

Lines changed: 256 additions & 326 deletions

File tree

content/install_maintain/installation/installing-manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ The arguments are optional if already configured in `config.yaml` (see [{{< para
157157
158158
159159
## First Deployment
160-
Check out your new {{< param cfy_manager_name >}} by installing the [Local Hello-World Example Deployment]({{< relref "trial_getting_started/examples/local/local_hello_world_example.md" >}}).
160+
Check out your new {{< param cfy_manager_name >}} by installing the [Local Hello-World Example Deployment]({{< relref "trial_getting_started/examples/fundamentals/" >}}).
161161
This example demonstrates how you can use {{< param product_name >}} to easily install a local HTTP server with a hello-world page on it.
162162
163163

content/install_maintain/installation/manager-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@ After {{< param cfy_manager_name >}} is installed, you can configure your {{< pa
109109

110110

111111
## First Deployment
112-
Check out your new {{< param cfy_manager_name >}} by installing the [Local Hello-World Example Deployment]({{< relref "trial_getting_started/examples/local/local_hello_world_example.md" >}}).
112+
Check out your new {{< param cfy_manager_name >}} by installing the [Local Hello-World Example Deployment]({{< relref "trial_getting_started/examples/fundamentals/" >}}).
113113
This example demonstrates how you can use {{< param product_name >}} to easily install a local HTTP server with a hello-world page on it.

content/trial_getting_started/examples/basic/aws_basics.md

Lines changed: 30 additions & 167 deletions
Large diffs are not rendered by default.
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
+++
2+
blueprint_name = "blueprint.yaml"
3+
4+
title = "Level 1: Fundamentals"
5+
description = "Install plugins, create secrets, deploy your first blueprint, and learn fundamental concepts."
6+
7+
weight = 10
8+
alwaysopen = false
9+
+++
10+
11+
This section explains the fundamental concepts behind the {{< param cfy_manager_name >}}. You will learn several key concepts needed for future examples, including:
12+
* An overview of blueprints
13+
* Creating secrets
14+
* Uploading plugins
15+
* Uploading blueprints
16+
* Creating a deployment
17+
* Verifying a deployment
18+
* Tearing down a deployment
19+
20+
This example deploys a local HTTP server with a "hello world" web page. The local web server runs entirely on the {{< param cfy_manager_name >}}, and no external IaaS or cloud credentials are needed.
21+
22+
You will learn how to upload, install, validate, and deprovision an environment using a blueprint. A 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 a source repository.
23+
24+
The blueprint for this example is available [here]({{< param first_service_blueprint_local >}}/{{< param blueprint_name >}}).
25+
26+
27+
## Prerequisites
28+
29+
This example expects the following prerequisites:
30+
31+
* A {{< param cfy_manager_name >}} setup ready. This can be either a [{{< param mgr_hosted_title >}}]({{< param mgr_hosted_link >}}), a [{{< param mgr_premium_title >}}]({{< param mgr_premium_link >}}), or a [{{< param mgr_community_title >}}]({{< param mgr_community_link >}}).
32+
33+
34+
## {{< param cfy_cli_name >}} vs. {{< param cfy_console_name >}}
35+
36+
{{< param product_name >}} allows for multiple user interfaces. Some users find the {{< param cfy_console_name >}} (web based UI) more intuitive, while others prefer the {{< param cfy_cli_name >}} (Command Line Interface). These tutorials will describe both methods:
37+
38+
* [Using the {{< param cfy_console_name >}}](#cloudify-management-console)
39+
* [Using the {{< param cfy_cli_name >}}](#cloudify-cli)
40+
41+
If you prefer to use the {{< param cfy_cli_name >}}, then you will need to either use the CLI included on your {{< param cfy_manager_name >}} or [install the CLI.](https://docs.cloudify.co/latest/cloudify_manager/cloudify_cli/)
42+
43+
## {{< param cfy_console_name >}}
44+
45+
This section explains how to run the Hello World example using the {{< param cfy_console_name >}}. The {{< param cfy_console_name >}} and {{< param cfy_cli_name >}} can be used interchangeably for all {{< param product_name >}} activities.
46+
47+
The flow required to setup a service consists of the following steps:
48+
49+
1. Upload the blueprint describing the service to the {{< param cfy_manager_name >}}.
50+
1. Create a deployment from the uploaded blueprint. This generates a model of the service topology in the {{< param product_name >}} database and provides the "context" needed for running workflows.
51+
1. Run the **install** workflow for the created deployment to apply the model to the infrastructure.
52+
53+
### Create secrets
54+
55+
This particular example does not require any secrets in the {{< param cfy_manager_name >}}. However, future examples will ask you to create secrets. Therefore, understanding how to create secrets is an important skill.
56+
57+
To create a new secret, navigate to **Resources > Secrets**. Click the **Create** button and provide a key and value for the secret. For example, create a new secret with a key of "hello" and a value of "world":
58+
59+
![Creating a secret]( /images/trial_getting_started/first_service/fundamentals/create_secrets.png )
60+
61+
You can use the "Hidden Value" checkbox to hide the secret value in the UI. You can also upload secrets from files.
62+
63+
Once a secret has been uploaded to the {{< param cfy_manager_name >}}, it can be used in blueprints. You will leverage secrets in future examples.
64+
65+
### Upload plugins
66+
67+
Plugins are {{< param product_name >}}'s extendable interfaces to services, cloud providers and automation tools. For example: connecting to a cloud provider, such as AWS, requires the AWS plugin.
68+
69+
This particular example does not require any plugins to work. However, future examples will show you how to integrate with cloud providers and automation tools using plugins. Therefore, understanding how to upload plugins is an important skill.
70+
71+
To upload a plugin, navigate to **Resources > Plugins**. Use the **Upload > Upload from Marketplace** button to load the marketplace of available plugins. Select any plugin and click the upload button to add the plugin to the {{< param cfy_manager_name >}}:
72+
73+
![Uploading a plugin]( /images/trial_getting_started/first_service/fundamentals/upload_plugins.png )
74+
75+
Once a plugin has been uploaded to {{< param cfy_manager_name >}}, it can be used in blueprints. You will leverage several plugins in future examples to orchestrate cloud and application resources.
76+
77+
### Upload Blueprint
78+
79+
To upload a blueprint to the {{< param cfy_manager_name >}}, select the **Blueprints** page and use the **Upload** button. Provide the following inputs to the modal:
80+
81+
* Blueprint package: [link]({{< param first_service_blueprint_local_zip >}})
82+
* Blueprint name: {{< param first_service_blueprint_local_name >}}
83+
* Blueprint YAML file: {{< param blueprint_name >}}
84+
85+
![Upload a Blueprint]( /images/trial_getting_started/first_service/fundamentals/upload_blueprint.png )
86+
87+
### Deploy and Install
88+
89+
Once the blueprint is uploaded, it will be displayed in the Blueprints widget. To deploy the blueprint, click the **Deploy** button next to the blueprint you wish to deploy. Specify the deployment name and click **Install**:
90+
91+
![Create a deployment]( /images/trial_getting_started/first_service/fundamentals/create_deployment.png )
92+
93+
You will be directed to the **Deployment** page and will be able to track the progress of the execution:
94+
95+
![Deployment page]( /images/trial_getting_started/first_service/fundamentals/deployment_page.png )
96+
97+
98+
The deployment you have created for a particular blueprint will be displayed in the deployments list for that blueprint:
99+
100+
![Deployment list]( /images/trial_getting_started/first_service/fundamentals/deployment_list.png )
101+
102+
### Validate
103+
104+
The example blueprint deploys a simple HTTP service with a static website. It runs locally on the {{< param cfy_manager_name >}}. Once the deployment process has finished running, you can view the outputs and capabilities for the deployment by navigating to the **Deployment Info** page:
105+
106+
TODO: screenshot
107+
108+
To access the web server, simply navigate to the appropriate application endpoint:
109+
110+
* `http://127.0.0.1:8000` if you are using your local machine or a Docker container as the {{< param cfy_manager_name >}} machine.
111+
* `http://<VM IP>:8000` if you are using a VM as the {{< param cfy_manager_name >}} machine.
112+
* `http://<your {{< param cfy_caas >}} URL>:8000` if you are using {{< param cfy_caas >}}.
113+
114+
### Teardown
115+
116+
To remove the deployment and destroy the orchestrated service, run the **Uninstall** workflow by clicking the **Deployment actions** button on the deployment page and selecting **Uninstall**. Click the **Execute** button on the modal.
117+
118+
![Uninstall deployment]( /images/trial_getting_started/first_service/fundamentals/uninstall.png )
119+
120+
121+
## {{< param cfy_cli_name >}}
122+
123+
This section explains how to run the Hello World example using the {{< param cfy_cli_name >}}. The {{< param cfy_console_name >}} and {{< param cfy_cli_name >}} can be used interchangeably for all {{< param product_name >}} activities.
124+
125+
The {{< param cfy_cli_name >}} enables you to upload a blueprint, create a deployment, and run the install workflow using a single command.
126+
127+
### Create secrets
128+
129+
This particular example does not require any secrets in the {{< param cfy_manager_name >}}. However, future examples will ask you to create secrets. Therefore, understanding how to create secrets is an important skill.
130+
131+
Secrets can be created using the `cfy secrets create` command. For example, create a new secret with a key of "hello" and a value of "world":
132+
133+
```bash
134+
$ cfy secrets create hello --secret-string world
135+
Secret `hello` created
136+
```
137+
138+
If the secret already exists in your manager, you can update the value using the `-u` flag:
139+
140+
```bash
141+
$ cfy secrets create hello -u --secret-string newValue
142+
Secret `hello` created
143+
```
144+
145+
### Upload plugins
146+
147+
Plugins are {{< param product_name >}}'s extendable interfaces to services, cloud providers and automation tools. For example: connecting to a cloud provider, such as AWS, requires the AWS plugin.
148+
149+
This particular example does not require any plugins to work. However, future examples will show you how to integrate with cloud providers and automation tools using plugins. Therefore, understanding how to upload plugins is an important skill.
150+
151+
While individual plugins can be uploaded via the CLI, the easiest method to begin using plugins is to upload the default plugins bundle:
152+
153+
```bash
154+
$ cfy plugins bundle-upload
155+
Starting upload of plugins bundle, this may take few minutes to complete.
156+
```
157+
158+
### Upload Blueprint and Deploy
159+
160+
Uploading a blueprint to {{< param product_name >}} can be done by direct upload or by providing the link in the source code repository. This involves the following steps:
161+
162+
1. Upload the blueprint describing the service to the {{< param cfy_manager_name >}}.
163+
1. Create a deployment from the uploaded blueprint. This generates a model of the service topology in the {{< param product_name >}} database and provides the "context" needed for running workflows.
164+
1. Run the **install** workflow for the created deployment to apply the model to the infrastructure.
165+
166+
To perform this flow as a single operation, you can use the `install` command:
167+
168+
```bash
169+
cfy install {{< param first_service_blueprint_local_zip >}} -n {{< param blueprint_name >}}
170+
```
171+
The command takes a path to a blueprint archive, which can be a URL or a location on the local filesystem. The `-n` flag specifies the blueprint file within the archive.
172+
173+
### Validate
174+
175+
The example blueprint deploys a simple HTTP service with a static website. It runs locally on the {{< param cfy_manager_name >}}.
176+
177+
You can list all of the deployments in the {{< param cfy_manager_name >}} with the `deployments list` command:
178+
179+
```bash
180+
$ cfy deployments list
181+
Listing all deployments...
182+
183+
Deployments:
184+
+----------------------------+----------------------------+----------------------------+--------------------------+--------------------------+------------+----------------+------------+-----------+--------+-------------------+---------------------+
185+
| id | display_name | blueprint_id | created_at | updated_at | visibility | tenant_name | created_by | site_name | labels | deployment_status | installation_status |
186+
+----------------------------+----------------------------+----------------------------+--------------------------+--------------------------+------------+----------------+------------+-----------+--------+-------------------+---------------------+
187+
| simple-hello-world-example | simple-hello-world-example | simple-hello-world-example | 2022-11-08 18:30:07.188 | 2022-11-08 18:30:07.188 | tenant | default_tenant | admin | | | good | active |
188+
+----------------------------+----------------------------+----------------------------+--------------------------+--------------------------+------------+----------------+------------+-----------+--------+-------------------+---------------------+
189+
190+
Showing 1 of 1 deployments
191+
```
192+
193+
You can view the outputs and capabilities of a particular deployment with the `deployment outputs` and `deployment capabilities` commands. Each command takes a deployment ID as an argument:
194+
195+
```bash
196+
$ cfy deployment outputs simple-hello-world-example
197+
Retrieving outputs for deployment simple-hello-world-example...
198+
- "application_endpoint":
199+
Description: The external endpoint of the application.
200+
Value: http://192.168.1.10:8000
201+
202+
$ cfy deployment capabilities simple-hello-world-example
203+
Retrieving capabilities for deployment simple-hello-world-example...
204+
205+
```
206+
207+
To access it, simply navigate to the appropriate endpoint:
208+
209+
* `http://127.0.0.1:8000` if you are using your local machine or a Docker container as the {{< param cfy_manager_name >}} machine.
210+
* `http://<VM IP>:8000` if you are using a VM as the {{< param cfy_manager_name >}} machine.
211+
* `http://<your {{< param cfy_caas >}} URL>:8000` if you are using {{< param cfy_caas >}}.
212+
213+
### Teardown
214+
215+
To remove the deployment and destroy the orchestrated service, run the `uninstall` command:
216+
```bash
217+
cfy uninstall simple-hello-world-example
218+
```
219+
220+
This will execute the uninstall workflow, delete the deployment, and remove the blueprint.

content/trial_getting_started/examples/local/_index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)