diff options
| author | diogo464 <[email protected]> | 2025-07-11 13:01:22 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-07-11 13:01:22 +0100 |
| commit | 801c50f93d2ede73282417dd5bba6ad639f4ba21 (patch) | |
| tree | 22bfe4c403dce30fcf2915de83ade5b86d4c3102 /README.md | |
| parent | 1fd86a1c3990f8cec85294ce77152ec4762ae397 (diff) | |
readme wip
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..5872521 --- /dev/null +++ b/README.md | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | # oar-p2p | ||
| 2 | |||
| 3 | oar-p2p is a tool to help setup a network, for peer to peer protocol experiments, between one or more machines inside NOVA's cluster. | ||
| 4 | |||
| 5 | ## prerequisites | ||
| 6 | |||
| 7 | ### 1. cluster access | ||
| 8 | cluster access over ssh is required. you can find out more about the cluster here [http://cluster.di.fct.unl.pt](http://cluster.di.fct.unl.pt). | ||
| 9 | |||
| 10 | ### 2. ssh config | ||
| 11 | you must be able to access the frontend using pub/priv key authentication and using a single hostname (ex: `ssh dicluster`). the cluster's documentation contains more information on how to set this up at [http://cluster.di.fct.unl.pt/docs/usage/getting_started/](http://cluster.di.fct.unl.pt/docs/usage/getting_started/). | ||
| 12 | |||
| 13 | ### 3. ssh between machines | ||
| 14 | once you have access to the frontend you will need to be able to ssh to the various cluster machines using pub/priv key auth (ex: `ssh gengar-1` should work). if you don't already have this setup you can run the following commands from the frontend: | ||
| 15 | ```bash | ||
| 16 | ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519 | ||
| 17 | cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys | ||
| 18 | ``` | ||
| 19 | |||
| 20 | ### 4. install the tool | ||
| 21 | to install the tool you have a few options. | ||
| 22 | + 1. install using cargo (`cargo install --locked --git https://github.com/diogo464/oar-p2p`) | ||
| 23 | + 2. download and extract the binary from one the release assets [https://github.com/diogo464/oar-p2p/releases/latest](https://github.com/diogo464/oar-p2p/releases/latest) | ||
| 24 | + 3. clone and compile from source | ||
| 25 | |||
| 26 | just make sure the binary ends up somewhere in your `PATH`. | ||
| 27 | |||
| 28 | ## usage | ||
| 29 | |||
| 30 | ### 1. setup environment | ||
| 31 | before setting up a network you need to create a job on the cluster and setup some environment variables. the environment variables are not required since you can pass these values as arguments but it makes it easier. | ||
| 32 | ```bash | ||
| 33 | export OAR_JOB_ID="<your job id>" | ||
| 34 | export FRONTEND_HOSTNAME="<cluster's hostname, ex: dicluster>" | ||
| 35 | ``` | ||
| 36 | you can now use a tool like [direnv](https://direnv.net) or just `source` the file with those variables. | ||
| 37 | |||
| 38 | ### 2. creating the network | ||
| 39 | to create a network you will need a latency matrix. you can generate a sample using [bonsai](https://codelab.fct.unl.pt/di/computer-systems/bonsai) or using the [web version](https://bonsai.d464.sh). | ||
| 40 | Here is an example matrix: | ||
| 41 | ``` | ||
| 42 | 0.0 25.5687 78.64806 83.50032 99.91315 | ||
| 43 | 25.5687 0.0 63.165894 66.74037 110.71518 | ||
| 44 | 78.64806 63.165894 0.0 2.4708898 93.90618 | ||
| 45 | 83.50032 66.74037 2.4708898 0.0 84.67561 | ||
| 46 | 99.91315 110.71518 93.90618 84.67561 0.0 | ||
| 47 | ``` | ||
| 48 | |||
| 49 | TODO: update this with addr | ||
| 50 | once you have the latency matrix run: | ||
| 51 | ```bash | ||
| 52 | oar-p2p net up --addr-per-cpu 4 --latency-matrix latency.txt | ||
| 53 | ``` | ||
| 54 | |||
| 55 | |||
