Hello World tutorial¶
A simple “Hello World!” application is the quickest way to see CALM at work. This guide walks you step by step through deploying it to a fleet of edge devices with Orchestra.
Prerequisites¶
Before you begin, make sure you have:
A tenant in Orchestra Manager: see Tenant.
Edge devices in Orchestra: your edge devices added to Orchestra Manager.
Docker Engine: Docker Engine installed on each of your edge devices. For installation instructions, see the official Docker documentation: Install Docker Engine.
Docker Compose file: the following Docker Compose file (
docker-compose.yml) saved on your computer:services: static-response-server: environment: HTTP_BODY: "Hello World!\n" HTTP_CODE: 200 image: colinodell/static-response-server ports: - 8080:8080
Steps¶
Step 1: Create a new fleet¶
Open Orchestra Manager.
In the sidebar, click Fleets. If you haven’t created any fleets yet, the page looks like this:
Click the “+” button in the top right corner.
In the Create new fleet window, enter a name for your fleet, select the devices you want to include and click Create.
The fleet’s Overview opens.
Step 2: Create a composition¶
A composition defines your application and manages its versions. Learn more in Create a composition.
Step 3: Create the first composition version¶
Click Create first version in the middle of the composition page.
Enter a version number according to semantic versioning, for example
1.0.0.Add the
docker-compose.ymlfile you prepared earlier: click Choose file or drag the file into the window.Click Create.
The composition page now shows its details and the uploaded Docker Compose file.
Step 4: Add the composition to the fleet¶
Step 5: Release your composition¶
Check your deployment¶
To make sure your application is running:
On the fleet page, go to the Overview tab and find the Devices table.
Click the ID of a device in your fleet.
The device page opens. Go to the Terminal tab and click Start session.
In the terminal, type
docker psto see the running containers.Test your Hello World application:
$ curl localhost:8080
You should see:
Using variables¶
You can use variables to customize your deployments. Let’s add a global variable:
In the sidebar, click Variables.
Click the “+” button to create a new variable.
Set the Key to
HTTP_BODYand the Value toAwesome response, then click Create. Your first global variable appears in the list.Go back to your fleet’s Compositions tab, select your Hello World composition and click Restart. In the Restart composition window, click Restart again. This restarts the containers and applies the new variable.
Test your application again as in Check your deployment:
$ curl localhost:8080
You’ll see the updated output:
That’s it! Thank you for following this tutorial.
Note
If you face any problems or have suggestions, contact us through our support portal or at support@cthings.co.