diff --git a/.DS_Store b/.DS_Store index 97c51a2..e938861 100644 Binary files a/.DS_Store and b/.DS_Store differ 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: