11 Commits

94 changed files with 438 additions and 1008 deletions

8
.gitignore vendored
View File

@@ -7,7 +7,9 @@ server/docker/__pycache__
p2p-rendering-computation p2p-rendering-computation
p2prc p2prc
config.json config.json
*.tgz
.vscode/ .vscode/
hosts
#ignore generated iptables *.retry
p2p/iptable/ **/*.swp
**/*.retry

1
CNAME
View File

@@ -1 +0,0 @@
p2prc.akilan.io

View File

@@ -2,11 +2,6 @@
Over here we will cover the basic steps to get the server and client side running. Over here we will cover the basic steps to get the server and client side running.
## Alpha release install
https://github.com/Akilan1999/p2p-rendering-computation/releases/tag/v1.0.0-alpha
## Install from Github master branch
### Install Go lang ### Install Go lang
The entire the implementation of this project is done using Go lang. The entire the implementation of this project is done using Go lang.
Thus, we need go lang to compile to code to a binary file. Thus, we need go lang to compile to code to a binary file.
@@ -21,8 +16,7 @@ interact with the containers.
[Instructions to install docker GPU](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker) [Instructions to install docker GPU](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker)
```` ````
// Do ensure that the docker command does not need sudo to run Do ensure that the docker command does not need sudo to run
sudo chmod 666 /var/run/docker.sock
```` ````
### Build Project and install project ### Build Project and install project
@@ -32,19 +26,6 @@ into a single binary
make install make install
``` ```
### Add appropriate paths to .bashrc
```
export P2PRC=/<PATH>/p2p-rendering-computation
export PATH=/<PATH>/p2p-rendering-computation:${PATH}
```
### Set up configuration file
```
make configfile
```
Open the config file ```config.json``` and add the IPv6 address
if you have one.
### Test if binary works ### Test if binary works
``` ```
p2prc --help p2prc --help
@@ -55,7 +36,7 @@ NAME:
p2p-rendering-computation - p2p cli application to create and access VMs in other servers p2p-rendering-computation - p2p cli application to create and access VMs in other servers
USAGE: USAGE:
p2prc [global options] command [command options] [arguments...] p2p-rendering-computation [global options] command [command options] [arguments...]
VERSION: VERSION:
1.0.0 1.0.0
@@ -64,72 +45,22 @@ COMMANDS:
help, h Shows a list of commands or help for one command help, h Shows a list of commands or help for one command
GLOBAL OPTIONS: GLOBAL OPTIONS:
--Server, -s Starts server (default: false) [$SERVER] --Mode value Specifies mode of running (default: "client") [$P2P_MODE]
--UpdateServerList, --us Update List of Server available based on servers iptables (default: false) [$UPDATE_SERVER_LIST] --UpdateServerList Update List of Server available based on servers iptables (default: false) [$UPDATE_SERVER_LIST]
--ListServers, --ls List servers which can render tasks (default: false) [$LIST_SERVERS] --ListServers List servers which can render tasks (default: false) [$LIST_SERVERS]
--AddServer value, --as value Adds server IP address to iptables [$ADD_SERVER] --CreateVM value Creates Docker container on the selected server [$CREATE_VM]
--ViewImages value, --vi value View images available on the server IP address [$VIEW_IMAGES] --RemoveVM value Stop and Remove Docker container [$REMOVE_VM]
--CreateVM value, --touch value Creates Docker container on the selected server [$CREATE_VM] --ID value Docker Container ID [$ID]
--ContainerName value, --cn value Specifying the container run on the server side [$CONTAINER_NAME] --Ports value Number of ports to open for the Docker Container [$NUM_PORTS]
--RemoveVM value, --rm value Stop and Remove Docker container [$REMOVE_VM] --GPU Create Docker Containers to access GPU (default: false) [$USE_GPU]
--ID value, --id value Docker Container ID [$ID] --Specs value Specs of the server node [$SPECS]
--Ports value, -p value Number of ports to open for the Docker Container [$NUM_PORTS] --SetDefaultConfig Sets a default configuration file (default: false) [$SET_DEFAULT_CONFIG]
--GPU, --gpu Create Docker Containers to access GPU (default: false) [$USE_GPU] --help, -h show help (default: false)
--Specification value, --specs value Specs of the server node [$SPECS] --version, -v print the version (default: false)
--SetDefaultConfig, --dc Sets a default configuration file (default: false) [$SET_DEFAULT_CONFIG]
--NetworkInterfaces, --ni Shows the network interface in your computer (default: false) [$NETWORK_INTERFACE]
--help, -h show help (default: false)
--version, -v print the version (default: false)
``` ```
<br>
--------------
<br>
# Using the Cli commands
### Start as a server
Do ensure you have docker installed for this
```
p2prc -s
```
### View server Speciafication
```
p2prc --specs=<ip address>
```
### Run container
use the ```--gpu``` if you know the other machine has a gpu.
```
p2prc --touch=<server ip address> -p <number of ports> --gpu
```
### Remove container
The docker id is present in the output where you create a container
```
p2prc --rm=<server ip address> --id=<docker container id>
```
### Adding servers to ip table
```
p2prc --as=<server ip address you want to add>
```
### Update ip table
```
p2prc --us
```
### List Servers
```
p2prc --ls
```
### View Network interfaces
```
p2prc --ni
```
#### Note: The steps on how to use the commands will be added later.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -1,16 +1,19 @@
SHELL := /bin/bash / https://www.youtube.com/channel/UCQdZltW7bh1ta-_nCH7LWYw/playlistSHELL := /bin/bash
install: install:
go build -o p2prc go build -o p2prc
echo '# Paths for p2p rendering and computation' echo '# Paths for p2p rendering and computation' >> ~/.bashrc
echo 'export P2PRC=${PWD}' echo 'export P2PRC=${PWD}' >> ~/.bashrc
echo 'export PATH=${PWD}:$${PATH}' echo 'export path=${PWD}:$${PATH}' >> ~/.bashrc
source ~/.bashrc
./p2prc --SetDefaultConfig
build: build:
go build -o p2prc go build -o p2prc
configfile: config:
./p2prc --SetDefaultConfig ./p2p-rendering-computation --SetDefaultConfig
run: run:
go run main.go go run main.go

View File

