Skip to main content

Tier 3 component of the Sinfonia system

Project description

Sinfonia

Manages discovery of nearby cloudlets and deployment of backends for edge-native applications.

The framework is a 3 tiered system. Tier 1 is located in the cloud and tracks availability of the Tier 2 instances running on the edge of the network (cloudlets) where backends can be deployed. Tier 3 is the client application that mediates the discovery and deployment process for edge-native applications.

This repository implements an example Tier3 client which can be used both as a command-line application and as a Python library.

Installation

You probably don't need to install this directly, most of the time it should get installed as a dependency of whichever edge-native application is using the Sinfonia framework to discover nearby cloudlets.

But if you want to run the standalone command-line application, you can install this with installable with pipx install sinfonia-tier3 or pip install [--user] sinfonia-tier3.

Usage

The sinfonia-tier3 application would normally be called by any edge-native application that uses the Sinfonia framework to deploy its application specific backend on a nearby cloudlet.

The information needed by the application are the URL of a Tier1 instance and the UUID identifying the required backend. The remainder of the arguments consist of the actual frontend application and arguments that will be launched in an seperate network namespace connecting back to the deployed backend.

$ sinfonia-tier3 <tier1-url> <uuid> <frontend-app> <args...>

An example application with UUID:00000000-0000-0000-0000-000000000000 (or the convenient alias 'helloworld') starts an nginx server that will be accessible with the hostname 'helloworld'.

$ sinfonia-tier3 https://tier1.server.url/ helloworld /bin/sh
sinfonia$ curl -v http://helloworld/
...
sinfonia$ exit

When the frontend application exits, the network namespace and WireGuard tunnel are cleaned up. Any resources on the cloudlet will be automatically released once the Sinfonia-tier2 instance notices the VPN tunnel has been idle.

Installation from this source repository

You need a recent version of poetry

$ pip install --user pipx
$ ~/.local/bin/pipx ensurepath
... possibly restart shell to pick up the right PATH
$ pipx install poetry

And then use poetry to install the necessary dependencies,

$ git clone https://github.com/cmusatyalab/sinfonia-tier3.git
$ cd sinfonia-tier3
$ poetry install
$ poetry run sinfonia-tier3 ...
... or
$ poetry shell
(env)$ sinfonia-tier3 ...

Why do we need a sudo password when deploying

Actually you should not need a password if wireguard4netns works correctly But if for some reason it fails to create the tuntap device and launch wireguard-go, the code will fall back on the older sudo implementation.

The older sudo implementation uses the in-kernel Wireguard implementation and needs root access to create and configure the WireGuard device and endpoint. All of the code running as root is contained in src/sinfonia_tier3/root_helper.py

It runs the equivalent of the following.

    ip link add wg-tunnel type wireguard
    wg set wg-tunnel private-key <private-key> peer <public-key> endpoint ...
    ip link set dev wg-tunnel netns <application network namespace>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinfonia_tier3-0.7.4.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinfonia_tier3-0.7.4-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file sinfonia_tier3-0.7.4.tar.gz.

File metadata

  • Download URL: sinfonia_tier3-0.7.4.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.1.0-21-amd64

File hashes

Hashes for sinfonia_tier3-0.7.4.tar.gz
Algorithm Hash digest
SHA256 c470529b996ad65e9dd1b38f22bfa423928601a9f1da5e7266310b074c17dc85
MD5 745f466c953565a998b58aafce43f322
BLAKE2b-256 c1a80f783117973a190300622fd941a1e86a5715b6345626f19ec9f3b96d18a0

See more details on using hashes here.

File details

Details for the file sinfonia_tier3-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: sinfonia_tier3-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.1.0-21-amd64

File hashes

Hashes for sinfonia_tier3-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9e35e2926551cbff661b60b669d38850e5b99f85772e06d2d13b6d792c745f78
MD5 32b25887f6e92833649fe10213f571ad
BLAKE2b-256 b1811171c5cbe7b1cfd89402d8769cfd136fb29bb69fea6ba2398a7a80c94325

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page