# 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](https://github.com/cmusatyalab/sinfonia-tier3/blob/main/src/sinfonia_tier3/root_helper.py)
It runs the equivalent of the following.
```sh
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>
```
Raw data
{
"_id": null,
"home_page": "https://github.com/cmusatyalab/sinfonia-tier3",
"name": "sinfonia-tier3",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Carnegie Mellon University",
"author_email": "satya+group@cs.cmu.edu",
"download_url": "https://files.pythonhosted.org/packages/cc/01/e22394c00b362b290a9ff9f184f06dcb66450f0fd45c787ca01634210394/sinfonia_tier3-0.7.3.tar.gz",
"platform": null,
"description": "# Sinfonia\n\nManages discovery of nearby cloudlets and deployment of backends for\nedge-native applications.\n\nThe framework is a 3 tiered system. Tier 1 is located in the cloud and tracks\navailability of the Tier 2 instances running on the edge of the network\n(cloudlets) where backends can be deployed. Tier 3 is the client application\nthat mediates the discovery and deployment process for edge-native\napplications.\n\nThis repository implements an example Tier3 client which can be used both as a\ncommand-line application and as a Python library.\n\n\n## Installation\n\nYou probably don't need to install this directly, most of the time it should\nget installed as a dependency of whichever edge-native application is using\nthe Sinfonia framework to discover nearby cloudlets.\n\nBut if you want to run the standalone command-line application, you can install\nthis with installable with `pipx install sinfonia-tier3` or\n`pip install [--user] sinfonia-tier3`.\n\n\n## Usage\n\nThe `sinfonia-tier3` application would normally be called by any edge-native\napplication that uses the Sinfonia framework to deploy its application specific\nbackend on a nearby cloudlet.\n\nThe information needed by the application are the URL of a Tier1 instance\nand the UUID identifying the required backend. The remainder of the arguments\nconsist of the actual frontend application and arguments that will be launched\nin an seperate network namespace connecting back to the deployed backend.\n\n $ sinfonia-tier3 <tier1-url> <uuid> <frontend-app> <args...>\n\nAn example application with UUID:00000000-0000-0000-0000-000000000000 (or the\nconvenient alias 'helloworld') starts an nginx server that will be accessible\nwith the hostname 'helloworld'.\n\n $ sinfonia-tier3 https://tier1.server.url/ helloworld /bin/sh\n sinfonia$ curl -v http://helloworld/\n ...\n sinfonia$ exit\n\nWhen the frontend application exits, the network namespace and WireGuard tunnel\nare cleaned up. Any resources on the cloudlet will be automatically released\nonce the Sinfonia-tier2 instance notices the VPN tunnel has been idle.\n\n\n## Installation from this source repository\n\nYou need a recent version of `poetry`\n\n $ pip install --user pipx\n $ ~/.local/bin/pipx ensurepath\n ... possibly restart shell to pick up the right PATH\n $ pipx install poetry\n\nAnd then use poetry to install the necessary dependencies,\n\n $ git clone https://github.com/cmusatyalab/sinfonia-tier3.git\n $ cd sinfonia-tier3\n $ poetry install\n $ poetry run sinfonia-tier3 ...\n ... or\n $ poetry shell\n (env)$ sinfonia-tier3 ...\n\n\n## Why do we need a sudo password when deploying\n\nActually you should not need a password if `wireguard4netns` works correctly\nBut if for some reason it fails to create the tuntap device and launch\nwireguard-go, the code will fall back on the older `sudo` implementation.\n\nThe older `sudo` implementation uses the in-kernel Wireguard implementation and\nneeds root access to create and configure the WireGuard device and endpoint.\nAll of the code running as root is contained in\n[src/sinfonia_tier3/root_helper.py](https://github.com/cmusatyalab/sinfonia-tier3/blob/main/src/sinfonia_tier3/root_helper.py)\n\nIt runs the equivalent of the following.\n\n```sh\n ip link add wg-tunnel type wireguard\n wg set wg-tunnel private-key <private-key> peer <public-key> endpoint ...\n ip link set dev wg-tunnel netns <application network namespace>\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Tier 3 component of the Sinfonia system",
"version": "0.7.3",
"project_urls": {
"Homepage": "https://github.com/cmusatyalab/sinfonia-tier3",
"Repository": "https://github.com/cmusatyalab/sinfonia-tier3"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "541d949cb64fb171d852381dc382902a9adbb84fef032413a935b5d900aa74bf",
"md5": "49653c5739a8b5ac7a942ac39e035005",
"sha256": "5c49d6afee70ce4664d4240daa431fabb5739cf06b7bf23a5393f5a3289a52a9"
},
"downloads": -1,
"filename": "sinfonia_tier3-0.7.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "49653c5739a8b5ac7a942ac39e035005",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 16687,
"upload_time": "2023-07-13T02:12:12",
"upload_time_iso_8601": "2023-07-13T02:12:12.260327Z",
"url": "https://files.pythonhosted.org/packages/54/1d/949cb64fb171d852381dc382902a9adbb84fef032413a935b5d900aa74bf/sinfonia_tier3-0.7.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc01e22394c00b362b290a9ff9f184f06dcb66450f0fd45c787ca01634210394",
"md5": "057a2d01a8fdb63cd1d1ebb96d8fb4db",
"sha256": "9e4853dd72cc9000f7a17a6e146ce4d3b941f4c3eb5ec88e648b179e7b6aecc4"
},
"downloads": -1,
"filename": "sinfonia_tier3-0.7.3.tar.gz",
"has_sig": false,
"md5_digest": "057a2d01a8fdb63cd1d1ebb96d8fb4db",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 15122,
"upload_time": "2023-07-13T02:12:13",
"upload_time_iso_8601": "2023-07-13T02:12:13.810992Z",
"url": "https://files.pythonhosted.org/packages/cc/01/e22394c00b362b290a9ff9f184f06dcb66450f0fd45c787ca01634210394/sinfonia_tier3-0.7.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-13 02:12:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cmusatyalab",
"github_project": "sinfonia-tier3",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sinfonia-tier3"
}