.. _hello-world-gui: Hello World Tutorial ======================================= This tutorial guides you step-by-step through deploying a simple "Hello World!" application to a fleet of edge devices using Orchestra. Pre-requisites ------------------ Before you begin, ensure you have: 1. **Orchestra Subscription:** An active Orchestra subscription. For more information, see :ref:`more `. 2. **Edge Devices in Orchestra:** Your edge devices added to Orchestra Manager (see :ref:`add-device`) or running Orchestra Daemon (orchestrad) version 1.4.13 or higher (refer to :ref:`updating-orchestra-daemon` for updates). 3. **Docker Engine:** Docker Engine installed on each of your edge devices. For installation instructions, see the official Docker documentation: `Install Docker Engine `_. 4. **Docker Compose File:** The following Docker Compose file (`docker-compose.yaml`) ready in your working directory: .. code:: yaml 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1. Open the Orchestra web application: `Orchestra Manager `_ . 2. Use the sidebar to navigate to **Fleets**. If you haven't created any fleets yet, the page will look like this: .. image:: images/calm-fleets-empty.png :alt: Fleets empty :width: 100% :align: center 3. Click **Add** in the top right corner. 4. In the "Create a new fleet" dialog, give your fleet a name and select the devices you want to include. .. image:: images/hello-world-create-fleet.png :alt: Creating Hello World Fleet :width: 100% :align: center Step 2: Create a Composition ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A composition defines your application and manages its versions. (Learn more: :ref:`composition`) 1. Use the sidebar to navigate to **Compositions**. 2. Click **Add** in the top right corner. 3. In the "Create a new composition" dialog, enter a name for your composition. .. image:: images/hello-world-create-composition.png :alt: Creating Hello World Application :width: 100% :align: center Step 3: Create the First Composition Version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1. Click **Create first version**. .. image:: images/hello-world-create-first-version.png :alt: Newly created composition :width: 100% :align: center 2. Enter a version number according to semantic versioning principles. 3. Upload the `docker-compose.yaml` file you prepared earlier (provided at the beginning of this tutorial :ref:`here `) . .. image:: images/hello-world-create-new-version.png :alt: Create a first version of your newly created composition :width: 100% :align: center The composition overview page now shows details and displays the uploaded Docker Compose file. .. image:: images/hello-world-composition-overview.png :alt: First version fo your composition :width: 100% :align: center Step 4: Attach Composition to the Fleet ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1. Go to the fleet you created in Step 1. .. image:: images/hello-world-attach-composition.png :alt: :width: 100% :align: center 2. In the **Compositions** table, click **Add**. 3. Select your new composition from the dropdown. .. image:: images/hello-world-choose-composition.png :alt: :width: 100% :align: center Step 5: Release Your Composition ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1. On the fleet page, go to the **Compositions** tab. 2. Select your Hello World composition. .. image:: images/hello-world-fleet-compositions-tab.png :alt: :width: 100% :align: center 3. Click **Create new release**. .. image:: images/hello-world-create-new-release.png :alt: :width: 100% :align: center Your composition is now deploying to all devices in the fleet. .. image:: images/hello-world-composition-version-released.png :alt: :width: 100% :align: center .. _hello-world-check-deployment: Check Your Deployment ---------------------- To make sure your application is running: 1. On the fleet page, go to the **Compositions** tab and find the **Devices** table. 2. Click the **ID** of a device in your fleet. 3. This takes you to the device page. Go to the **Terminal** tab and start a terminal. 4. In the terminal, type `docker ps` to see running containers. 5. Now, test your Hello World application: .. code:: console $ curl localhost:8080 You should see: .. code:: console :class: no-copybutton Hello World! Using Variables -------------------- You can use variables to customize your deployments. Let's add a global variable: 1. In the sidebar, go to **Global variables**. 2. Click **Add** to create a new variable. 3. Set the **Key** to `HTTP_BODY` and the **Value** to `Awesome response` .. image:: images/hello-world-add-global-variable.png :alt: :width: 100% :align: center We have created first global variable. .. image:: images/hello-world-global-variable-created.png :alt: :width: 100% :align: center 4. Back in your fleet's **Compositions** tab, select your Hello World application and click **Restart composition**. This restarts the containers, applying the new variable. 5. Test your application again as we did in the previous step (:ref:`hello-world-check-deployment`). .. code:: console $ curl localhost:8080 You'll see the updated output: .. code:: console :class: no-copybutton Awesome response That's it! Thank you for following this tutorial. .. note:: If you are facing any problems or have suggestions please contact us through our `Customer Portal `_.