From f592294335396215b2fa72edf9967fe3db4f3c42 Mon Sep 17 00:00:00 2001 From: brybalicious Date: Wed, 7 Oct 2020 21:20:43 +0200 Subject: [PATCH 1/4] Added scripts to conveniently start server instance via docker or replication --- scripts/start_server/run-dockerfile.sh | 9 +++++++++ scripts/start_server/start-server.sh | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 scripts/start_server/run-dockerfile.sh create mode 100644 scripts/start_server/start-server.sh diff --git a/scripts/start_server/run-dockerfile.sh b/scripts/start_server/run-dockerfile.sh new file mode 100644 index 0000000..6880530 --- /dev/null +++ b/scripts/start_server/run-dockerfile.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +# Start server in docker container, from image hosted on the multi-user gitlab's container registry +docker run -d \ + -p 5555-5560:5555-5560 \ + -e port=5555 \ + -e password=admin \ + -e timeout=1000 \ + registry.gitlab.com/slumber/multi-user/multi-user-server:0.1.0 \ No newline at end of file diff --git a/scripts/start_server/start-server.sh b/scripts/start_server/start-server.sh new file mode 100644 index 0000000..09b8db6 --- /dev/null +++ b/scripts/start_server/start-server.sh @@ -0,0 +1,5 @@ +#! /bin/bash + +# Start replication server locally, and include logging (requires replication_version=0.0.21a15) +clear +replication.serve -p 5555 -pwd admin -t 1000 -l INFO -lf server.log \ No newline at end of file From fbfff6c7ec612754d071257b97263bd7a791c80d Mon Sep 17 00:00:00 2001 From: brybalicious Date: Thu, 8 Oct 2020 00:08:23 +0200 Subject: [PATCH 2/4] Doc updates clarifying developer workflow, updating hosting instructions --- docs/tutorials/hosting_guide.rst | 50 +++++++++++++++++++++++--------- docs/ways_to_contribute.rst | 23 +++++++++++---- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/docs/tutorials/hosting_guide.rst b/docs/tutorials/hosting_guide.rst index a441769..d240e75 100644 --- a/docs/tutorials/hosting_guide.rst +++ b/docs/tutorials/hosting_guide.rst @@ -171,26 +171,28 @@ From the dedicated server run it at home for LAN but for internet hosting you need to follow the :ref:`port-forwarding` setup first. The dedicated server allow you to host a session with simplicity from any location. -It was developed to improve intaernet hosting performance. +It was developed to improve internet hosting performance. -The dedicated server can be run in tow ways: +The dedicated server can be run in two ways: - :ref:`cmd-line` - :ref:`docker` +Note, there are shell scripts to conveniently start a dedicated server via either of these approaches available in the gitlab repository: :ref:`serverstartscripts` + .. _cmd-line: Using a regular command line ---------------------------- -You can run the dedicated server on any platform by following those steps: +You can run the dedicated server on any platform by following these steps: 1. Firstly, download and intall python 3 (3.6 or above). -2. Install the replication library: +2. Install the latest version of the replication library: .. code-block:: bash - python -m pip install replication + python -m pip install replication==0.0.21a15 4. Launch the server with: @@ -199,17 +201,20 @@ You can run the dedicated server on any platform by following those steps: replication.serve .. hint:: - You can also specify a custom **port** (-p), **timeout** (-t), **admin password** (-pwd), **log level(ERROR, WARNING, INFO or DEBUG)** (-l) and **log file** (-lf) with the following optionnal argument + You can also specify a custom **port** (-p), **timeout** (-t), **admin password** (-pwd), **log level(ERROR, WARNING, INFO or DEBUG)** (-l) and **log file** (-lf) with the following optional arguments .. code-block:: bash - replication.serve -p 5555 -pwd toto -t 1000 -l INFO -lf server.log + replication.serve -p 5555 -pwd admin -t 1000 -l INFO -lf server.log + +Here, for example, a server is instantiated on port 5555, with password 'admin', a 1 second timeout, and logging enabled. + +As soon as the dedicated server is running, you can connect to it from blender by following :ref:`how-to-join`. -As soon as the dedicated server is running, you can connect to it from blender (follow :ref:`how-to-join`). .. hint:: - Some commands are available to manage the session. Check :ref:`dedicated-management` to learn more. + Some commands are available to enable an administrator to manage the session. Check :ref:`dedicated-management` to learn more. .. _docker: @@ -217,7 +222,7 @@ As soon as the dedicated server is running, you can connect to it from blender ( Using a pre-configured image on docker engine --------------------------------------------- -Launching the dedicated server from a docker server is simple as: +Launching the dedicated server from a docker server is simple as running: .. code-block:: bash @@ -226,13 +231,30 @@ Launching the dedicated server from a docker server is simple as: -e port=5555 \ -e password=admin \ -e timeout=1000 \ - registry.gitlab.com/slumber/multi-user/multi-user-server:0.0.3 + registry.gitlab.com/slumber/multi-user/multi-user-server:0.1.0 -As soon as the dedicated server is running, you can connect to it from blender. -You can check the :ref:`how-to-join` section. +As soon as the dedicated server is running, you can connect to it from blender by following :ref:`how-to-join`. + + +.. _serverstartscripts: + +Server startup scripts +---------------------- + +Convenient scripts are available in the Gitlab repository: https://gitlab.com/slumber/multi-user/scripts/startup_scripts/ + +Simply run the relevant script in a shell on the host machine to start a server via replication or docker with one line of code. Choose between the two methods above: + + .. code-block:: bash + ./start-server.sh + +or + + .. code-block:: bash + ./run-dockerfile.sh .. hint:: - Some commands are available to manage the session. Check :ref:`dedicated-management` to learn more. + Once your server is up and running, some commands are available to manage the session :ref:`dedicated-management` .. _dedicated-management: diff --git a/docs/ways_to_contribute.rst b/docs/ways_to_contribute.rst index 0c63d1a..f354607 100644 --- a/docs/ways_to_contribute.rst +++ b/docs/ways_to_contribute.rst @@ -35,8 +35,21 @@ Here are some useful information you should provide in a bug report: Contributing code ================= -1. Fork it (https://gitlab.com/yourname/yourproject/fork) -2. Create your feature branch (git checkout -b feature/fooBar) -3. Commit your changes (git commit -am 'Add some fooBar') -4. Push to the branch (git push origin feature/fooBar) -5. Create a new Pull Request +1. Fork the project into a new repository: https://gitlab.com/yourname/multi-user +2. Clone the new repository locally: + .. code-block:: bash + git clone https://gitlab.com/yourname/multi-user.git +3. Create your own feature branch from the develop branch, using the syntax: + .. code-block:: bash + git checkout -b feature/yourfeaturename + where 'feature/' designates a feature branch, and 'yourfeaturename' is a name of your choosing +4. Pull any recent changes from the 'develop' branch: + .. code-block:: bash + git pull +5. Add and commit your changes, including a commit message: + .. code-block:: bash + git commit -am 'Add fooBar' +6. Push committed changes to the remote feature branch you created + .. code-block:: bash + git push origin feature/yourfeaturename +7. Create a new Pull Request on Gitlab to merge the changes into the develop branch \ No newline at end of file From f779678c0e6934449fb0d20d5d5a3cd76be0d968 Mon Sep 17 00:00:00 2001 From: brybalicious Date: Thu, 8 Oct 2020 18:31:20 +0200 Subject: [PATCH 3/4] Updates to hosting guide and contribution documentation --- docs/tutorials/hosting_guide.rst | 25 +++++++++++++++--- docs/ways_to_contribute.rst | 44 ++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 18 deletions(-) diff --git a/docs/tutorials/hosting_guide.rst b/docs/tutorials/hosting_guide.rst index d240e75..5bca33d 100644 --- a/docs/tutorials/hosting_guide.rst +++ b/docs/tutorials/hosting_guide.rst @@ -144,7 +144,7 @@ Let's check the connection status. Right click on the tray icon and click on **S Network status. The network status must be **OK** for each user(like in the picture above) otherwise it means that you are not connected to the network. -If you see something like **ACCESS_DENIED**, it means that you were not authorized to join the network. Please check the :ref:`network-authorization` section. +If you see something like **ACCESS_DENIED**, it means that you were not authorized to join the network. Please check the section :ref:`network-authorization` This is it for the ZeroTier network setup. Now everything should be setup to use the multi-user add-on over internet ! You can now follow the :ref:`quickstart` guide to start using the multi-user add-on ! @@ -178,7 +178,7 @@ The dedicated server can be run in two ways: - :ref:`cmd-line` - :ref:`docker` -Note, there are shell scripts to conveniently start a dedicated server via either of these approaches available in the gitlab repository: :ref:`serverstartscripts` +.. Note:: There are shell scripts to conveniently start a dedicated server via either of these approaches available in the gitlab repository. See section: :ref:`serverstartscripts` .. _cmd-line: @@ -201,7 +201,7 @@ You can run the dedicated server on any platform by following these steps: replication.serve .. hint:: - You can also specify a custom **port** (-p), **timeout** (-t), **admin password** (-pwd), **log level(ERROR, WARNING, INFO or DEBUG)** (-l) and **log file** (-lf) with the following optional arguments + You can also specify a custom **port** (-p), **timeout** (-t), **admin password** (-pwd), **log level (ERROR, WARNING, INFO or DEBUG)** (-l) and **log file** (-lf) with the following optional arguments .. code-block:: bash @@ -229,12 +229,27 @@ Launching the dedicated server from a docker server is simple as running: docker run -d \ -p 5555-5560:5555-5560 \ -e port=5555 \ + -e log_level=DEBUG \ -e password=admin \ -e timeout=1000 \ registry.gitlab.com/slumber/multi-user/multi-user-server:0.1.0 As soon as the dedicated server is running, you can connect to it from blender by following :ref:`how-to-join`. +You can check your container is running, and find its ID with: + +.. code-block:: bash + + docker ps + +Logs for the server running in the docker container can be accessed by outputting the following to a log file: + +.. code-block:: bash + + docker log your-container-id >& dockerserver.log + +.. Note:: If using WSL2 on Windows 10 (Windows Subsystem for Linux), it is preferable to run a dedicated server via regular command line approach (or the associated startup script) from within Windows - docker desktop for windows 10 usually uses the WSL2 backend where it is available. + .. _serverstartscripts: @@ -243,14 +258,16 @@ Server startup scripts Convenient scripts are available in the Gitlab repository: https://gitlab.com/slumber/multi-user/scripts/startup_scripts/ -Simply run the relevant script in a shell on the host machine to start a server via replication or docker with one line of code. Choose between the two methods above: +Simply run the relevant script in a shell on the host machine to start a server with one line of code via replication directly or via a docker container. Choose between the two methods: .. code-block:: bash + ./start-server.sh or .. code-block:: bash + ./run-dockerfile.sh .. hint:: diff --git a/docs/ways_to_contribute.rst b/docs/ways_to_contribute.rst index f354607..9969553 100644 --- a/docs/ways_to_contribute.rst +++ b/docs/ways_to_contribute.rst @@ -21,7 +21,7 @@ In order to help with the testing, you have several possibilities: - Test `development branch `_ -------------------------- -Filling an issue on Gitlab +Filing an issue on Gitlab -------------------------- The `gitlab issue tracker `_ is used for bug report and enhancement suggestion. @@ -35,21 +35,37 @@ Here are some useful information you should provide in a bug report: Contributing code ================= -1. Fork the project into a new repository: https://gitlab.com/yourname/multi-user +In general, this project follows the `Gitflow Workflow `_. +The following example suggests how to contribute a feature. + +1. Fork the project into a new repository: + https://gitlab.com/yourname/multi-user + 2. Clone the new repository locally: - .. code-block:: bash - git clone https://gitlab.com/yourname/multi-user.git + .. code-block:: bash + + git clone https://gitlab.com/yourname/multi-user.git + 3. Create your own feature branch from the develop branch, using the syntax: - .. code-block:: bash - git checkout -b feature/yourfeaturename - where 'feature/' designates a feature branch, and 'yourfeaturename' is a name of your choosing + .. code-block:: bash + + git checkout -b feature/yourfeaturename + ...where 'feature/' designates a feature branch, and 'yourfeaturename' is a name of your choosing + 4. Pull any recent changes from the 'develop' branch: - .. code-block:: bash - git pull + .. code-block:: bash + + git pull 5. Add and commit your changes, including a commit message: - .. code-block:: bash - git commit -am 'Add fooBar' + .. code-block:: bash + + git commit -am 'Add fooBar' 6. Push committed changes to the remote feature branch you created - .. code-block:: bash - git push origin feature/yourfeaturename -7. Create a new Pull Request on Gitlab to merge the changes into the develop branch \ No newline at end of file + .. code-block:: bash + + git push origin feature/yourfeaturename +7. Create a new Pull Request on Gitlab + merging the changes into the develop branch + +.. Note:: For hotfixes, replace 'feature/' with 'hotfix/' and fork from 'master' branch instead of 'develop' branch +.. Note:: Let's follow the Atlassian `Gitflow Workflow `_, except for one main difference - submitting a pull request rather than merging by ourselves. \ No newline at end of file From 7892b5e9b6c7e1003561d9d3f5abbc6b5399223d Mon Sep 17 00:00:00 2001 From: brybalicious Date: Thu, 8 Oct 2020 18:35:08 +0200 Subject: [PATCH 4/4] Adding log-level to server startup scripts --- scripts/start_server/run-dockerfile.sh | 1 + scripts/start_server/start-server.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/start_server/run-dockerfile.sh b/scripts/start_server/run-dockerfile.sh index 6880530..d843f02 100644 --- a/scripts/start_server/run-dockerfile.sh +++ b/scripts/start_server/run-dockerfile.sh @@ -4,6 +4,7 @@ docker run -d \ -p 5555-5560:5555-5560 \ -e port=5555 \ + -e log-level DEBUG \ -e password=admin \ -e timeout=1000 \ registry.gitlab.com/slumber/multi-user/multi-user-server:0.1.0 \ No newline at end of file diff --git a/scripts/start_server/start-server.sh b/scripts/start_server/start-server.sh index 09b8db6..f2c9579 100644 --- a/scripts/start_server/start-server.sh +++ b/scripts/start_server/start-server.sh @@ -2,4 +2,4 @@ # Start replication server locally, and include logging (requires replication_version=0.0.21a15) clear -replication.serve -p 5555 -pwd admin -t 1000 -l INFO -lf server.log \ No newline at end of file +replication.serve -p 5555 -pwd admin -t 1000 -l DEBUG -lf server.log \ No newline at end of file