FSCompose

Setup

As the Flight Software Compose (FSCompose) suite uses Docker Engine for the containarized applications, we need to install Docker and Docker Compose. The following guide will help you install the necessary dependencies for your OS. Start by cloning the FSCompose repository and then follow the guide for your OS.

   git clone https://github.com/DPhi-Space/FSCompose.git
   cd FSCompose

WSL v2

Unfortunately, Docker Desktop for Windows does not support WSL v1. However, you can use Docker Desktop for Windows with WSL v2. To do so, follow the guide below:

https://docs.docker.com/desktop/windows/wsl/

Linux

For Linux, we provide a setup script that will take care of the necessary dependencies for you. Execute with admin privilege :

sudo ./setup.sh

⚠️ Make sure you have execution permissions on it. If you get a Permission denied or Command not found error, run the following:

sudo chmod +x setup.sh

Configuration

FSCompose needs some special Docker configurations to be set in order to properly function, such as enabling local registries. To correctly configure it, run the following script :

chmod +x configure.sh
sudo ./configure.sh

⚠️ For now, sudo permission is needed for this script as it will copy the docker-daemon.json file to the /etc/docker/ folder and restart the docker service with systemctl. You can perform this manually if you prefer. Also add the following entry to the /etc/hosts if you do this manually :

# /etc/hosts
0.0.0.0   registry

Run the FSCompose

To kick-off development, start by creating a new python environment and installing the necessary packages to run the local:

    $ python3 -m venv venv
    $ . venv/bin/activate
    $ pip3 install -r requirements.txt

Before starting the FSCompose, the user needs to enter the following information into deploy/providers.json configuration file:

Below is an example on how to fill it up:

{
  "providers": [
    {
      "name": "DiamondDogs",
      "devices": ["/dev/ttyACM0"],
      "payloads": ["ArduinoMega"]
    }
  ]
}

⚠️⚠️ If you wish to use FSCompose with no device attached, leave the devices entry empty, as shown below. Otherwise, the FSCompose will try to attach the device specified to your Container and it will fail to launch it if the device does not exist.

"devices": [],

To start the local deployment of DPhi Space Flight Software (FS), first login to our private Docker Registry. Use the login credentials provided by email for the Docker Registry:

$ docker login ops.dphi.space
Username: [Username]
Password: [Password]

Now we are ready to start the FSCompose, run the following script.

$ python3 main.py

It will request for your GS Dashboard login credentials, which are used to fetch the files you have uploaded to it. Once the credentials are validated, it will fetch the payloads_files.zip, pull the Docker Containers of the FSCompose from the private Docker registry, launch the FSCompose suite, and then start the FS Interface software to communicate with the FSCompose. We will get into the latter in the Flight Software section.

Next Step

Now the next step is to learn how to use the Ground Segment:

Ground Segment