From 01bbdcc6877ac54b4ce521d8faad0fb1bb737497 Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:35:40 +1300 Subject: [PATCH 1/8] Create ignore Add the folder we need to build the image Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- pkg-scripts/docker-image-generation/ignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 pkg-scripts/docker-image-generation/ignore diff --git a/pkg-scripts/docker-image-generation/ignore b/pkg-scripts/docker-image-generation/ignore new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/pkg-scripts/docker-image-generation/ignore @@ -0,0 +1 @@ + From c0458f868561c332c761723cf90181aae5348e64 Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:36:35 +1300 Subject: [PATCH 2/8] Delete ignore Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- pkg-scripts/docker-image-generation/ignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 pkg-scripts/docker-image-generation/ignore diff --git a/pkg-scripts/docker-image-generation/ignore b/pkg-scripts/docker-image-generation/ignore deleted file mode 100644 index 8b137891791..00000000000 --- a/pkg-scripts/docker-image-generation/ignore +++ /dev/null @@ -1 +0,0 @@ - From 73d3755c4db59e96aeb125f440ea12b86e6ffa2a Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:37:19 +1300 Subject: [PATCH 3/8] Create ignore Add the folder we need to build the image Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- pkg-scripts/docker-image-generation/ignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 pkg-scripts/docker-image-generation/ignore diff --git a/pkg-scripts/docker-image-generation/ignore b/pkg-scripts/docker-image-generation/ignore new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/pkg-scripts/docker-image-generation/ignore @@ -0,0 +1 @@ + From 2bf4a30689ba6e7b626ab963805879dd7dd78a62 Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:45:00 +1300 Subject: [PATCH 4/8] Add files via upload Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- .../docker-image-generation/Docker-image.md | 36 +++++++++++++++++++ .../docker-image-generation/Dockerfile | 6 ++++ 2 files changed, 42 insertions(+) create mode 100644 pkg-scripts/docker-image-generation/Docker-image.md create mode 100644 pkg-scripts/docker-image-generation/Dockerfile diff --git a/pkg-scripts/docker-image-generation/Docker-image.md b/pkg-scripts/docker-image-generation/Docker-image.md new file mode 100644 index 00000000000..0b7ac3a861d --- /dev/null +++ b/pkg-scripts/docker-image-generation/Docker-image.md @@ -0,0 +1,36 @@ +# Building the server image + +## _This is the instruction of how to build the image that contains the domain-server and the assignment-clients (and the ice-server) using the Dockerfile_ + +--- +## _How to build the image_ + + - clone the repo or the folder named "docker-image-generation" and jump into that directory. + + - copy the .deb file into this folder and modify the following command in Dockerfile. + + ``` +COPY + ``` + + - run the following command in your terminal (Ubuntu 20.04). + + - make sure you assign a name to the image by replacing "image_name". + + ``` +docker build -t . + ``` + + --- + + ## _How to check the image is built successfully_ + + - run the following command (after starting docker desktop if you have). + +``` +docker image ls +``` + + - if the image is built properly, you should be able to find the image in the list. + + diff --git a/pkg-scripts/docker-image-generation/Dockerfile b/pkg-scripts/docker-image-generation/Dockerfile new file mode 100644 index 00000000000..eb3834f1934 --- /dev/null +++ b/pkg-scripts/docker-image-generation/Dockerfile @@ -0,0 +1,6 @@ +FROM ubuntu:20.04 +COPY vircadia-server_2022.12.02-20221123-4ff3625-0ubuntu1-1_amd64.deb . +RUN apt update +RUN apt install libcap2-bin -y +RUN apt install systemd -y +RUN apt -y install ./vircadia-server_2022.12.02-20221123-4ff3625-0ubuntu1-1_amd64.deb \ No newline at end of file From b1ad49b51237c1ae35749851520eee94502d90ed Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:45:28 +1300 Subject: [PATCH 5/8] Delete ignore Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- pkg-scripts/docker-image-generation/ignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 pkg-scripts/docker-image-generation/ignore diff --git a/pkg-scripts/docker-image-generation/ignore b/pkg-scripts/docker-image-generation/ignore deleted file mode 100644 index 8b137891791..00000000000 --- a/pkg-scripts/docker-image-generation/ignore +++ /dev/null @@ -1 +0,0 @@ - From 87b18ebd3b7291b99e3c95f983206bc3cec684b2 Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:46:14 +1300 Subject: [PATCH 6/8] Create ignore Add the foler we need to start multi-containers Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- pkg-scripts/docker-compose-generation/ignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 pkg-scripts/docker-compose-generation/ignore diff --git a/pkg-scripts/docker-compose-generation/ignore b/pkg-scripts/docker-compose-generation/ignore new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/pkg-scripts/docker-compose-generation/ignore @@ -0,0 +1 @@ + From f396f65fed06a3a73645271e03becb2044b42718 Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:52:19 +1300 Subject: [PATCH 7/8] Add files via upload Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- .../Docker-compose.md | 50 +++++++++++++++++++ .../docker-compose.yml | 19 +++++++ 2 files changed, 69 insertions(+) create mode 100644 pkg-scripts/docker-compose-generation/Docker-compose.md create mode 100644 pkg-scripts/docker-compose-generation/docker-compose.yml diff --git a/pkg-scripts/docker-compose-generation/Docker-compose.md b/pkg-scripts/docker-compose-generation/Docker-compose.md new file mode 100644 index 00000000000..754ae6c8897 --- /dev/null +++ b/pkg-scripts/docker-compose-generation/Docker-compose.md @@ -0,0 +1,50 @@ +# Running multiple containers + +## _This is the instruction of how to establish seven containers to let them connect with each other using docker-compose command in a YAML file. (one domain server + six assignment clients)_ + + +--- +## _How to start the containers_ + + - clone the repo or single yaml file and jump into that directory. + + - modify the following commands in the yaml file. + +``` +domain-server: + image: + +assignment-client: + image: + +``` + + - run the following command in your terminal. + + ``` + docker-compose up -d --scale assignment-client=6 + ``` + + - after running the above command, check all running and stopped containers by typing (or you can find the containers on docker desktop if you have). + +``` +docker ps +``` + + ``` + docker ps -a + ``` + + --- + + ## _How to check the servers in the containers are operating properly_ + + - start vircadia and type localhost in explore app. + + - type "localhost:40100" in your web explorer. + + - you should see seven (or six) nodes by clicking Nodes on top. + + --- + + ## _Note: the other five assigment client containers have to be started manually either through terminal or docker desktop_ \ No newline at end of file diff --git a/pkg-scripts/docker-compose-generation/docker-compose.yml b/pkg-scripts/docker-compose-generation/docker-compose.yml new file mode 100644 index 00000000000..b3318fcd248 --- /dev/null +++ b/pkg-scripts/docker-compose-generation/docker-compose.yml @@ -0,0 +1,19 @@ +# We need 7 containers in total, one domain server +# + six assignment clients +# -a 172.17.0.1 + +version: "3.8" +services: + domain-server: + image: james422481/vircadia_server:1 + ports: + - "40100:40100/tcp" + - "40102:40102/udp" + command: /opt/vircadia/domain-server + assignment-client: + image: james422481/vircadia_server:1 + ports: + - "40200-40205:40200/udp" + extra_hosts: + - "host.docker.internal:host-gateway" + command: /opt/vircadia/assignment-client -a host.docker.internal -p 40200 --server-port 40102 --disable-domain-port-auto-discovery From 9b126cff1511077d03cb0bf6ddd8a9008169882a Mon Sep 17 00:00:00 2001 From: JamesGai <110001632+JamesGai@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:52:36 +1300 Subject: [PATCH 8/8] Delete ignore Signed-off-by: JamesGai <110001632+JamesGai@users.noreply.github.com> --- pkg-scripts/docker-compose-generation/ignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 pkg-scripts/docker-compose-generation/ignore diff --git a/pkg-scripts/docker-compose-generation/ignore b/pkg-scripts/docker-compose-generation/ignore deleted file mode 100644 index 8b137891791..00000000000 --- a/pkg-scripts/docker-compose-generation/ignore +++ /dev/null @@ -1 +0,0 @@ -