diff --git a/.DS_Store b/.DS_Store index 987eb7e..5a9b600 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 6397c95..801c83c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ generate/Test #ignore windows exe files *.exe dist/ + +# ignore docker image files +server/docker/containers/ diff --git a/Akilan1999/docker-ubuntu-sshdserver/docker/containers/Akilan1999/docker-ubuntu-sshd b/Akilan1999/docker-ubuntu-sshdserver/docker/containers/Akilan1999/docker-ubuntu-sshd new file mode 160000 index 0000000..fbee2ad --- /dev/null +++ b/Akilan1999/docker-ubuntu-sshdserver/docker/containers/Akilan1999/docker-ubuntu-sshd @@ -0,0 +1 @@ +Subproject commit fbee2ad6a9626b73dc34299cfa37e7db63230505 diff --git a/client/trackcontainers/.gitkeep b/client/trackcontainers/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/cmd/action.go b/cmd/action.go index 596ed79..c9fad39 100644 --- a/cmd/action.go +++ b/cmd/action.go @@ -135,7 +135,7 @@ var CliAction = func(ctx *cli.Context) error { //Sets default paths to the config file if SetDefaultConfig { - err := generate.SetDefaults("P2PRC") + err := generate.SetDefaults("P2PRC", false) if err != nil { fmt.Print(err) } diff --git a/config/generate/generateFiles.go b/config/generate/generateFiles.go index 41cb816..c9323b7 100644 --- a/config/generate/generateFiles.go +++ b/config/generate/generateFiles.go @@ -2,6 +2,7 @@ package generate import ( "github.com/Akilan1999/p2p-rendering-computation/p2p" + "github.com/go-git/go-git/v5" "os" ) @@ -100,14 +101,18 @@ func GenerateDockerFiles() (err error) { return err } } - //if _, err = os.Stat(path + "server/docker/ip_table.json"); os.IsNotExist(err) { - // _, err = os.Create(path + "p2p/iptable/ip_table.json") - // if err != nil { - // return err - // } - //} } + + // Clone base docker image + _, err = git.PlainClone(path+"server/docker/containers/docker-ubuntu-sshd", false, &git.CloneOptions{ + URL: "https://github.com/Akilan1999/docker-ubuntu-sshd", + Progress: os.Stdout, + }) + if err != nil { + return err + } + return } diff --git a/p2p/iptable/.gitkeep b/p2p/iptable/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/server/.DS_Store b/server/.DS_Store new file mode 100644 index 0000000..2575f6f Binary files /dev/null and b/server/.DS_Store differ diff --git a/server/docker/.DS_Store b/server/docker/.DS_Store new file mode 100644 index 0000000..8f300a7 Binary files /dev/null and b/server/docker/.DS_Store differ diff --git a/server/docker/containers/README b/server/docker/containers/README deleted file mode 100644 index a5ada78..0000000 --- a/server/docker/containers/README +++ /dev/null @@ -1,7 +0,0 @@ -Containers -=========== - -Structure - |_ Containers - |_ (To ensure the name is the same as the tag name) - |_ DockerFile \ No newline at end of file diff --git a/server/docker/containers/cpuhorovod/Dockerfile b/server/docker/containers/cpuhorovod/Dockerfile deleted file mode 100644 index 90e8f43..0000000 --- a/server/docker/containers/cpuhorovod/Dockerfile +++ /dev/null @@ -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"] \ No newline at end of file diff --git a/server/docker/containers/cpuhorovod/description.txt b/server/docker/containers/cpuhorovod/description.txt deleted file mode 100644 index 7a100b7..0000000 --- a/server/docker/containers/cpuhorovod/description.txt +++ /dev/null @@ -1 +0,0 @@ -Running official horovod dockerfile cpu version diff --git a/server/docker/containers/cpuhorovod/scripts/start b/server/docker/containers/cpuhorovod/scripts/start deleted file mode 100644 index 9dde9d0..0000000 --- a/server/docker/containers/cpuhorovod/scripts/start +++ /dev/null @@ -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 \ No newline at end of file diff --git a/server/docker/containers/docker-ubuntu-sshd-x11/Dockerfile b/server/docker/containers/docker-ubuntu-sshd-x11/Dockerfile deleted file mode 100644 index a3628ab..0000000 --- a/server/docker/containers/docker-ubuntu-sshd-x11/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# ----------------------------------------------------------------------------- -# 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 ubuntu:20.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 && \ - 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"] diff --git a/server/docker/containers/docker-ubuntu-sshd-x11/README.md b/server/docker/containers/docker-ubuntu-sshd-x11/README.md deleted file mode 100644 index ee62e54..0000000 --- a/server/docker/containers/docker-ubuntu-sshd-x11/README.md +++ /dev/null @@ -1,72 +0,0 @@ -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@ -p 2222` - - - - If you don't want to deal with root: - - `$ ssh master@ -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 - diff --git a/server/docker/containers/docker-ubuntu-sshd-x11/description.txt b/server/docker/containers/docker-ubuntu-sshd-x11/description.txt deleted file mode 100644 index dc5b3fa..0000000 --- a/server/docker/containers/docker-ubuntu-sshd-x11/description.txt +++ /dev/null @@ -1 +0,0 @@ -Simple Ubuntu 20.04 image \ No newline at end of file diff --git a/server/docker/containers/docker-ubuntu-sshd-x11/ports.json b/server/docker/containers/docker-ubuntu-sshd-x11/ports.json deleted file mode 100644 index 520565b..0000000 --- a/server/docker/containers/docker-ubuntu-sshd-x11/ports.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Port": [ - { - "PortName": "SSH", - "InternalPort": 22, - "Type": "tcp", - "Description": "SSH Port" - }, - { - "PortName": "VNC", - "InternalPort": 5900, - "Type": "tcp", - "Description": "VNC port" - } - ] -} \ No newline at end of file diff --git a/server/docker/containers/docker-ubuntu-sshd-x11/scripts/start b/server/docker/containers/docker-ubuntu-sshd-x11/scripts/start deleted file mode 100644 index 3c9caa9..0000000 --- a/server/docker/containers/docker-ubuntu-sshd-x11/scripts/start +++ /dev/null @@ -1,14 +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 - -# Running x11 server with password - diff --git a/server/docker/containers/docker-ubuntu-sshd/Dockerfile b/server/docker/containers/docker-ubuntu-sshd/Dockerfile deleted file mode 100644 index a3628ab..0000000 --- a/server/docker/containers/docker-ubuntu-sshd/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# ----------------------------------------------------------------------------- -# 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 ubuntu:20.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 && \ - 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"] diff --git a/server/docker/containers/docker-ubuntu-sshd/README.md b/server/docker/containers/docker-ubuntu-sshd/README.md deleted file mode 100644 index ee62e54..0000000 --- a/server/docker/containers/docker-ubuntu-sshd/README.md +++ /dev/null @@ -1,72 +0,0 @@ -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@ -p 2222` - - - - If you don't want to deal with root: - - `$ ssh master@ -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 - diff --git a/server/docker/containers/docker-ubuntu-sshd/description.txt b/server/docker/containers/docker-ubuntu-sshd/description.txt deleted file mode 100644 index dc5b3fa..0000000 --- a/server/docker/containers/docker-ubuntu-sshd/description.txt +++ /dev/null @@ -1 +0,0 @@ -Simple Ubuntu 20.04 image \ No newline at end of file diff --git a/server/docker/containers/docker-ubuntu-sshd/ports.json b/server/docker/containers/docker-ubuntu-sshd/ports.json deleted file mode 100644 index e24ff6a..0000000 --- a/server/docker/containers/docker-ubuntu-sshd/ports.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Port": [ - { - "PortName": "SSH", - "InternalPort": 22, - "Type": "tcp", - "Description": "SSH Port" - }, - { - "PortName": "NoVNC", - "InternalPort": 5901, - "Type": "tcp", - "Description": "NoVNC port" - }, - { - "PortName": "NoVNC", - "InternalPort": 6081, - "Type": "tcp", - "Description": "NoVNC port" - } - ] -} \ No newline at end of file diff --git a/server/docker/containers/docker-ubuntu-sshd/scripts/start b/server/docker/containers/docker-ubuntu-sshd/scripts/start deleted file mode 100644 index 5286196..0000000 --- a/server/docker/containers/docker-ubuntu-sshd/scripts/start +++ /dev/null @@ -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 diff --git a/server/docker/containers/gpuhorovod/Dockerfile b/server/docker/containers/gpuhorovod/Dockerfile deleted file mode 100644 index ed75ef6..0000000 --- a/server/docker/containers/gpuhorovod/Dockerfile +++ /dev/null @@ -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"] \ No newline at end of file diff --git a/server/docker/containers/gpuhorovod/description.txt b/server/docker/containers/gpuhorovod/description.txt deleted file mode 100644 index 7a100b7..0000000 --- a/server/docker/containers/gpuhorovod/description.txt +++ /dev/null @@ -1 +0,0 @@ -Running official horovod dockerfile cpu version diff --git a/server/docker/containers/gpuhorovod/scripts/start b/server/docker/containers/gpuhorovod/scripts/start deleted file mode 100644 index 9dde9d0..0000000 --- a/server/docker/containers/gpuhorovod/scripts/start +++ /dev/null @@ -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 \ No newline at end of file diff --git a/server/docker/containers/ubuntuvnc/Dockerfile b/server/docker/containers/ubuntuvnc/Dockerfile deleted file mode 100644 index d253d87..0000000 --- a/server/docker/containers/ubuntuvnc/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# ----------------------------------------------------------------------------- -# 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 dorowu/ubuntu-desktop-lxde-vnc - -# 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 && \ - 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"] diff --git a/server/docker/containers/ubuntuvnc/README.md b/server/docker/containers/ubuntuvnc/README.md deleted file mode 100644 index ee62e54..0000000 --- a/server/docker/containers/ubuntuvnc/README.md +++ /dev/null @@ -1,72 +0,0 @@ -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@ -p 2222` - - - - If you don't want to deal with root: - - `$ ssh master@ -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 - diff --git a/server/docker/containers/ubuntuvnc/description.txt b/server/docker/containers/ubuntuvnc/description.txt deleted file mode 100644 index dc5b3fa..0000000 --- a/server/docker/containers/ubuntuvnc/description.txt +++ /dev/null @@ -1 +0,0 @@ -Simple Ubuntu 20.04 image \ No newline at end of file diff --git a/server/docker/containers/ubuntuvnc/scripts/start b/server/docker/containers/ubuntuvnc/scripts/start deleted file mode 100644 index 5286196..0000000 --- a/server/docker/containers/ubuntuvnc/scripts/start +++ /dev/null @@ -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