@@ -1,87 +1,13 @@
<h1 align="center"> # P2P rendering and computation
<br>
<a href=""><img src="https://raw.githubusercontent.com/Akilan1999/p2p-rendering-computation/master/Docs/images/p2prclogo.png" alt="p2prc" width="400"></a>
<br>
</h1>
[![IMAGE ALT TEXT](http://img.youtube.com/vi/LRv3NR2lu7I/0.jpg)](https://www.youtube.com/watch?v=LRv3NR2lu7I "Simple P2P Cli application for creating containers")
[![GPLv2 license](https://img.shields.io/badge/License-GPLv2-blue.svg)](http://perso.crans.org/besson/LICENSE.html)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Akilan1999/p2p-rendering-computation/graphs/commit-activity)
[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org)
[![GoDoc reference example](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/git.sr.ht/~akilan1999/p2p-rendering-computation)
The main aim of this project was to create a custom peer to peer network. The user acting as the The main aim of this project was to create a custom peer to peer network. The user acting as the
client has total flexibility on how to batch the tasks and the user acting as the server has complete client has total flexibility on how to batch the tasks and the user acting as the server has complete
flexibility on tracking the container's usages and killing the containers at any point of time. flexibility on tracking the container's usages and killing the containers at any point of time.
## Demo 1. [Installation](Docs/Installation.md)
[![IMAGE ALT TEXT](http://img.youtube.com/vi/LRv3NR2lu7I/0.jpg)](https://www.youtube.com/watch?v=LRv3NR2lu7I "Simple P2P Cli application for creating containers") 2. [Documentation](Docs/README.md)
<br>
## Table of contents
1. [Introduction](#Introduction)
2. [Installation](#Installation.md)
3. [Design Architecture](#Design-Architecture)
4. [Implementation](#Implementation)
5. [Find out more](#Find-out-more)
<br>
## Introduction
This project aims to create a peer to peer (p2p) network, where a user can use the p2p network to act as a client (i.e sending tasks) or the server (i.e executing the tasks). A prototype application will be developed, which comes bundled with a p2p module and possible to execute docker containers or virtual environments across selected nodes.
### Objectives
- Background review on peer to peer network, virtual environments, decentralized rendering tools and tools to batch any sort of tasks.
- Creating p2p network
- Server to create a containerised environment
- The client node to run tasks on Server containerised node
[Read more on the introduction](Docs/Introduction.md)
<br>
## Installation
1. Ensure the Go compiler is installed
2. Ensure docker is installed
3. Clone this repository
```
git clone https://github.com/Akilan1999/p2p-rendering-computation
```
4. Install and build the project
```
make install
```
5. Test if it works
```
p2prc -h
```
or
```
./p2prc -h
```
[Read more on the installation](Docs/Installation.md)
<br>
## Design Architecture
The design architecture was inspired and based on the linux kernel design. The project is segmented into various modules. Each module is responsible for certain tasks in the project. The modules are highly dependent on each other hence the entire codebase can be considered as a huge monolithic chuck which acts as its own library
[Read more on the Design Architecture](Docs/DesignArchtectureIntro.md)
<br>
## Implementation
The programming language used for this project was Golang. The reason Go lang was chosen was because it is a compiled language. The entire codebase is just a single binary file. When distributing to other linux distributing the only requirement would be the binary file to run the code. It is easy to write independant modules and be monolithic at the sametime using Go. Using Go.mod makes it very easy to handle external libraries and modularise code. The go.mod name for the project is git.sr.ht/~akilan1999/p2p-rendering-computation.
[Read more on the Implementation](Docs/Implementation.md)
<br>
## Find out more
As we are working on the open source project p2prc (i.e p2p network designed for computation).If you are interested in participating as a contributor
or just providing feedback on new features to build or even just curious about new features added to the project. We have decided to create a discord group.
Group:
https://discord.gg/b4nRGTjYqy

View File

@@ -12,6 +12,10 @@ import (
"os" "os"
) )
type IP struct {
Query string
}
// UpdateIpTable Does the following to update it's IP table // UpdateIpTable Does the following to update it's IP table
func UpdateIpTable(IpAddress string) error { func UpdateIpTable(IpAddress string) error {
@@ -22,23 +26,10 @@ func UpdateIpTable(IpAddress string) error {
client := http.Client{} client := http.Client{}
var resp []byte resp, err := UploadMultipartFile(client,"http://"+IpAddress+":8088/IpTable","json",config.IPTable)
version := p2p.Ip4or6(IpAddress) if err != nil {
if version == "version 6" {
resp, err = UploadMultipartFile(client,"http://["+IpAddress+"]:8088/IpTable","json",config.IPTable)
if err != nil {
return err return err
}
} else {
resp, err = UploadMultipartFile(client,"http://"+IpAddress+":8088/IpTable","json",config.IPTable)
if err != nil {
return err
}
}
if resp == nil {
return nil
} }
//resp, err := SendPostRequest("http://"+IpAddress+":8088/IpTable", //resp, err := SendPostRequest("http://"+IpAddress+":8088/IpTable",
@@ -68,7 +59,6 @@ func UpdateIpTable(IpAddress string) error {
// UpdateIpTableListClient updates IP tables (Default 3 hops) based on server information available // UpdateIpTableListClient updates IP tables (Default 3 hops) based on server information available
//on the ip tables //on the ip tables
func UpdateIpTableListClient() error { func UpdateIpTableListClient() error {
// Ensure that the IP Table has Node pingable // Ensure that the IP Table has Node pingable
err := p2p.LocalSpeedTestIpTable() err := p2p.LocalSpeedTestIpTable()
if err != nil { if err != nil {
@@ -79,55 +69,61 @@ func UpdateIpTableListClient() error {
// duplication // duplication
Addresses, err := p2p.ReadIpTable() Addresses, err := p2p.ReadIpTable()
//var DoNotRead p2p.IpAddresses var DoNotRead p2p.IpAddresses
// Run loop 3 times // Run loop 3 times
for i := 0; i < 3; i++ { for i := 0; i < 3; i++ {
// Gets information from IP table // Gets information from IP table
//Addresses, err = p2p.ReadIpTable() Addresses, err = p2p.ReadIpTable()
//if err != nil { if err != nil {
// return err return err
//} }
//
//DoNotRead.IpAddress = append(DoNotRead.IpAddress, PublicIP) // Appending current machine public IP address as should not be there in IP Table
var PublicIP p2p.IpAddress
ip, err := CurrentPublicIP()
if err != nil {
return err
}
PublicIP.Ipv4 = ip
DoNotRead.IpAddress = append(DoNotRead.IpAddress, PublicIP)
// Updates IP table based on server IP table // Updates IP table based on server IP table
for j := range Addresses.IpAddress { for j := range Addresses.IpAddress {
//Exists := false Exists := false
//
//if PublicIP.Ipv4 == Addresses.IpAddress[j].Ipv4 || (PublicIP.Ipv6 != "" && Addresses.IpAddress[j].Ipv6 == PublicIP.Ipv6){
// Exists = true
//}
//
//// Check if IP addresses is there in the struct DoNotRead
//for k := range DoNotRead.IpAddress {
// if DoNotRead.IpAddress[k].Ipv4 == Addresses.IpAddress[j].Ipv4 || (DoNotRead.IpAddress[k].Ipv6 != "" && Addresses.IpAddress[j].Ipv6 == DoNotRead.IpAddress[k].Ipv6) {
// Exists = true
// break
// }
//}
//
//// If the struct exists then continues
//if Exists {
// continue
//}
if Addresses.IpAddress[j].Ipv6 != "" { if PublicIP.Ipv4 == Addresses.IpAddress[j].Ipv4 {
err = UpdateIpTable(Addresses.IpAddress[j].Ipv6) Exists = true
} else {
err = UpdateIpTable(Addresses.IpAddress[j].Ipv4)
} }
// Check if IP addresses is there in the struct DoNotRead
for k := range DoNotRead.IpAddress {
if DoNotRead.IpAddress[k].Ipv4 == Addresses.IpAddress[j].Ipv4 {
Exists = true
break
}
}
// If the struct exists then continues
if Exists {
continue
}
err = UpdateIpTable(Addresses.IpAddress[j].Ipv4)
if err != nil { if err != nil {
return err return err
} }
//Appends server1 IP address to variable DoNotRead //Appends server1 IP address to variable DoNotRead
//DoNotRead.IpAddress = append(DoNotRead.IpAddress, Addresses.IpAddress[j]) DoNotRead.IpAddress = append(DoNotRead.IpAddress, Addresses.IpAddress[j])
} }
} }
// Removing duplicates in the IP table
if err := p2p.RemoveDuplicates(); err != nil {
return err
}
return nil return nil
} }
@@ -220,10 +216,6 @@ func UploadMultipartFile(client http.Client, uri, key, path string) ([]byte, err
}() }()
resp, err := client.Do(req) resp, err := client.Do(req)
if err != nil {
return nil, err
}
content, err := ioutil.ReadAll(resp.Body) content, err := ioutil.ReadAll(resp.Body)
if err != nil { if err != nil {
@@ -234,3 +226,21 @@ func UploadMultipartFile(client http.Client, uri, key, path string) ([]byte, err
} }
// CurrentPublicIP Get Current Public IP address
func CurrentPublicIP() (string,error) {
req, err := http.Get("http://ip-api.com/json/")
if err != nil {
return "",err
}
defer req.Body.Close()
body, err := ioutil.ReadAll(req.Body)
if err != nil {
return "",err
}
var ip IP
json.Unmarshal(body, &ip)
return ip.Query, nil
}

View File

@@ -3,7 +3,6 @@ package client
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"git.sr.ht/~akilan1999/p2p-rendering-computation/p2p"
"git.sr.ht/~akilan1999/p2p-rendering-computation/server" "git.sr.ht/~akilan1999/p2p-rendering-computation/server"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@@ -13,13 +12,7 @@ import (
// and other basic information which helps set a // and other basic information which helps set a
// cluster of computer // cluster of computer
func GetSpecs(IP string)(*server.SysInfo,error) { func GetSpecs(IP string)(*server.SysInfo,error) {
var URL string URL := "http://" + IP + ":" + serverPort + "/server_info"
version := p2p.Ip4or6(IP)
if version == "version 6" {
URL = "http://[" + IP + "]:" + serverPort + "/server_info"
} else {
URL = "http://" + IP + ":" + serverPort + "/server_info"
}
resp, err := http.Get(URL) resp, err := http.Get(URL)
if err != nil { if err != nil {
return nil,err return nil,err

View File

@@ -3,7 +3,6 @@ package client
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"git.sr.ht/~akilan1999/p2p-rendering-computation/p2p"
"git.sr.ht/~akilan1999/p2p-rendering-computation/server/docker" "git.sr.ht/~akilan1999/p2p-rendering-computation/server/docker"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@@ -20,17 +19,9 @@ var client = http.Client{}
// StartContainer Start container using REST api Implementation // StartContainer Start container using REST api Implementation
// From the selected server IP address // From the selected server IP address
// TODO: Test cases for this function // TODO: Test cases for this function
//Calls URL ex: http://0.0.0.0:8088/startcontainer?ports=0&GPU=false&ContainerName=docker-ubuntu-sshd func StartContainer(IP string, NumPorts int, GPU bool) (*docker.DockerVM ,error) {
func StartContainer(IP string, NumPorts int, GPU bool, ContainerName string) (*docker.DockerVM ,error) {
// Passes URL with number of TCP ports to allocated and to give GPU access to the docker container // Passes URL with number of TCP ports to allocated and to give GPU access to the docker container
var URL string URL := "http://" + IP + ":" + serverPort + "/startcontainer?ports=" + fmt.Sprint(NumPorts) + "&GPU=" + strconv.FormatBool(GPU)
version := p2p.Ip4or6(IP)
if version == "version 6" {
URL = "http://[" + IP + "]:" + serverPort + "/startcontainer?ports=" + fmt.Sprint(NumPorts) + "&GPU=" + strconv.FormatBool(GPU) + "&ContainerName=" + ContainerName
} else {
URL = "http://" + IP + ":" + serverPort + "/startcontainer?ports=" + fmt.Sprint(NumPorts) + "&GPU=" + strconv.FormatBool(GPU) + "&ContainerName=" + ContainerName
}
resp, err := http.Get(URL) resp, err := http.Get(URL)
if err != nil { if err != nil {
return nil,err return nil,err
@@ -56,13 +47,7 @@ func StartContainer(IP string, NumPorts int, GPU bool, ContainerName string) (*d
// RemoveContianer Stops and removes container from the server // RemoveContianer Stops and removes container from the server
func RemoveContianer(IP string,ID string) error { func RemoveContianer(IP string,ID string) error {
var URL string URL := "http://" + IP + ":" + serverPort + "/RemoveContainer?id=" + ID
version := p2p.Ip4or6(IP)
if version == "version 6" {
URL = "http://[" + IP + "]:" + serverPort + "/RemoveContainer?id=" + ID
} else {
URL = "http://" + IP + ":" + serverPort + "/RemoveContainer?id=" + ID
}
resp, err := http.Get(URL) resp, err := http.Get(URL)
if err != nil { if err != nil {
return err return err
@@ -80,39 +65,6 @@ func RemoveContianer(IP string,ID string) error {
return nil return nil
} }
// ViewContainers This function displays all containers available on server side
func ViewContainers(IP string)(*docker.DockerContainers, error){
// Passes URL with route /ShowImages
var URL string
version := p2p.Ip4or6(IP)
if version == "version 6" {
URL = "http://[" + IP + "]:" + serverPort + "/ShowImages"
} else {
URL = "http://" + IP + ":" + serverPort + "/ShowImages"
}
resp, err := http.Get(URL)
if err != nil {
return nil,err
}
// Convert response to byte value
byteValue, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil,err
}
// Create variable for result response type
var Result docker.DockerContainers
// Adds byte value to docker.DockerContainers struct
json.Unmarshal(byteValue, &Result)
if err != nil {
return nil,err
}
return &Result, nil
}
// PrintStartContainer Prints results Generated container // PrintStartContainer Prints results Generated container
func PrintStartContainer(d *docker.DockerVM){ func PrintStartContainer(d *docker.DockerVM){
fmt.Println("ID : " + fmt.Sprint(d.ID)) fmt.Println("ID : " + fmt.Sprint(d.ID))

View File

@@ -1,8 +1,6 @@
package client package client
import ( import "testing"
"testing"
)
func TestUpdateIpTableListClient(t *testing.T) { func TestUpdateIpTableListClient(t *testing.T) {
err := UpdateIpTableListClient() err := UpdateIpTableListClient()
@@ -10,5 +8,4 @@ func TestUpdateIpTableListClient(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
} }

View File

@@ -10,7 +10,7 @@ import (
) )
var CliAction = func(ctx *cli.Context) error { var CliAction = func(ctx *cli.Context) error {
if Server { if Mode == "server" {
// TODO: with RPC calls // TODO: with RPC calls
server.Server() server.Server()
//server.Rpc() //server.Rpc()
@@ -26,49 +26,10 @@ var CliAction = func(ctx *cli.Context) error {
p2p.PrintIpTable() p2p.PrintIpTable()
} }
// Displays the IP table
if ServerList { if ServerList {
p2p.PrintIpTable() p2p.PrintIpTable()
} }
// Add provided IP to the IP table
if AddServer != "" {
res, err := p2p.ReadIpTable()
if err != nil {
fmt.Println(err)
}
//Create variable of type IpAddress and set IP address
// to it
var IpAddr p2p.IpAddress
//Checking if the address is a ipv4
// or ipv6 address
ip4Orip6 := p2p.Ip4or6(AddServer)
if ip4Orip6 == "version 6" {
IpAddr.Ipv6 = AddServer
} else {
IpAddr.Ipv4 = AddServer
}
// Append IP address to variable result which
// is a list
res.IpAddress = append(res.IpAddress, IpAddr)
// Adds the new server IP to the iptable
res.WriteIpTable()
}
// Displays all images available on the server side
if ViewImages != "" {
imageRes, err := client.ViewContainers(ViewImages)
if err != nil {
fmt.Print(err)
}
client.PrettyPrint(imageRes)
}
// Function called to stop and remove server from Docker // Function called to stop and remove server from Docker
if RemoveVM != "" && ID != "" { if RemoveVM != "" && ID != "" {
err := client.RemoveContianer(RemoveVM,ID) err := client.RemoveContianer(RemoveVM,ID)
@@ -87,8 +48,7 @@ var CliAction = func(ctx *cli.Context) error {
fmt.Sscanf(Ports, "%d", &PortsInt) fmt.Sscanf(Ports, "%d", &PortsInt)
} }
// Calls function to do Api call to start the container on the server side imageRes, err := client.StartContainer(CreateVM,PortsInt,GPU)
imageRes, err := client.StartContainer(CreateVM,PortsInt,GPU,ContainerName)
if err != nil { if err != nil {
fmt.Print(err) fmt.Print(err)
@@ -115,15 +75,6 @@ var CliAction = func(ctx *cli.Context) error {
} }
} }
//If the network interface flag is called
// Then all the network interfaces are displayed
if NetworkInterface {
err := p2p.ViewNetworkInterface()
if err != nil {
fmt.Print(err)
}
}
return nil return nil
} }

View File

@@ -6,12 +6,9 @@ import (
// Variables declared for CLI // Variables declared for CLI
var ( var (
AddServer string
ViewImages string
CreateVM string CreateVM string
ContainerName string
Ports string Ports string
Server bool Mode string
RemoveVM string RemoveVM string
ID string ID string
Specs string Specs string
@@ -19,107 +16,69 @@ var (
UpdateServerList bool UpdateServerList bool
ServerList bool ServerList bool
SetDefaultConfig bool SetDefaultConfig bool
NetworkInterface bool
) )
var AppConfigFlags = []cli.Flag{ var AppConfigFlags = []cli.Flag{
// Deprecated to be implemented using GRPC // Deprecated to be implemented using GRPC
&cli.BoolFlag{ &cli.StringFlag{
Name: "Server", Name: "Mode",
Aliases: []string{"s"}, Value: "client",
Usage: "Starts server", Usage: "Specifies mode of running",
EnvVars: []string{"SERVER"}, EnvVars: []string{"P2P_MODE"},
Destination: &Server, Destination: &Mode,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "UpdateServerList", Name: "UpdateServerList",
Aliases: []string{"us"},
Usage: "Update List of Server available based on servers iptables", Usage: "Update List of Server available based on servers iptables",
EnvVars: []string{"UPDATE_SERVER_LIST"}, EnvVars: []string{"UPDATE_SERVER_LIST"},
Destination: &UpdateServerList, Destination: &UpdateServerList,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "ListServers", Name: "ListServers",
Aliases: []string{"ls"},
Usage: "List servers which can render tasks", Usage: "List servers which can render tasks",
EnvVars: []string{"LIST_SERVERS"}, EnvVars: []string{"LIST_SERVERS"},
Destination: &ServerList, Destination: &ServerList,
}, },
&cli.StringFlag{
Name: "AddServer",
Aliases: []string{"as"},
Usage: "Adds server IP address to iptables",
EnvVars: []string{"ADD_SERVER"},
Destination: &AddServer,
},
&cli.StringFlag{
Name: "ViewImages",
Aliases: []string{"vi"},
Usage: "View images available on the server IP address",
EnvVars: []string{"VIEW_IMAGES"},
Destination: &ViewImages,
},
&cli.StringFlag{ &cli.StringFlag{
Name: "CreateVM", Name: "CreateVM",
Aliases: []string{"touch"},
Usage: "Creates Docker container on the selected server", Usage: "Creates Docker container on the selected server",
EnvVars: []string{"CREATE_VM"}, EnvVars: []string{"CREATE_VM"},
Destination: &CreateVM, Destination: &CreateVM,
}, },
&cli.StringFlag{
Name: "ContainerName",
Aliases: []string{"cn"},
Usage: "Specifying the container run on the server side",
EnvVars: []string{"CONTAINER_NAME"},
Destination: &ContainerName,
},
&cli.StringFlag{ &cli.StringFlag{
Name: "RemoveVM", Name: "RemoveVM",
Aliases: []string{"rm"},
Usage: "Stop and Remove Docker container", Usage: "Stop and Remove Docker container",
EnvVars: []string{"REMOVE_VM"}, EnvVars: []string{"REMOVE_VM"},
Destination: &RemoveVM, Destination: &RemoveVM,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "ID", Name: "ID",
Aliases: []string{"id"},
Usage: "Docker Container ID", Usage: "Docker Container ID",
EnvVars: []string{"ID"}, EnvVars: []string{"ID"},
Destination: &ID, Destination: &ID,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "Ports", Name: "Ports",
Aliases: []string{"p"},
Usage: "Number of ports to open for the Docker Container", Usage: "Number of ports to open for the Docker Container",
EnvVars: []string{"NUM_PORTS"}, EnvVars: []string{"NUM_PORTS"},
Destination: &Ports, Destination: &Ports,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "GPU", Name: "GPU",
Aliases: []string{"gpu"},
Usage: "Create Docker Containers to access GPU", Usage: "Create Docker Containers to access GPU",
EnvVars: []string{"USE_GPU"}, EnvVars: []string{"USE_GPU"},
Destination: &GPU, Destination: &GPU,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "Specification", Name: "Specs",
Aliases: []string{"specs"},
Usage: "Specs of the server node", Usage: "Specs of the server node",
EnvVars: []string{"SPECS"}, EnvVars: []string{"SPECS"},
Destination: &Specs, Destination: &Specs,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "SetDefaultConfig", Name: "SetDefaultConfig",
Aliases: []string{"dc"},
Usage: "Sets a default configuration file", Usage: "Sets a default configuration file",
EnvVars: []string{"SET_DEFAULT_CONFIG"}, EnvVars: []string{"SET_DEFAULT_CONFIG"},
Destination: &SetDefaultConfig, Destination: &SetDefaultConfig,
}, },
&cli.BoolFlag{
Name: "NetworkInterfaces",
Aliases: []string{"ni"},
Usage: "Shows the network interface in your computer",
EnvVars: []string{"NETWORK_INTERFACE"},
Destination: &NetworkInterface,
},
} }

View File

@@ -2,7 +2,6 @@ package config
import ( import (
"github.com/spf13/viper" "github.com/spf13/viper"
"io"
"os" "os"
) )
@@ -10,8 +9,7 @@ var (
defaultPath string defaultPath string
defaults = map[string]interface{}{ defaults = map[string]interface{}{
"IPTable": "/etc/p2p-rendering/ip_table.json", "IPTable": "/etc/p2p-rendering/ip_table.json",
"DockerContainers": "/home/akilan/Documents/p2prendering/p2p-redering-computation/server/docker/containers/", "DockerFile": "/home/akilan/Documents/p2prendering/p2p-redering-computation/server/docker/containers/docker-ubuntu-sshd/",
"DefaultDockerFile": "/home/akilan/Documents/p2prendering/p2p-redering-computation/server/docker/containers/docker-ubuntu-sshd/",
"SpeedTestFile":"/etc/p2p-rendering/50.bin", "SpeedTestFile":"/etc/p2p-rendering/50.bin",
} }
configName = "config" configName = "config"
@@ -21,13 +19,9 @@ var (
) )
type Config struct { type Config struct {
IPTable string IPTable string
DockerContainers string DockerFile string
DefaultDockerFile string SpeedTestFile string
SpeedTestFile string
IPV6Address string
//NetworkInterface string
//NetworkInterfaceIPV6Index int
} }
// Exists reports whether the named file or directory exists. // Exists reports whether the named file or directory exists.
@@ -40,30 +34,6 @@ func fileExists(name string) bool {
return true return true
} }
// Copy the src file to dst. Any existing file will be overwritten and will not
// copy file attributes.
// Source: https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file
func Copy(src, dst string) error {
in, err := os.Open(src)
if err != nil {
return err
}
defer in.Close()
out, err := os.Create(dst)
if err != nil {
return err
}
defer out.Close()
_, err = io.Copy(out, in)
if err != nil {
return err
}
return out.Close()
}
// SetDefaults This function to be called only during a // SetDefaults This function to be called only during a
// make install // make install
func SetDefaults() error { func SetDefaults() error {
@@ -73,21 +43,10 @@ func SetDefaults() error {
//Setting current directory to default path //Setting current directory to default path
defaultPath = curDir + "/" defaultPath = curDir + "/"
//Create ip_table.json in the json directory
err := Copy("p2p/ip_table.json","p2p/iptable/ip_table.json")
if err != nil {
return err
}
//Setting default paths for the config file //Setting default paths for the config file
defaults["IPTable"] = defaultPath + "p2p/iptable/ip_table.json" defaults["IPTable"] = defaultPath + "p2p/ip_table.json"
defaults["DefaultDockerFile"] = defaultPath + "server/docker/containers/docker-ubuntu-sshd/" defaults["DockerFile"] = defaultPath + "server/docker/containers/docker-ubuntu-sshd/"
defaults["DockerContainers"] = defaultPath + "server/docker/containers/"
defaults["SpeedTestFile"] = defaultPath + "p2p/50.bin" defaults["SpeedTestFile"] = defaultPath + "p2p/50.bin"
defaults["IPV6Address"] = ""
//defaults["NetworkInterface"] = "wlp0s20f3"
//defaults["NetworkInterfaceIPV6Index"] = "2"
//Paths to search for config file //Paths to search for config file
configPaths = append(configPaths, defaultPath) configPaths = append(configPaths, defaultPath)
@@ -100,7 +59,7 @@ func SetDefaults() error {
} }
//Calling configuration file //Calling configuration file
_, err = ConfigInit() _, err := ConfigInit()
if err != nil { if err != nil {
return err return err
} }

View File

@@ -13,5 +13,7 @@ general:
- software-properties-common=0.96.24.32.7 # known good with 0.96.24.32.7 - software-properties-common=0.96.24.32.7 # known good with 0.96.24.32.7
- git - git
- golang - golang
- g++
- openjdk-8-jdk
pip: pip:
- docker>=3.7.0 # known good with 3.7.0 - docker>=3.7.0 # known good with 3.7.0

2
go.mod
View File

@@ -13,6 +13,7 @@ require (
github.com/google/go-cmp v0.5.4 // indirect github.com/google/go-cmp v0.5.4 // indirect
github.com/google/uuid v1.1.2 github.com/google/uuid v1.1.2
github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/mux v1.8.0 // indirect
github.com/grandcat/zeroconf v1.0.0 // indirect
github.com/lithammer/shortuuid v3.0.0+incompatible github.com/lithammer/shortuuid v3.0.0+incompatible
github.com/moby/sys/mount v0.2.0 // indirect github.com/moby/sys/mount v0.2.0 // indirect
github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf // indirect github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf // indirect
@@ -28,6 +29,7 @@ require (
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 // indirect golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 // indirect
golang.org/x/text v0.3.5 // indirect golang.org/x/text v0.3.5 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect
google.golang.org/grpc v1.35.0 // indirect google.golang.org/grpc v1.35.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
gotest.tools/v3 v3.0.3 // indirect gotest.tools/v3 v3.0.3 // indirect

28
go.sum
View File

@@ -35,13 +35,13 @@ github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935
github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3 h1:mw6pDQqv38/WGF1cO/jF5t/jyAJ2yi7CmtFLLO5tGFI= github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3 h1:mw6pDQqv38/WGF1cO/jF5t/jyAJ2yi7CmtFLLO5tGFI=
github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
@@ -83,6 +83,8 @@ github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -160,6 +162,7 @@ github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -285,6 +288,7 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
@@ -323,6 +327,8 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grandcat/zeroconf v1.0.0 h1:uHhahLBKqwWBV6WZUDAT71044vwOTL+McW0mBJvo6kE=
github.com/grandcat/zeroconf v1.0.0/go.mod h1:lTKmG1zh86XyCoUeIHSA4FJMBwCJiQmGfcP2PdzytEs=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
@@ -349,6 +355,7 @@ github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -365,10 +372,12 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@@ -390,6 +399,8 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp
github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
@@ -403,9 +414,11 @@ github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGq
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf h1:Un6PNx5oMK6CCwO3QTUyPiK2mtZnPrpDl5UnZ64eCkw= github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf h1:Un6PNx5oMK6CCwO3QTUyPiK2mtZnPrpDl5UnZ64eCkw=
github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
@@ -439,6 +452,7 @@ github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJGY8Y=
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
@@ -544,6 +558,7 @@ github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRci
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@@ -607,6 +622,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -660,6 +676,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -686,6 +703,7 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -712,6 +730,7 @@ golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -740,6 +759,7 @@ golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -751,6 +771,7 @@ golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fq
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
@@ -787,6 +808,7 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
@@ -798,6 +820,7 @@ golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -841,6 +864,7 @@ google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8=
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
@@ -874,6 +898,7 @@ gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -893,6 +918,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

View File

@@ -1,47 +0,0 @@
<html>
<head>
<title>P2PRC</title>
<style>
body { font-family: sans-serif; }
</style>
</head>
<body>
<img src="Docs/images/p2prclogo.png" alt="P2PRC">
<h1>P2PRC</h1>
<b>A peer to peer network designed for computation</b>
<p>P2PRC is peer to peer to network designed for computation reasons.</p>
<p>This project was developed during my 4th year dissertation at Heriot-Watt university and We are getting the
project to a usable state. </p>
<p> It's purpose is for people to use each others computers rather than servers such as AWS and Azure. </p>
<p><b>Project:</b></p>
<ul>
<li><a href="https://github.com/Akilan1999/p2p-rendering-computation">P2PRC on GitHub</a></li>
<li><a href="https://discord.gg/b4nRGTjYqy">P2PRC Discord Server</a> <font color="red">(join here to chat!)</font></li>
</ul>
<p><b>Community Server to download public network</b></p>
<ul>
<li>
<b>IP Address: 172.104.44.195</a></b>
<p>Use this server to only download part of the p2p network</p>
</li>
</ul>
<p><b>Main developer:</b></p>
<ul>
<li>
<b><a href="https://akilan.io">Akilan Selvacoumar</a></b>
</li>
</ul>
<p><b>Other links:</b></p>
<ul>
<li><a href="https://www.youtube.com/channel/UChy18QB1hBzZ7MniIW_FJvQ">Akilan Selvacoumar on YouTube</a></li>
</ul>
</body></html>

View File

@@ -1,11 +1,3 @@
{ {
"ip_address": [ "ip_address": null
{
"ipv4": "172.104.44.195",
"ipv6": "",
"latency": 0,
"download": 0,
"upload": 0
}
]
} }

View File

@@ -5,8 +5,6 @@ import (
"fmt" "fmt"
"git.sr.ht/~akilan1999/p2p-rendering-computation/config" "git.sr.ht/~akilan1999/p2p-rendering-computation/config"
"io/ioutil" "io/ioutil"
"net"
"net/http"
"os" "os"
"time" "time"
) )
@@ -19,16 +17,11 @@ type IpAddresses struct {
type IpAddress struct { type IpAddress struct {
Ipv4 string `json:"ipv4"` Ipv4 string `json:"ipv4"`
Ipv6 string `json:"ipv6"`
Latency time.Duration `json:"latency"` Latency time.Duration `json:"latency"`
Download float64 `json:"download"` Download float64 `json:"download"`
Upload float64 `json:"upload"` Upload float64 `json:"upload"`
} }
type IP struct {
Query string
}
// ReadIpTable Read data from Ip tables from json file // ReadIpTable Read data from Ip tables from json file
func ReadIpTable()(*IpAddresses ,error){ func ReadIpTable()(*IpAddresses ,error){
// Get Path from config // Get Path from config
@@ -56,38 +49,11 @@ func ReadIpTable()(*IpAddresses ,error){
// jsonFile's content into 'users' which we defined above // jsonFile's content into 'users' which we defined above
json.Unmarshal(byteValue, &ipAddresses) json.Unmarshal(byteValue, &ipAddresses)
var PublicIP IpAddress
ipv6, err := GetCurrentIPV6()
if err != nil {
return nil, err
}
ip, err := CurrentPublicIP()
if err != nil {
return nil, err
}
PublicIP.Ipv4 = ip
PublicIP.Ipv6 = ipv6
// Updates current machine IP address to the IP table
ipAddresses.IpAddress = append(ipAddresses.IpAddress, PublicIP)
//before writing to iptable ensures the duplicates are removed
if err = ipAddresses.RemoveDuplicates(); err != nil {
return nil, err
}
return &ipAddresses, nil return &ipAddresses, nil
} }
// WriteIpTable Write to IP table json file // WriteIpTable Write to IP table json file
func (i *IpAddresses) WriteIpTable() error { func (i *IpAddresses) WriteIpTable() error {
//before writing to iptable ensures the duplicates are removed
if err := i.RemoveDuplicates(); err != nil {
return err
}
file, err := json.MarshalIndent(i, "", " ") file, err := json.MarshalIndent(i, "", " ")
if err != nil { if err != nil {
return err return err
@@ -116,8 +82,8 @@ func PrintIpTable() error {
} }
for i := 0; i < len(table.IpAddress); i++ { for i := 0; i < len(table.IpAddress); i++ {
fmt.Printf("\nIP Address: %s\nIPV6: %s\nLatency: %s\n-----------" + fmt.Printf("\nIP Address: %s\nLatency: %s\n-----------" +
"-----------------\n",table.IpAddress[i].Ipv4,table.IpAddress[i].Ipv6, "-----------------\n",table.IpAddress[i].Ipv4,
table.IpAddress[i].Latency) table.IpAddress[i].Latency)
} }
return nil return nil
@@ -125,111 +91,31 @@ func PrintIpTable() error {
// RemoveDuplicates This is a temporary fix current functions failing to remove // RemoveDuplicates This is a temporary fix current functions failing to remove
// Duplicate IP addresses from local IP table // Duplicate IP addresses from local IP table
func (table *IpAddresses)RemoveDuplicates() error { func RemoveDuplicates() error {
table, err := ReadIpTable()
if err != nil {
return err
}
var NoDuplicates IpAddresses var NoDuplicates IpAddresses
for i, _:= range table.IpAddress { for i, _:= range table.IpAddress {
Exists := false Exists := false
for k := range NoDuplicates.IpAddress { for k := range NoDuplicates.IpAddress {
if (NoDuplicates.IpAddress[k].Ipv4 != "" && NoDuplicates.IpAddress[k].Ipv4 == table.IpAddress[i].Ipv4) || (NoDuplicates.IpAddress[k].Ipv6 != "" && NoDuplicates.IpAddress[k].Ipv6 == table.IpAddress[i].Ipv6) { if NoDuplicates.IpAddress[k].Ipv4 == table.IpAddress[i].Ipv4 {
Exists = true Exists = true
break break
} }
} }
if Exists { if Exists {
continue continue
} }
NoDuplicates.IpAddress = append(NoDuplicates.IpAddress, table.IpAddress[i]) NoDuplicates.IpAddress = append(NoDuplicates.IpAddress, table.IpAddress[i])
} }
table.IpAddress = NoDuplicates.IpAddress if err := NoDuplicates.WriteIpTable(); err != nil {
return nil
}
return nil return nil
}
// CurrentPublicIP Get Current Public IP address
func CurrentPublicIP() (string,error) {
req, err := http.Get("http://ip-api.com/json/")
if err != nil {
return "",err
}
defer req.Body.Close()
body, err := ioutil.ReadAll(req.Body)
if err != nil {
return "",err
}
var ip IP
json.Unmarshal(body, &ip)
return ip.Query, nil
}
// GetCurrentIPV6 gets the current IPV6 address based on the interface
// specified in the config file
func GetCurrentIPV6()(string,error){
Config, err := config.ConfigInit()
if err != nil {
return "",err
}
// Fix in future release
//byNameInterface, err := net.InterfaceByName(Config.NetworkInterface)
//if err != nil {
// return "",err
//}
//addresses, err := byNameInterface.Addrs()
//if err != nil {
// return "",err
//}
//if addresses[1].String() == "" {
// return "",errors.New("IPV6 address not detected")
//}
//IP,_,err := net.ParseCIDR(addresses[Config.NetworkInterfaceIPV6Index].String())
//if err != nil {
// return "",err
//}
return Config.IPV6Address, nil
}
// ViewNetworkInterface This function is created to view the network interfaces available
func ViewNetworkInterface() error {
ifaces, err := net.Interfaces()
if err != nil {
return err
}
for _, i := range ifaces {
addrs, err := i.Addrs()
if err != nil {
return err
}
for index, a := range addrs {
switch v := a.(type) {
case *net.IPAddr:
fmt.Printf("(%v) %v : %s (%s)\n", index, i.Name, v, v.IP.DefaultMask())
case *net.IPNet:
fmt.Printf("(%v) %v : %s \n", index, i.Name, v)
}
}
}
return nil
}
// Ip4or6 Helper function to check if the IP address is IPV4 or
//IPV6 (https://socketloop.com/tutorials/golang-check-if-ip-address-is-version-4-or-6)
func Ip4or6(s string) string {
for i := 0; i < len(s); i++ {
switch s[i] {
case '.':
return "version 4"
case ':':
return "version 6"
}
}
return "version 6"
} }

View File

@@ -1,7 +1,6 @@
package p2p package p2p
import ( import (
"fmt"
"testing" "testing"
) )
@@ -21,57 +20,3 @@ func TestReadIpTable(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
} }
// Testing is a IPV6 address is returned
func TestGetCurrentIPV6(t *testing.T) {
res, err := GetCurrentIPV6()
if err != nil {
t.Error(err)
}
fmt.Println(res)
}
// This test ensures that the duplicate function works as intended
func TestIpAddresses_RemoveDuplicates(t *testing.T) {
var testduplicates IpAddresses
var duplicateaddress1 IpAddress
var duplicateaddress2 IpAddress
duplicateaddress1.Ipv6="2001:8f8:172d:ee93:7588:ad57:c351:3309"
duplicateaddress1.Ipv4="0.0.0.0"
duplicateaddress2.Ipv6="2001:8f8:172d:ee93:7588:ad57:c351:3309"
duplicateaddress2.Ipv4="0.0.0.0"
testduplicates.IpAddress = append(testduplicates.IpAddress, duplicateaddress1)
testduplicates.IpAddress = append(testduplicates.IpAddress, duplicateaddress2)
err := testduplicates.RemoveDuplicates()
if err != nil {
t.Error(err)
}
if len(testduplicates.IpAddress) == 2 {
t.Fail()
}
}
func TestViewNetworkInterface(t *testing.T) {
err := ViewNetworkInterface()
if err != nil {
t.Error()
}
}
func TestIp4or6(t *testing.T) {
// This test ensures that the ipv6 address gets detected
test := "2001:8f8:172d:7e27:4f23:ae4:bce5:e037"
res := Ip4or6(test)
if res != "version 6" {
t.Fail()
}
}

View File

@@ -2,13 +2,10 @@ package p2p
// SpeedTest Runs a speed test and does updates IP tables accordingly // SpeedTest Runs a speed test and does updates IP tables accordingly
func (ip *IpAddresses)SpeedTest() error{ func (ip *IpAddresses)SpeedTest() error{
//temp variable to store elements IP addresses and other information
// of IP addresses that are pingable
var ActiveIP IpAddresses
// Index to remove from struct // Index to remove from struct
for _, value := range ip.IpAddress { var RemoveIndex []int
for i, value := range ip.IpAddress {
var err error var err error
//if len(ip.IpAddress) == 1 { //if len(ip.IpAddress) == 1 {
@@ -19,6 +16,10 @@ func (ip *IpAddresses)SpeedTest() error{
err = value.PingTest() err = value.PingTest()
if err != nil { if err != nil {
RemoveIndex = append(RemoveIndex, i)
// Record index to remove
//ip.IpAddress = append(ip.IpAddress[:i], ip.IpAddress[i+1:]...)
// Proceed to next element in the array
continue continue
} }
@@ -34,12 +35,19 @@ func (ip *IpAddresses)SpeedTest() error{
//} //}
//Set value to the list //Set value to the list
ip.IpAddress[i] = value
ActiveIP.IpAddress = append(ActiveIP.IpAddress, value)
} }
// Remove element from struct
ip.IpAddress = ActiveIP.IpAddress for _, index := range RemoveIndex {
// If there is only 1 element and that has to be
// removed
if len(ip.IpAddress) == 1 {
ip.IpAddress = nil
break
}
ip.IpAddress = append(ip.IpAddress[:index], ip.IpAddress[index+1:]...)
}
err := ip.WriteIpTable() err := ip.WriteIpTable()
if err != nil { if err != nil {
@@ -49,7 +57,7 @@ func (ip *IpAddresses)SpeedTest() error{
return nil return nil
} }
// SpeedTestUpdatedIPTable Called when ip tables from httpclient/server is also passed on // SpeedTestUpdatedIPTable Called when ip tables from client/server is also passed on
func (ip *IpAddresses)SpeedTestUpdatedIPTable() error{ func (ip *IpAddresses)SpeedTestUpdatedIPTable() error{
targets, err := ReadIpTable() targets, err := ReadIpTable()
if err != nil { if err != nil {
@@ -63,20 +71,18 @@ func (ip *IpAddresses)SpeedTestUpdatedIPTable() error{
for i, _ := range targets.IpAddress { for i, _ := range targets.IpAddress {
// To ensure that there are no duplicate IP addresses // To ensure that there are no duplicate IP addresses
//Exists := false Exists := false
//for k := range ip.IpAddress { for k := range ip.IpAddress {
// // Checks if both the IPV4 addresses are the same or the IPV6 address is not if ip.IpAddress[k].Ipv4 == targets.IpAddress[i].Ipv4 {
// // an empty string and IPV6 address are the same Exists = true
// if ip.IpAddress[k].Ipv4 == targets.IpAddress[i].Ipv4 || (targets.IpAddress[i].Ipv6 != "" && ip.IpAddress[k].Ipv6 == targets.IpAddress[i].Ipv6) { break
// Exists = true }
// break }
// }
//} // If the struct exists then continues
// if Exists {
//// If the struct exists then continues continue
//if Exists { }
// continue
//}
ip.IpAddress = append(ip.IpAddress, targets.IpAddress[i]) ip.IpAddress = append(ip.IpAddress, targets.IpAddress[i])
} }
@@ -105,7 +111,6 @@ func LocalSpeedTestIpTable() error {
return nil return nil
} }
// Helper function to remove element from an array of a struct // Helper function to remove element from an array of a struct
//func remove(s []IpAddress, i int) []IpAddress { //func remove(s []IpAddress, i int) []IpAddress {
// s[len(s)-1], s[i] = s[i], s[len(s)-1] // s[len(s)-1], s[i] = s[i], s[len(s)-1]

View File

@@ -0,0 +1,21 @@
package main
import (
"fmt"
"github.com/showwin/speedtest-go/speedtest"
)
func main() {
user, _ := speedtest.FetchUserInfo()
serverList, _ := speedtest.FetchServerList(user)
targets, _ := serverList.FindServer([]int{})
for _, s := range targets {
s.PingTest()
s.DownloadTest(false)
s.UploadTest(false)
fmt.Printf("Latency: %s, Download: %f, Upload: %f\n", s.Latency, s.DLSpeed, s.ULSpeed)
}
}

View File

@@ -14,7 +14,7 @@ import (
//var dlSizes = [...]int{350, 500, 750, 1000, 1500, 2000, 2500, 3000, 3500, 4000} //var dlSizes = [...]int{350, 500, 750, 1000, 1500, 2000, 2500, 3000, 3500, 4000}
//var ulSizes = [...]int{100, 300, 500, 800, 1000, 1500, 2500, 3000, 3500, 4000} //kB //var ulSizes = [...]int{100, 300, 500, 800, 1000, 1500, 2500, 3000, 3500, 4000} //kB
var httpclient = http.Client{} var client = http.Client{}
// DownloadTest executes the test to measure download speed // DownloadTest executes the test to measure download speed
//func (s *IpAddress) DownloadTest(savingMode bool) error { //func (s *IpAddress) DownloadTest(savingMode bool) error {
@@ -80,7 +80,7 @@ var httpclient = http.Client{}
// Download Speed // Download Speed
func (s *IpAddress)DownloadSpeed() error { func (s *IpAddress)DownloadSpeed() error {
start := time.Now() start := time.Now()
resp, err := httpclient.Get("http://" + s.Ipv4 + ":8088/50") resp, err := client.Get("http://" + s.Ipv4 + ":8088/50")
if err != nil { if err != nil {
return err return err
} }
@@ -150,14 +150,7 @@ func mustOpen(f string) *os.File {
// PingTest executes test to measure latency // PingTest executes test to measure latency
func (s *IpAddress) PingTest() error { func (s *IpAddress) PingTest() error {
//pingURL := strings.Split(s.URL, "/upload")[0] + "/latency.txt" //pingURL := strings.Split(s.URL, "/upload")[0] + "/latency.txt"
var pingURL string pingURL := "http://" + s.Ipv4 + ":8088/server_info"
if s.Ipv6 != "" {
pingURL = "http://[" + s.Ipv6 + "]:8088/server_info"
s.Ipv4 = ""
} else {
pingURL = "http://" + s.Ipv4 + ":8088/server_info"
}
l := time.Duration(100000000000) // 10sec l := time.Duration(100000000000) // 10sec
for i := 0; i < 3; i++ { for i := 0; i < 3; i++ {
sTime := time.Now() sTime := time.Now()

21
p2p/upnp_test.go Normal file
View File

@@ -0,0 +1,21 @@
package p2p
import(
"testing"
)
func TestAddRemoveUpnp(t *testing.T){
// forwarding port 23241 via upnp
err := ForwardPort(23241)
if err != nil {
t.Errorf("Error returned: %q", err)
}
// unforwarding port 23241 via upnp
err = UnForwardPort(23241)
if err != nil {
t.Errorf("Error returned: %q", err)
}
}

View File

@@ -5,7 +5,7 @@
# 3. handlers - these steps run only in response to specific events. If the event does not occur, the handler does not run. # 3. handlers - these steps run only in response to specific events. If the event does not occur, the handler does not run.
################################################################################ ################################################################################
--- ---
- hosts: test # Alternatively, 'canary', 'blue'|'green', 'all' according to your deployment strategy and your /etc/ansible/hosts file - hosts: gpu # Alternatively, 'canary', 'blue'|'green', 'all' according to your deployment strategy and your /etc/ansible/hosts file
become: yes # All commands must run as root become: yes # All commands must run as root
strategy: free # Allows all hosts to run to the end of the playbook as fast as they can strategy: free # Allows all hosts to run to the end of the playbook as fast as they can
@@ -26,8 +26,8 @@
# vars: # vars:
# users: "{{ secrets.users }}" # users: "{{ secrets.users }}"
- role: cuda # CUDA Driver Setup # - role: cuda # CUDA Driver Setup
tags: [cuda] # tags: [cuda]
# - role: nvidia # NVIDIA-Docker Runtime Setup # - role: nvidia # NVIDIA-Docker Runtime Setup
# tags: [nvidia] # tags: [nvidia]

View File

@@ -0,0 +1,3 @@
---
- name: nvidia.nvidia_driver
version: 2.0.0

View File

@@ -11,5 +11,10 @@ general:
- software-properties-common # known good with 0.96.24.32.7 - software-properties-common # known good with 0.96.24.32.7
- git - git
- golang - golang
- apt-utils
- libopenmpi-dev
- python3-setuptools
- python3-dev
pip: pip:
- docker>=3.7.0 # known good with 3.7.0 - docker>=3.7.0 # known good with 3.7.0
- tensorflow

27
sample-run/run.txt Normal file
View File

@@ -0,0 +1,27 @@
Create 3 vm using ./p2prc --CreateVM 0.0.0.0 --Ports=1 --GPU
then on each run
sudo apt clean && sudo apt update && sudo apt -y install cmake ccache nano
sudo ln -s /usr/local/cuda-11.2 /usr/local/cuda
export PATH=${HOME}/.local/bin:$PATH && export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}} && export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
wget -c https://raw.githubusercontent.com/horovod/horovod/master/examples/tensorflow2/tensorflow2_synthetic_benchmark.py
pip install --no-cache-dir horovod[tensorflow]
# this will test if its locally install properly
horovodrun -np 1 python3 tensorflow2_synthetic_benchmark.py
then configure machine1 ssh/config file like
Host host1
HostName 0.0.0.0
Port 39751
Host host2
HostName 0.0.0.0
Port 34779
and ensure that the ssh can be connected and ssh keys are copied using ssh-copy-id command
then run
horovodrun -np 2 -H host1:1,host2:1 python3 tensorflow2_synthetic_benchmark.py

View File

@@ -1,12 +0,0 @@
---
all:
vars:
ansible_python_interpreter: /usr/bin/python3
test:
hosts:
test1:
ansible_host: 0.0.0.0 # Replace with your remote IP
ansible_port: 44003 # Replace with your remote SSH port
ansible_user: master # Replace wtih your username
ansible_ssh_pass: password
ansible_sudo_pass: password

View File

@@ -1,23 +0,0 @@
# The `cuda` Role
The `cuda` role installs the Nvidia CUDA GPU repository and drivers.
This role may be executed independently by running:
```bash
$ ansible-playbook packages.yml --tags "cuda"
```
On execution, this role installs the following directly to the remote machine's operating system:
### Apt Repositories (Debian/Ubuntu)
- Nvidia CUDA
### Apt GPG Signing Keys (Debian/Ubuntu)
- cudatools <cudatools@nvidia.com>
### Operating System Packages (Debian/Ubuntu)
- cuda v10.x

View File

@@ -1,5 +0,0 @@
---
# CUDA Driver Setup
- name: reboot the machine
reboot:
listen: "reboot the machine"

View File

@@ -1,22 +0,0 @@
---
# Cuda Driver Package Installation
- name: copy the CUDA repo onto the machine
copy:
src: "{{ cuda.apt.repo }}"
dest: "{{ general.working_dir }}/{{ cuda.apt.repo }}"
- name: get the CUDA signing key
apt_key:
state: present
url: "{{ cuda.apt.signing_key_url }}"
- name: add the CUDA repo
apt:
deb: "{{ general.working_dir }}/{{ cuda.apt.repo }}"
state: present
- name: install the CUDA drivers
apt:
name: "{{ cuda.apt.package }}"
update_cache: yes
notify: "reboot the machine"

View File

@@ -1,10 +0,0 @@
---
cuda:
apt:
package: cuda=11.* # known good with 10.0.130-1
repo: cuda-11-3_11.3.1-1_amd64.deb # Network install
dependency: cuda-runtime-11-3_11.3.1-1_amd64.deb
signing_key_url: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
general:
working_dir: /tmp

View File

@@ -1,3 +0,0 @@
---
- import_tasks: debian.yml
when: ansible_facts['os_family']|lower == 'debian' # debian, ubuntu

View File

@@ -1,43 +0,0 @@
from horovod/horovod-cpu
# Switch to root user to install additional software
USER 0
# Make sure we don't get notifications we can't answer during building.
env DEBIAN_FRONTEND noninteractive
run apt-get -q -y update; apt-get -q -y upgrade
run apt install net-tools
# Prepare scripts and configs
add ./scripts/start /start
# Set root password
run echo 'root:password' >> /root/passwdfile
# Create user and it's password
run useradd -m -G sudo master && \
echo 'master:password' >> /root/passwdfile
# Apply root password
run chpasswd -c SHA512 < /root/passwdfile && \
rm /root/passwdfile
# Port 22 is used for ssh
expose 22
# Assign /data as static volume.
volume ["/data"]
# Fix all permissions
run chmod +x /start
# Starting sshd
cmd ["/start"]

View File

@@ -1 +0,0 @@
Running official horovod dockerfile cpu version

View File

@@ -1,11 +0,0 @@
#!/bin/bash
# -----------------------------------------------------------------------------
# docker-ubuntu-sshd /start script
#
# Authors: Art567
# Updated: Sep 20th, 2015
# -----------------------------------------------------------------------------
# Run OpenSSH server in daemon mode
/usr/sbin/sshd -D

View File

@@ -0,0 +1,50 @@
# -----------------------------------------------------------------------------
# This is base image of Ubuntu LTS with SSHD service.
#
# Authors: Art567
# Updated: Sep 20th, 2015
# Require: Docker (http://www.docker.io/)
# -----------------------------------------------------------------------------
# Base system is the latest LTS version of Ubuntu.
# from consol/ubuntu-xfce-vnc
# due to dependency issues vnc is still work in progress
from nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
# Switch to root user to install additional software
USER 0
# Make sure we don't get notifications we can't answer during building.
env DEBIAN_FRONTEND noninteractive
# Prepare scripts and configs
add ./scripts/start /start
# Download and install everything from the repos.
run apt-get -q -y update; apt-get -q -y upgrade && \
apt-get -q -y install sudo openssh-server python3-pip && \
mkdir /var/run/sshd
# Set root password
run echo 'root:password' >> /root/passwdfile
# Create user and it's password
run useradd -m -G sudo master && \
echo 'master:password' >> /root/passwdfile
# Apply root password
run chpasswd -c SHA512 < /root/passwdfile && \
rm /root/passwdfile
# Port 22 is used for ssh
expose 22
# Assign /data as static volume.
volume ["/data"]
# Fix all permissions
run chmod +x /start
# Starting sshd
cmd ["/start"]

View File

@@ -0,0 +1,72 @@
Ubuntu LTS with SSH (Docker)
=========
A Docker file to build a [docker.io] base container with Ubuntu LTS and a sshd service
[docker.io]: http://docker.io
Nice and easy way to get any server up and running using docker
Instructions
-----------
- Install Docker first.
Read [installation instructions] (http://docs.docker.io/en/latest/installation/).
- Clone this repository:
`$ git clone https://github.com/art567/docker-ubuntu-sshd.git`
- Enter local directory:
`$ cd docker-ubuntu-sshd`
- Change passwords in Dockerfile:
`$ vi Dockerfile`
- Build the container:
`$ sudo docker build -t art567/ubuntu .`
- Run the container:
`$ sudo docker run -d=true --name=ubuntu --restart=always -p=2222:22 -v=/opt/data:/data art567/ubuntu /start`
- Your container will start and bind ssh to 2222 port.
- Find your local IP Address:
`$ ifconfig`
- Connect to the SSH server:
`$ ssh root@<ip-address> -p 2222`
- If you don't want to deal with root:
`$ ssh master@<ip-address> -p 2222`
**VERY IMPORTANT!!!**
-----------
**Don't forget to change passwords in Dockerfile before building image!**
Versions
-----------
Some branches represents Ubuntu versions.
Branch `master` is always represented by latest Ubuntu LTS
For example:
- 12.04 - Ubuntu 12.04 LTS
- 14.04 - Ubuntu 14.04 LTS
- 16.04 - Ubuntu 16.04 LTS

View File

@@ -8,4 +8,4 @@
# Run OpenSSH server in daemon mode # Run OpenSSH server in daemon mode
/usr/sbin/sshd -D /usr/sbin/sshd -D

View File

@@ -1 +0,0 @@
Simple Ubuntu 20.04 image

View File

@@ -1,41 +0,0 @@
from horovod/horovod
# Switch to root user to install additional software
USER 0
# Make sure we don't get notifications we can't answer during building.
env DEBIAN_FRONTEND noninteractive
# Prepare scripts and configs
add ./scripts/start /start
# Set root password
run echo 'root:password' >> /root/passwdfile
# Create user and it's password
run useradd -m -G sudo master && \
echo 'master:password' >> /root/passwdfile
# Apply root password
run chpasswd -c SHA512 < /root/passwdfile && \
rm /root/passwdfile
# Port 22 is used for ssh
expose 22
# Assign /data as static volume.
volume ["/data"]
# Fix all permissions
run chmod +x /start
# Starting sshd
cmd ["/start"]

View File

@@ -1 +0,0 @@
Running official horovod dockerfile cpu version

View File

@@ -16,7 +16,6 @@ import (
"github.com/lithammer/shortuuid" "github.com/lithammer/shortuuid"
"github.com/phayes/freeport" "github.com/phayes/freeport"
"io" "io"
"io/ioutil"
"os/exec" "os/exec"
"time" "time"
) )
@@ -34,15 +33,6 @@ type DockerVM struct {
GPU string `json:"GPU"` GPU string `json:"GPU"`
} }
type DockerContainers struct {
DockerContainer []DockerContainer `json:"DockerContainer"`
}
type DockerContainer struct {
ContainerName string `json:"DockerContainerName"`
ContainerDescription string `json:"ContainerDescription"`
}
type ErrorLine struct { type ErrorLine struct {
Error string `json:"error"` Error string `json:"error"`
ErrorDetail ErrorDetail `json:"errorDetail"` ErrorDetail ErrorDetail `json:"errorDetail"`
@@ -54,7 +44,7 @@ type ErrorDetail struct {
var dockerRegistryUserID = "" var dockerRegistryUserID = ""
func BuildRunContainer(NumPorts int, GPU string, ContainerName string) (*DockerVM,error) { func BuildRunContainer(NumPorts int, GPU string) (*DockerVM,error) {
//Docker Struct Variable //Docker Struct Variable
var RespDocker *DockerVM = new(DockerVM) var RespDocker *DockerVM = new(DockerVM)
@@ -91,27 +81,10 @@ func BuildRunContainer(NumPorts int, GPU string, ContainerName string) (*DockerV
if err != nil { if err != nil {
return nil,err return nil,err
} }
RespDocker.ImagePath = config.DefaultDockerFile RespDocker.ImagePath = config.DockerFile
//if GPU == "true" {
// We are checking if the container name is not nil and not equal to the default one used // RespDocker.ImagePath = "/home/asleepyguy/p2p-rendering-computation/server/docker/containers/docker-ubuntu-sshd-gpu/"
// which is docker-ubuntu-sshd //}
if ContainerName != "" && ContainerName != "docker-ubuntu-sshd" {
Containers, err := ViewAllContainers()
if err != nil {
return nil,err
}
for _, dockerContainer := range Containers.DockerContainer {
if dockerContainer.ContainerName == ContainerName {
RespDocker.ImagePath = config.DockerContainers + ContainerName + "/"
RespDocker.TagName = ContainerName
break
}
}
if RespDocker.ImagePath == config.DefaultDockerFile {
return nil, errors.New("Container " + ContainerName + " does not exist in the server")
}
}
// Gets docker information from env variables // Gets docker information from env variables
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
@@ -257,7 +230,7 @@ func (d *DockerVM)runContainer(dockerClient *client.Client) error{
for i := range d.Ports { for i := range d.Ports {
cmd.WriteString("-p " + fmt.Sprint(d.Ports[i]) + ":" + fmt.Sprint(d.Ports[i]) + " ") cmd.WriteString("-p " + fmt.Sprint(d.Ports[i]) + ":" + fmt.Sprint(d.Ports[i]) + " ")
} }
cmd.WriteString("-v=/opt/data:/data "+ d.TagName +" /start > /dev/null") cmd.WriteString("-v=/opt/data:/data p2p-ubuntu /start > /dev/null")
//"-v=/opt/data:/data p2p-ubuntu /start > /dev/null" //"-v=/opt/data:/data p2p-ubuntu /start > /dev/null"
cmdStr := cmd.String() cmdStr := cmd.String()
_, err := exec.Command("/bin/sh", "-c", cmdStr).Output() _, err := exec.Command("/bin/sh", "-c", cmdStr).Output()
@@ -268,7 +241,7 @@ func (d *DockerVM)runContainer(dockerClient *client.Client) error{
return nil return nil
} }
// StopAndRemoveContainer // StopAndRemoveContainer TODO: Implement and remove docker instance running
// Stop and remove a container // Stop and remove a container
// Reference (https://gist.github.com/frikky/e2efcea6c733ea8d8d015b7fe8a91bf6) // Reference (https://gist.github.com/frikky/e2efcea6c733ea8d8d015b7fe8a91bf6)
func StopAndRemoveContainer(containername string) error { func StopAndRemoveContainer(containername string) error {
@@ -296,46 +269,6 @@ func StopAndRemoveContainer(containername string) error {
return nil return nil
} }
// ViewAllContainers returns all containers runnable and which can be built
func ViewAllContainers() (*DockerContainers, error){
// Traverse the folder path as per given in the config file
config, err := config.ConfigInit()
if err != nil {
return nil,err
}
folders, err := ioutil.ReadDir(config.DockerContainers)
if err != nil {
return nil, err
}
//Declare variable DockerContainers of type struct
var Containers *DockerContainers = new(DockerContainers)
for _, f := range folders {
if f.IsDir() {
//Declare variable DockerContainer of type struct
var Container DockerContainer
// Setting container name to folder name
Container.ContainerName = f.Name()
// Getting Description from file description.txt
Description, err := ioutil.ReadFile(config.DockerContainers + "/" + Container.ContainerName + "/description.txt")
// if we os.Open returns an error then handle it
if err != nil {
return nil, err
}
// Get Description from description.txt
Container.ContainerDescription = string(Description)
Containers.DockerContainer = append(Containers.DockerContainer, Container)
}
}
return Containers,nil
}
func print(rd io.Reader) error { func print(rd io.Reader) error {
var lastLine string var lastLine string

View File

@@ -1,42 +1,17 @@
package docker package docker
import ( import (
"fmt"
"testing" "testing"
) )
func TestDockerUbuntuSSHDProvided(t *testing.T) { func TestDocker(t *testing.T) {
// Testing by providing default container name //TODO overwrite with custom docker paths
_,err := BuildRunContainer(2,"false","docker-ubuntu-sshd") resp,err := BuildRunContainer(2,"true")
if err != nil {
t.Error(err)
}
}
func TestDockerDefaultContainer(t *testing.T) {
// Testing by providing without providing default container name
_,err := BuildRunContainer(2,"false","")
if err != nil {
t.Error(err)
}
}
func TestContainerHorovod(t *testing.T) {
// Testing by providing the horovod cpu image
_,err := BuildRunContainer(2,"false","cpuhorovod")
if err != nil {
t.Error(err)
}
}
func TestViewAllContainers(t *testing.T) {
_,err := ViewAllContainers()
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
fmt.Print(resp.VNCPort)
} }

0
server/docker/kill-containers.sh Normal file → Executable file
View File

View File

@@ -19,7 +19,8 @@ type Docker struct {
// Starts container using RPC calls // Starts container using RPC calls
func (l *Listener) StartContainer( reply *Docker) error { func (l *Listener) StartContainer( reply *Docker) error {
vm, err := docker.BuildRunContainer(3,"false","") fmt.Print("here")
vm, err := docker.BuildRunContainer(3,"false")
if err != nil { if err != nil {
return err return err
} }

View File

@@ -43,12 +43,7 @@ func Server() error{
r.POST("/IpTable", func(c *gin.Context) { r.POST("/IpTable", func(c *gin.Context) {
// Getting IPV4 address of client // Getting IPV4 address of client
var ClientHost p2p.IpAddress var ClientHost p2p.IpAddress
ClientHost.Ipv4 = c.ClientIP()
if p2p.Ip4or6(c.ClientIP()) == "version 6" {
ClientHost.Ipv6 = c.ClientIP()
} else {
ClientHost.Ipv4 = c.ClientIP()
}
// Variable to store IP table information // Variable to store IP table information
var IPTable p2p.IpAddresses var IPTable p2p.IpAddresses
@@ -82,6 +77,12 @@ func Server() error{
c.String(http.StatusOK, fmt.Sprint(err)) c.String(http.StatusOK, fmt.Sprint(err))
} }
// Called step to remove duplicate IP addresses
err = p2p.RemoveDuplicates()
if err != nil {
c.String(http.StatusOK, fmt.Sprint(err))
}
// Reads IP addresses from ip table // Reads IP addresses from ip table
IpAddresses,err := p2p.ReadIpTable() IpAddresses,err := p2p.ReadIpTable()
if err != nil { if err != nil {
@@ -96,15 +97,14 @@ func Server() error{
// Get Number of ports to open and whether to use GPU or not // Get Number of ports to open and whether to use GPU or not
Ports := c.DefaultQuery("ports","0") Ports := c.DefaultQuery("ports","0")
GPU := c.DefaultQuery("GPU","false") GPU := c.DefaultQuery("GPU","false")
ContainerName := c.DefaultQuery("ContainerName","")
var PortsInt int var PortsInt int
// Convert Get Request value to int // Convert Get Request value to int
fmt.Sscanf(Ports, "%d", &PortsInt) fmt.Sscanf(Ports, "%d", &PortsInt)
// Creates container and returns-back result to // Creates container and returns back result to
// access container // access container
resp, err := docker.BuildRunContainer(PortsInt,GPU,ContainerName) resp, err := docker.BuildRunContainer(PortsInt,GPU)
if err != nil { if err != nil {
c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err)) c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err))
@@ -122,14 +122,23 @@ func Server() error{
c.String(http.StatusOK, "success") c.String(http.StatusOK, "success")
}) })
//Show images avaliable // Future feature
r.GET("/ShowImages", func(c *gin.Context) { /*r.GET("/create_vm/:virtualization", func(c *gin.Context) {
resp, err := docker.ViewAllContainers() virtualization := c.Param("virtualization")
if err != nil { // Runs based on Preallocated VM size
if virtualization == "docker" {
sshinfo,err := docker.RunVM()
if err != nil {
c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err)) c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err))
}
if sshinfo != nil {
c.JSON(http.StatusOK, sshinfo)
}
} else {
c.String(200,"virtualization tool not selected")
} }
c.JSON(http.StatusOK, resp) })*/
})
// Port running on // Port running on
err := r.Run(":8088") err := r.Run(":8088")