Hello World Tutorial¶
Here we will show you step-by-step how to deploy Hello World! application to a fleet of edge devices.
Video Tutorial¶
Pre-requisites¶
Have Orchestra subscription (more).
Add all your edge devices to Orchestra Manager (more) or make sure the Orchestra Daemon (orchestrad) installed is version 1.4.13 or above (Updating Orchestra Daemon).
Install Docker Engine on your edge devices (Install Docker Engine).
Make sure your Docker Compose file
docker-compose.yaml
is ready and correct before proceeding. Copy the docker file from here and save in your working directory.
services:
static-response-server:
environment:
HTTP_BODY: "Welcome into Carrots Server!\n"
HTTP_CODE: 200
image: colinodell/static-response-server
ports:
- 8080:8080
Steps¶
Step 1: List All Fleets¶
Begin by listing all the fleets in your system. This helps you identify existing fleets before proceeding to create a new one (more: List).
In this example we have no fleets.
$ ocli calm fleet list
Step 2: Create a New Fleet¶
Now, create a fleet where you will deploy your compositions. Include all of the devices you want to deploy wirepas application on (more: Create).
$ ocli calm fleet create --name "name" --description "desc"
Step 3: Create a Composition¶
Next, create a composition. It defines your app and will store the versioning of this app (more: Create).
$ ocli calm composition create -n "name"
Step 4: Attach Composition to the Fleet¶
Now, attach the composition you just created to your fleet. This step ensures that the fleet is ready to deploy the specified services (more: Attach).
$ ocli calm fleet attach composition -r <composition_id> <fleet_id>
Step 5: Attach Devices to Your Fleet¶
Add the required devices to your fleet. These devices will run the services defined in your composition (more: Attach).
Note
Use the arrow keys to navigate the list of devices, press Space to select devices, and hit Enter to confirm your selections.
$ ocli calm fleet attach device <fleet_id>
Step 6: Create a Composition Version¶
After creating the composition, create a composition version for it. This version will be linked to specific configurations in your compose file. (more: Create).
Note
Make sure your Docker Compose file docker-compose.yaml
is ready and correct before proceeding.
$ ocli calm composition-version create -f <path to docker compose .yaml file> -v <version e.g. 1.0.0> -d "description" <composition_id>
Step 7: Release Your Composition¶
Finally, release the desired composition version to your fleet. This will deploy the services across the devices in the fleet (more: Release).
$ ocli calm release create -v <composition_version_id> -f <fleet_id>
Step 8: Check The Release¶
After few minutes let’s check if the release succeeded. Use the fleet get command (more: Get).
If the status is RECONFIGURING
wait a few minutes more.
$ ocli calm fleet get <fleet_id>
Check it¶
After deploying user can check if is working by running:
If is called inside your device:
And if device is exposed we can externally knowing its IP:
Success!
Use Variables¶
Now when you already seen how easy you can deploy your service, we can show you how to use variables:
First add variable:
$ ocli calm variable create -k HTTP_BODY -v "Awesome response" -d "Response" global
Then restart composition:
$ ocli calm release restart -f <fleet_id>
That’s it!
Note
If you are facing any problems or have suggestions please contact us through our Customer Portal.