Run Symphony as a Single Process
This tutorial shows you how to launch Symphony as a single process and call the Symphony APIs. Since all state is kept in memory, you can shut it down safely with no cleanup and no leftovers.
Part 1: Launch Symphony in a Process
-
Install Maestro and launch Symphony as a process (enabled by the
--no-k8sswitch):wget -q https://raw.githubusercontent.com/eclipse-symphony/symphony/master/cli/install/install.sh -O - | /bin/bash maestro up --no-k8spowershell -Command "iwr -useb https://raw.githubusercontent.com/eclipse-symphony/symphony/master/cli/install/install.ps1 | iex" maestro up --no-k8s -
In a separate Terminal Window, Invoke the
greetingendpoint which doesn’t require authentication:curl -L http://localhost:8082/v1alpha2/greetings(iwr http://localhost:8082/v1alpha2/greetings -UseBasicParsing).Content maestro up --no-k8sYou shoulde see a string reponse:
Hello from Symphony K8s control plane (S8C)
Part 2: Deploying a Docker container
NOTE: You need Docker for this part
-
Use maestro to deploy the hello-world sample, which deploys a Prometheus server Docker container to your machine:
maestro samples run hello-worldYou should see outputs like this:
Creating target sample-local-target ... done Creating solution sample-prometheus-server ... done Creating solutionversion sample-prometheus-server-v-v1 ... done Creating instance sample-prometheus-instance ... done ⣟ NOTE: Navigate to http://localhost:9090/ to access the Promethus portal (it may take a few seconds for the Prometheus server to be ready) -
After a few moments, you should be able to see the Docker container deployed:
docker psyou should see a
sample-prometheus-servercontainer in the list. -
Symphony does continuous state seeking. If you delete the container, Symphony brings it back because that’s what the desired state is. To test this, manually shut down the container:
docker rm -f sample-prometheus-serverThen, after a few moments (during next reconcilation loop), the container should be brought back.
docker psYou should see something like:
... IMAGE ... CREATED STATUS PORTS NAMES ... prom/prometheus ... 18 seconds ago Up 17 seconds 0.0.0.0:9090->9090/tcp sample-prometheus-server -
(Optional) Open a browser and navigate to
http://localhost:9090to see the Prometheus interface.
Part 3: Clean up
- Kill the Symphony process with
Ctrl+C. - (Optional) Remove the container:
docker rm -f sample-prometheus-server