From 873caa911cc7dbf1c38ffc4c1c23f64229433aee Mon Sep 17 00:00:00 2001 From: Akilan Date: Fri, 25 Apr 2025 22:27:39 +0100 Subject: [PATCH] modified docs --- .DS_Store | Bin 10244 -> 8196 bytes Bindings/Haskell/lib/API.hs | 2 +- Docs/index.html | 260 ++++++++++++++---------------------- Docs/index.org | 2 + 4 files changed, 101 insertions(+), 163 deletions(-) diff --git a/.DS_Store b/.DS_Store index 97c51a2dbcd0d8181afa0827618b041c36e063aa..e9388618440c92f9836ba04a04010ee6337091bf 100644 GIT binary patch literal 8196 zcmeHMU2GIp6h3EK+B-uFQ|upZmM#4?#-CS=Xu^Yu5u=HJFPaz=O@rWrFTQAe)Wio9_1t@Bn^x!pKKK*nHgnHC z=bm$C&bi;2yJrdj*i$g?184>SMi;00V(MG zK@@=~0#O8_2t*NxBJf{`0G-*qu?5b3IUDs+1fmGskrCkUhXh@mrb0R`sd#lzCrSXK zl_VC8##9Fgn?y)cA)S^~n9`cEdce>W!x96fIn5`yI?+@}rzMrrX-E}C<0LgZjJ!2-K)R=pZ=`5^*hhAO6UU*a^Po6{$$qivLt&qJL%YdkW5}f zrJ{0CRW++-i`kLE6JBXBFoJ^LW8@EUZiqetWXoeCd(gH@8NI&Oa|6S6t-LU>O^Z|x zkJzs1m3q8_Yx=@=P);zFsTsZL?Ah+FWP73`In|z!!_D2BrlwTZ(Av3mAal~0aJ_TV zH4I-5P%HV_{ydFl-EsV4uXLxPq3q7}vOB7_ICgME8ymHAo;zrtu`>EnpZwWFY=7P= zk{=^E&nZl}enzj$8BVU?7=e{`9Iot-2G*&7kH&p3AM^^vjII}aYrrBsyJ+>1HkmHt zD;<~&Y|r%%T6v#nYbq%pSiMry5MOoAy5yz@cJw{8uYaa?$x^*;nWl|XVBEkyW?T8; zl5GYj#tc7axu)$NA1T_topr1s*O;*M_f>VKwy~*s`Q5SDLYkw6to=m64o>T>jLqmv zmey)5v6ZU+4m)hpGw%0Hej`)N#9Cr&7(2w}y?KjzDc07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|dvYgmYE3MdGSFOwB$e@u* zYlfmqyq{HVa%8B$aaJ~am22zd$Z*EWW@#$6SGVETNMsM|c1y~3`o}brhV+rwcNewo zv`14pt$&;>&8yu=weHeUJrn9tb;l|;Zl+o6VCp(l)t$p^rM4!rEixb~Ux>66x>?Z4 zx@q~ik&8{mC1{E@^Q?=b)D&y=T104o<>Y8vU@z@{6YwZJ1;^n{_yA79SMWXj0)N0c zM65&!XJ9qfVFND2C^ljc` zNqicg#pm!CzJRac>-Yw~i=W`9_!)kV-{4vN5r4wp@Vo#53NwT{VXiPwSSUn=MM9I% zCbSDNp;zb=`uVtpq6h6L&d{qLCR*x2-i9DNe_;=*-?(XGue|w+@t`xaxX;X;H$Tc8 zY4!S!DVyU)TC~ejYj;iD=NPVuyS5N8&(q{tSJyYl3yY2ybjU&S4eg-FTv4gw+>7LE zMe+@$f)^LdH;UvHN+mD0)Graq4;8^J%FF6kNaSrw885cfw@adeys%cjMIygb%6YLt zj!BXNZlS)bzDFeAQN;gf)Mwx<{0x7>Uu4v?a1JiO#n_6gaRY9`KI|tmj^iNi!6c^0 zn3*Y?IEDw%#(VHEne!yxk4Nzld<-AQC&;9qA){s{{UW}E$MI!+8&BX#dy)BS}-xOyp7_a6)W3VK(vO%Mk`me1p*=#@KCyFK*VA_-~5XK zH9F% diff --git a/Bindings/Haskell/lib/API.hs b/Bindings/Haskell/lib/API.hs index e1b78d3..0cc616e 100644 --- a/Bindings/Haskell/lib/API.hs +++ b/Bindings/Haskell/lib/API.hs @@ -33,7 +33,7 @@ import CLI , spawnProcP2PRC ) -import System.Environment (lookupEnv) +-- import System.Environment (lookupEnv) diff --git a/Docs/index.html b/Docs/index.html index 27889d0..56c1702 100644 --- a/Docs/index.html +++ b/Docs/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -69,7 +69,7 @@
  • 3.0.17. Pulling plugin from a remote repo
  • 3.0.18. Deleting plugin from the plugin directory
  • 3.0.19. Added custom metadata about the current node
  • -
  • 3.0.20. MapPort and link to domain name
  • +
  • 3.0.20. MapPort and link to domain name
  • @@ -99,8 +99,8 @@
  • 5.3. Current languages supported
  • @@ -117,22 +117,22 @@
  • 9. Client mode
  • -
  • 10. Blog posts +
  • 10. Blog posts
  • -
  • 11. Ideas for future potencial features +
  • 11. Ideas for future potencial features @@ -141,12 +141,14 @@ - +
    +

    Colored-On-Light-Image.png +

    +

    1. Introduction

    -

    1.1. Abstract

    @@ -167,7 +169,6 @@ wider range of computationally intensive tasks.

    -

    1.2. Motivation

    @@ -187,7 +188,6 @@ server.
    -

    2. Installation

    @@ -196,7 +196,6 @@ Over here we will cover the basic steps to get the server and client side running.

    -

    2.1. Latest release install

    @@ -205,7 +204,6 @@ side running.

    -

    2.2. Install from Github master branch

    @@ -220,7 +218,6 @@ Thus, we need go lang to compile to code to a binary file.

    -

    2.2.2. Install Docker

    @@ -239,13 +236,12 @@ Go API to create and interact with the containers. to install docker GPU

    -
    +
     // Do ensure that the docker command does not need sudo to run
     sudo chmod 666 /var/run/docker.sock
     
    -

    2.2.3. Build Project and install project

    @@ -254,11 +250,10 @@ To set up the internal dependencies and build the entire go code into a single binary

    -
    +
     make
     
    -
    1. For Windows
      @@ -267,36 +262,33 @@ To set up P2PRC on Windows, simply run this batch file. Make sure you are not in admin mode when running this.

      -
      +
       .\install.bat
       
    -

    2.2.4. Add appropriate paths to .bashrc

    -
    +
     export P2PRC=/<PATH>/p2p-rendering-computation
     export PATH=/<PATH>/p2p-rendering-computation:${PATH}
     
    -

    2.2.5. Test if binary works

    -
    +
     p2prc --help
     
    -
    1. Output:
      -
      +
       NAME:
          p2p-rendering-computation - p2p cli application to create and access VMs in other servers
       
      @@ -351,7 +343,6 @@ GLOBAL OPTIONS:
       
    -

    3. Using basic commands

    @@ -359,21 +350,19 @@ GLOBAL OPTIONS:

    3.0.1. Start as a server

    -
    +
     p2prc -s 
     
    -

    3.0.2. View server Specification

    -
    +
     p2prc --specs=<ip address>
     
    -

    3.0.3. Run container

    @@ -381,12 +370,11 @@ p2prc --specs=<ip address> use the --gpu if you know the other machine has a gpu.

    -
    +
     p2prc --touch=<server ip address> -p <number of ports> --gpu
     
    -

    3.0.4. Remove container

    @@ -394,164 +382,148 @@ p2prc --touch=<server ip address> -p <number of ports> --gpu The docker id is present in the output where you create a container

    -
    +
     p2prc --rm=<server ip address> --id=<docker container id> 
     
    -

    3.0.5. Adding servers to ip table

    -
    +
     p2prc --as=<server ip address you want to add> 
     
    -

    3.0.6. Update ip table

    -
    +
     p2prc --us 
     
    -

    3.0.7. List Servers

    -
    +
     p2prc --ls 
     
    -

    3.0.8. View Network interfaces

    -
    +
     p2prc --ni
     
    -

    3.0.9. Viewing Containers created Client side

    -
    +
     p2prc --tc
     
    -

    3.0.10. Running plugin

    -
    +
     p2prc --plugin <plugin name> --id <container id or group id>
     
    -

    3.0.11. Create group

    -
    +
     p2prc --cgroup
     
    -

    3.0.12. Add container to group

    -
    +
     p2prc --group <group id> --id <container id>
     
    -

    3.0.13. View groups

    -
    +
     p2prc --groups
     
    -

    3.0.14. View specific group

    -
    +
     p2prc --group <group id>
     
    -

    3.0.15. Delete container from group

    -
    +
     p2prc --rmcgroup --group <group id> --id <container id> 
     
    -

    3.0.16. Delete entire group

    -
    +
     p2prc --rmgroup <group id>
     
    -

    3.0.17. Pulling plugin from a remote repo

    -
    +
     p2prc --pp <repo link>
     
    -

    3.0.18. Deleting plugin from the plugin directory

    -
    +
     p2prc --rp <plugin name> 
     
    -

    3.0.19. Added custom metadata about the current node

    -
    +
     p2prc --amd "custom metadata"
     
    - -
    -

    3.0.20. MapPort and link to domain name

    +
    +

    3.0.20. MapPort and link to domain name

    Allows to expose remote ports from a machine in the P2P network.

    -
    +
     p2prc --mp <port no to map> --dn <domain name to link Mapped port against>
     
      -
    1. MapPort in remote machine
      +
    2. MapPort in remote machine

      This is to ensure ports on remote machines on the P2PRC can be easily opened.

      -
      +
       p2prc --mp <port no to map> --dn <domain name to link Mapped port against> --ra <remote server address>
       
      @@ -561,7 +533,6 @@ p2prc --mp <port no to map> --dn <domain name to link Mapped port again
    -

    4. P2P Module Implementation

    @@ -574,7 +545,7 @@ servers with optimal performance, enhancing their overall network experience.

    -
    +

    p2pmoduleArch.png

    Figure 1: UML diagram of P2P module

    @@ -592,7 +563,6 @@ functions and structs. The sub topics below will mention the implementations of each functionality in depth.

    -

    4.1. IP Table

    @@ -632,7 +602,6 @@ configuration module.
    -

    4.1.1. Latency

    @@ -644,7 +613,6 @@ recorded.
    -

    4.2. NAT Traversal

    @@ -653,7 +621,6 @@ P2PRC currently supports TURN for NAT traversal.

    -

    4.3. TURN

    @@ -667,7 +634,6 @@ server to receive a port which is used to generate the external port from the TURN server. The flow below describes the workflow.

    -

    4.3.1. Client mode

    @@ -675,7 +641,7 @@ from the TURN server. The flow below describes the workflow.
  • Call /FRPPort
  • -
    +
     http://<turn server ip>:<server port no>/FRPport
     
    @@ -708,7 +674,6 @@ func main() { -

    5. Language Bindings

    @@ -720,7 +685,6 @@ Currently this is done by generating .so and .h from t compiler.

    -

    5.1. How to build shared object files

    @@ -735,7 +699,6 @@ make sharedObjects
    -
  • Or the direct way
    @@ -745,7 +708,6 @@ cd Bindings && go build -buildmode=c-shared -o p2prc.so
  • -
  • If successfully built:
    @@ -761,7 +723,6 @@ p2prc.h p2prc.so
  • -

    5.2. Workings under the hood

    @@ -769,7 +730,7 @@ p2prc.h p2prc.so Below are a sample set of commands to open the bindings implementation.

    -
    +
     # run
     cd Bindings/
     # list files
    @@ -778,7 +739,6 @@ ls
     Client.go
     
    -

    5.2.1. In Client go

    @@ -787,7 +747,6 @@ There a few things to notice which are different from your standard Go programs:

    -
    1. 1. We import "C" which means Cgo is required.
      @@ -797,7 +756,6 @@ programs:
    -
  • 2. All functions which are required to be called from other programming languages have comment such as.
    @@ -822,7 +780,6 @@ func StartContainer(IP string) (output *C.char) {
  • -
  • 3. While looking through the file (If 2 files are compared it is pretty trivial to notice a common structure).
    @@ -849,7 +806,6 @@ func ViewPlugin() (output *C.char) {
  • -
  • It is easy to notice that:
      @@ -860,10 +816,9 @@ that convert a go object to JSON string initially and converts it to
  • -
  • A Pseudo code to refer to the common function implementation shape could be represented as:
    -
    +
     func <Function name> (output *C.char) {
           <response>,<error> := <P2PRC function name>(<parameters if needed>)
           if <error> != nil {
    @@ -877,13 +832,12 @@ func <Function name> (output *C.char) {
     
     
  • -

    5.3. Current languages supported

    -
    -

    5.3.1. Python

    +
    +

    5.3.1. Python

      @@ -903,7 +857,7 @@ cd Bindings/python/export/ # list files ls # Expected output -SharedObjects/ p2prc.py +SharedObjects/ library.py requirements.txt
    @@ -920,9 +874,8 @@ called from other programming languages. - -
    -

    5.3.2. Haskell

    +
    +

    5.3.2. Haskell

    P2PRC officially supports Haskell bindings and will further support @@ -936,7 +889,6 @@ project using Haskell to build orchestrators on top of P2PRC.

    -

    6. Config Implementation

    @@ -976,7 +928,6 @@ configuration file was generated using JSON format.
    -

    7. Abstractions

    @@ -984,7 +935,6 @@ configuration file was generated using JSON format. The Abstractions package consists of black-boxed functions for P2PRC.

    -

    7.1. Functions

    @@ -1008,7 +958,6 @@ faster.
    -

    8. NAT Traversal

    @@ -1016,7 +965,6 @@ faster. P2PRC currently supports TURN for NAT traversal.

    -

    8.1. TURN

    @@ -1032,7 +980,6 @@ from the TURN server. The flow below describes the workflow.
    -

    9. Client mode

    @@ -1040,7 +987,7 @@ from the TURN server. The flow below describes the workflow.
  • Call /FRPPort
  • -
    +
     http://<turn server ip>:<server port no>/FRPport
     
    @@ -1071,16 +1018,12 @@ func main() {
    - - - - -
    -

    10. Blog posts

    +
    +

    10. Blog posts

    -
    -

    10.1. Self host within 5 minutes any program

    +
    +

    10.1. Self host within 5 minutes any program

    -
    +

    maxresdefault.jpg

    @@ -1102,9 +1045,8 @@ This is a fun expirement for anyone to try to quickly run a server and quickly do a map port and domain name mapping in a single command.

    - -
    -

    10.1.1. 1. Find a program you want to run

    +
    +

    10.1.1. 1. Find a program you want to run

    Let's try to setup a really easy program (Let's do with Linkwarden @@ -1112,36 +1054,38 @@ with docker compose :) ). This is under the assumption you have docker compose installed on your local machine.

    -
      -
    1. Let's run Linkwarden using docker compose and P2PRC
      +
    2. Let's run Linkwarden using docker compose and P2PRC

      Installation instructions:

      -
      -mkdir linkwarden && cd linkwarden
      +
      +
      mkdir linkwarden && cd linkwarden
       curl -O https://raw.githubusercontent.com/linkwarden/linkwarden/refs/heads/main/docker-compose.yml
       curl -L https://raw.githubusercontent.com/linkwarden/linkwarden/refs/heads/main/.env.sample -o ".env"
       
      +

      Environment configuration

      -
      -vim .env
      +
      +
      vim .env
       
       # Change values
       NEXTAUTH_URL=https://<DOMAIN NAME>/api/v1/auth
       NEXTAUTH_SECRET=VERY_SENSITIVE_SECRET
       POSTGRES_PASSWORD=CUSTOM_POSTGRES_PASSWORD
       
      +

      Run linkwarden!

      -
      -docker compose up
      +
      +
      docker compose up
       
      +

      If setup correctly linkwarden should @@ -1157,34 +1101,38 @@ Time to setup P2PRC

      Run p2prc as a background

      -
      -p2prc -s &
      +
      +
      p2prc -s &
       
      +

      Run map port and domain mapping

      -
      -p2prc --mp 3000 --dn <DOMAIN NAME>
      +
      +
      p2prc --mp 3000 --dn <DOMAIN NAME>
       
      +

      Sample response

      -
      - {
      +
      +
       {
               "IPAddress": "217.76.63.222",
               "PortNo": "61582",
               "EntireAddress": "217.76.63.222:61582"
       }
       
      +

      Add DNS entry

      -
      -A entry 217.76.63.222
      +
      +
      A entry 217.76.63.222
       
      +

      Your done now just head to the DOMAIN NAME you added. @@ -1196,27 +1144,16 @@ ex: https://linkwarden.akilan.io

    - - - - - - - - - - -
    -

    11. Ideas for future potencial features

    +
    +

    11. Ideas for future potencial features

    Consists of personal loideas for the future of P2PRC. At moment only has main contributors writiing to this.

    - -
    -

    11.1. To support hetrogenous set of Nodes that cannot run P2PRC

    +
    +

    11.1. To support hetrogenous set of Nodes that cannot run P2PRC

    This stems from a personal issue I have when doing research @@ -1232,9 +1169,8 @@ and would introduce a new layer fault tolerance within a local network nodes.

    - -
    -

    11.1.1. Assumptions:

    +
    +

    11.1.1. Assumptions:

    • I have a Morello board that cannot run P2PRC
    • @@ -1247,8 +1183,8 @@ as well look into custom tasks into the hetrogenous hardware.
    -
    -

    11.1.2. Set of interesting possible:

    +
    +

    11.1.2. Set of interesting possible:

    We build a cool set possibilities before and use this to build up the implementation @@ -1265,8 +1201,8 @@ weight hypervisors.

    -
    -

    11.1.3. Implementation

    +
    +

    11.1.3. Implementation

    • To use implementations similar to socat to ensure we can bind address of local @@ -1280,7 +1216,7 @@ other nodes can access the Morello board who have permission access.
    -
    +

    P2PRCRemoteNodes.png

    Figure 2: Implementation idea (To be improved upon)

    @@ -1292,8 +1228,8 @@ other nodes can access the Morello board who have permission access.

    Author: Akilan

    -

    Created: 2025-01-28 Tue 16:13

    +

    Created: 2025-04-25 Fri 22:23

    Validate

    - \ No newline at end of file + diff --git a/Docs/index.org b/Docs/index.org index ccd91c9..9ec1f46 100644 --- a/Docs/index.org +++ b/Docs/index.org @@ -3,6 +3,8 @@ #+HTML_HEAD: #+HTML_HEAD: +#+attr_html: :width 300px +[[../artwork/p2prc-logos/Colored-On-Light-Image.png]] * Introduction :PROPERTIES: