Merge branch 'master' of github.com:Akilan1999/p2p-rendering-computation
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,8 +1,10 @@
|
|||||||
|
.idea
|
||||||
vendor/
|
vendor/
|
||||||
bin/
|
bin/
|
||||||
p2p-rendering/
|
p2p-rendering/
|
||||||
main
|
main
|
||||||
server/docker/__pycache__
|
server/docker/__pycache__
|
||||||
p2p-rendering-computation
|
p2p-rendering-computation
|
||||||
|
p2prc
|
||||||
config.json
|
config.json
|
||||||
.vscode/
|
.vscode/
|
||||||
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/p2p-redering-computation.iml" filepath="$PROJECT_DIR$/.idea/p2p-redering-computation.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
15
.idea/p2p-redering-computation.iml
generated
15
.idea/p2p-redering-computation.iml
generated
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="Python" name="Python facet">
|
|
||||||
<configuration sdkName="Python 3.8 (p2p-redering-computation)" />
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="Go" enabled="true" />
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="Python 3.8 (p2p-redering-computation) interpreter library" level="application" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
8
.idea/p2p-rendering-computation.iml
generated
8
.idea/p2p-rendering-computation.iml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -13,6 +13,7 @@ in the developer community. In the server module we use the Docker Go API to cre
|
|||||||
interact with the containers.
|
interact with the containers.
|
||||||
|
|
||||||
[Instructions to install docker](https://docs.docker.com/get-docker/)
|
[Instructions to install docker](https://docs.docker.com/get-docker/)
|
||||||
|
|
||||||
[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
|
||||||
@@ -27,7 +28,7 @@ make install
|
|||||||
|
|
||||||
### Test if binary works
|
### Test if binary works
|
||||||
```
|
```
|
||||||
./p2p-rendering-computation --help
|
p2prc --help
|
||||||
```
|
```
|
||||||
#### Output:
|
#### Output:
|
||||||
```
|
```
|
||||||
@@ -60,10 +61,6 @@ GLOBAL OPTIONS:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Add command to .bashrc or .zshrc
|
|
||||||
```
|
|
||||||
export PATH=~/<Project Path>/p2p-redering-computation:${PATH}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
#### Note: The steps on how to use the commands will be added later.
|
#### Note: The steps on how to use the commands will be added later.
|
||||||
|
|||||||
11
Makefile
11
Makefile
@@ -1,11 +1,16 @@
|
|||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go build .
|
go build -o p2prc
|
||||||
./p2p-rendering-computation --SetDefaultConfig
|
echo '# Paths for p2p rendering and computation' >> ~/.bashrc
|
||||||
|
echo 'export P2PRC=${PWD}' >> ~/.bashrc
|
||||||
|
echo 'export path=${PWD}:$${PATH}' >> ~/.bashrc
|
||||||
|
source ~/.bashrc
|
||||||
|
./p2prc --SetDefaultConfig
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build .
|
go build -o p2prc
|
||||||
|
|
||||||
config:
|
config:
|
||||||
./p2p-rendering-computation --SetDefaultConfig
|
./p2p-rendering-computation --SetDefaultConfig
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ var (
|
|||||||
"DockerFile": "/home/akilan/Documents/p2prendering/p2p-redering-computation/server/docker/containers/docker-ubuntu-sshd/",
|
"DockerFile": "/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.json"
|
configName = "config"
|
||||||
configType = "json"
|
configType = "json"
|
||||||
configFile = "config.json"
|
configFile = "config.json"
|
||||||
configPaths []string
|
configPaths []string
|
||||||
@@ -37,11 +37,8 @@ func fileExists(name string) bool {
|
|||||||
// 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 {
|
||||||
//Getting Current Directory
|
//Getting Current Directory from environment variable
|
||||||
curDir, err := os.Getwd()
|
curDir := os.Getenv("P2PRC")
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
//Setting current directory to default path
|
//Setting current directory to default path
|
||||||
defaultPath = curDir + "/"
|
defaultPath = curDir + "/"
|
||||||
@@ -62,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
|
||||||
}
|
}
|
||||||
@@ -70,23 +67,32 @@ func SetDefaults() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ConfigInit()(*Config,error) {
|
func ConfigInit()(*Config,error) {
|
||||||
//Sets default configuration to viper
|
|
||||||
for k,v := range defaults {
|
curDir := os.Getenv("P2PRC")
|
||||||
viper.SetDefault(k,v)
|
//Setting current directory to default path
|
||||||
}
|
defaultPath = curDir + "/"
|
||||||
viper.SetConfigName(configName)
|
//Paths to search for config file
|
||||||
viper.SetConfigFile(configFile)
|
configPaths = append(configPaths, defaultPath)
|
||||||
viper.SetConfigType(configType)
|
|
||||||
//Add all possible configurations paths
|
//Add all possible configurations paths
|
||||||
for _,v := range configPaths {
|
for _,v := range configPaths {
|
||||||
viper.AddConfigPath(v)
|
viper.AddConfigPath(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Read config file
|
//Read config file
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
// If the error thrown is config file not found
|
// If the error thrown is config file not found
|
||||||
if err = viper.WriteConfig(); err != nil {
|
//Sets default configuration to viper
|
||||||
return nil,err
|
for k,v := range defaults {
|
||||||
}
|
viper.SetDefault(k,v)
|
||||||
|
}
|
||||||
|
viper.SetConfigName(configName)
|
||||||
|
viper.SetConfigFile(configFile)
|
||||||
|
viper.SetConfigType(configType)
|
||||||
|
|
||||||
|
if err = viper.WriteConfig(); err != nil {
|
||||||
|
return nil,err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds configuration to the struct
|
// Adds configuration to the struct
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Ansible p2p-rendering-computation
|
# Ansible p2p-rendering-computation
|
||||||
|
### Modified from:
|
||||||
|
|
||||||
This repository contains an Ansible playbook and instructions to create and manage a single (or many) bare metal deep learning machines. For a description of why Ansible was chosen and what other alternatives were considered, please see [ToolSelection.md](ToolSelection.md)
|
This repository contains an Ansible playbook and instructions to create and manage a single (or many) bare metal deep learning machines. For a description of why Ansible was chosen and what other alternatives were considered, please see [ToolSelection.md](ToolSelection.md)
|
||||||
|
|
||||||
|
|||||||
1
go.mod
1
go.mod
@@ -29,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
|
||||||
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
|
||||||
|
|||||||
1
go.sum
1
go.sum
@@ -820,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=
|
||||||
|
|||||||
@@ -1,16 +1,3 @@
|
|||||||
{
|
{
|
||||||
"ip_address": [
|
"ip_address": null
|
||||||
{
|
|
||||||
"ipv4": "147.75.100.225",
|
|
||||||
"latency": 1582411,
|
|
||||||
"download": 279180.07603469375,
|
|
||||||
"upload": 855366.1394760027
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ipv4": "86.99.70.106",
|
|
||||||
"latency": 134446840,
|
|
||||||
"download": 1582.176490711659,
|
|
||||||
"upload": 597823.3252726822
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -8,9 +8,9 @@ func (ip *IpAddresses)SpeedTest() error{
|
|||||||
for i, value := range ip.IpAddress {
|
for i, value := range ip.IpAddress {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
if len(ip.IpAddress) == 1 {
|
//if len(ip.IpAddress) == 1 {
|
||||||
i = 0
|
// i = 0
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Ping Test
|
// Ping Test
|
||||||
err = value.PingTest()
|
err = value.PingTest()
|
||||||
@@ -40,6 +40,12 @@ func (ip *IpAddresses)SpeedTest() error{
|
|||||||
}
|
}
|
||||||
// Remove element from struct
|
// Remove element from struct
|
||||||
for _, index := range RemoveIndex {
|
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:]...)
|
ip.IpAddress = append(ip.IpAddress[:index], ip.IpAddress[index+1:]...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
func TestDocker(t *testing.T) {
|
func TestDocker(t *testing.T) {
|
||||||
//TODO overwrite with custom docker paths
|
//TODO overwrite with custom docker paths
|
||||||
resp,err := BuildRunContainer(2,"false")
|
resp,err := BuildRunContainer(2,"true")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user