Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 7eefdc1

Browse files
committed
Docs: Improvements after working with Barb to install the servers.
1 parent 24d4374 commit 7eefdc1

File tree

1 file changed

+62
-18
lines changed

1 file changed

+62
-18
lines changed

docker/README.rst

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Docker Deployment
33

44
.. TODO
55
6-
Docs to update:
6+
Is there some way to simplify these instructions? It's still a long, error-prone process! Do we need another setup script that follows these directions and prompts the user for input (do you want to run the server or do development? What is your github userid? Etc.)? Such a script would be able to take care of the first 7 steps, which would be good progress. But, we'd need os-dependent stuff for the first bits (install WSL/Ubuntu on Windows); can we assume Python 3 on Mac?
77
88
Enable the script to download and install the Docker Desktop if necessary.
99
@@ -60,6 +60,10 @@ If running on OS X, install then run the `Docker Desktop <https://www.docker.com
6060

6161
Expect to wait a few minutes the first time you start the Docker Desktop. Don't proceed until the Docker Desktop's initialization is complete.
6262

63+
On OS X 12.4, Apple's new security features require you to give Docker `additional permissions <https://support.apple.com/guide/mac-help/control-access-to-files-and-folders-on-mac-mchld5a35146/mac>`_ if you place the files you install below in the Documents folder.
64+
65+
Next, `install Python 3 <https://docs.python-guide.org/starting/install3/osx/>`_.
66+
6367
Windows
6468
^^^^^^^
6569
If running on Windows, either:
@@ -89,15 +93,51 @@ Next, install ``curl`` by opening an Ubuntu terminal then typing:
8993
9094
sudo apt-get install -y curl
9195
92-
2. Run the bootstrap script
93-
***************************
96+
2. Download the bootstrap script
97+
********************************
98+
To keep your filesystem tidy, create a directory before running the following commands, since these commands download several scripts and subdirectories. To do this:
99+
100+
.. code-block:: bash
101+
102+
mkdir runestone
103+
cd runestone
104+
94105
Next, download the bootstrap script. To do this, open a terminal in Ubuntu or OS X then type:
95106

96107
.. code-block:: bash
97108
98109
curl -fLO https://raw.githubusercontent.com/RunestoneInteractive/RunestoneServer/master/docker/docker_tools.py
99110
100-
This download the bootstrap script. The next step, which installs required dependencies for the remainder of the process, depends on the two mutually exclusive use cases below. **Remember which use case you select**; many of the following steps vary based on your use case.
111+
This download the bootstrap script.
112+
113+
114+
3. Create then activate a Python virtual environment
115+
****************************************************
116+
A Python virtual environment ensures that all the Python dependencies installed by this process don't interfere with your global / system Python installation.
117+
118+
#. `Create a Python virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment>`_ named ``runestone``:
119+
120+
.. code-block:: bash
121+
122+
python3 -m venv runestone
123+
124+
#. `Activate the virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment>`_ you just created.
125+
126+
On Windows:
127+
128+
.. code-block:: bash
129+
130+
runestone\Scripts\activate
131+
132+
On Linux and OS X:
133+
134+
.. code-block:: bash
135+
136+
. runestone/bin/activate
137+
138+
4. Run the bootstrap script
139+
***************************
140+
The next step, which installs required dependencies for the remainder of the process, depends on the two mutually exclusive use cases below. **Remember which use case you select**; many of the following steps vary based on your use case.
101141

102142
Use case: running the server
103143
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -109,11 +149,11 @@ For the use case of running the server, execute:
109149
110150
**OR**
111151

112-
Use case: change the way Runestone works or change/add to the way `interactive exercises <https://pretextbook.org/doc/guide/html/topic-interactive-exercises.html>`_ behave
152+
Use case: in addition to running the server, change the way Runestone works or change/add to the way `interactive exercises <https://pretextbook.org/doc/guide/html/topic-interactive-exercises.html>`_ behave
113153
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114154
For the developer use case:
115155

116-
#. `Fork <https://docs.github.com/en/get-started/quickstart/fork-a-repo>`_ the `RunestoneServer <https://github.com/RunestoneInteractive/RunestoneServer.git>`_, `RunestoneComponents <https://github.com/RunestoneInteractive/RunestoneComponents.git>`_, and `BookServer <https://github.com/RunestoneInteractive/BookServer.git>`_ repositories.
156+
#. `Fork <https://docs.github.com/en/get-started/quickstart/fork-a-repo>`_ the `RunestoneServer <https://github.com/RunestoneInteractive/RunestoneServer.git>`_, `RunestoneComponents <https://github.com/RunestoneInteractive/RunestoneComponents.git>`_, and `BookServer <https://github.com/RunestoneInteractive/BookServer.git>`_ repositories. If you've already forked these repositories, `fetch the latest updates from these upstream repositories <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork>`_.
117157

118158
#. In the terminal, run:
119159

@@ -125,7 +165,7 @@ For the developer use case:
125165

126166
On Windows using Ubuntu under WSL2: if you see the error message "Docker Desktop not detected..." but you are running the Docker Desktop, then click the gear (settings) icon in Docker Desktop, select Resources then WSL Integration, and make sure the switch next to Ubuntu is turned on.
127167

128-
3. Build the necessary containers
168+
5. Build the necessary containers
129169
*********************************
130170
In the terminal, type:
131171

@@ -141,10 +181,6 @@ The next command depends on the use case you chose in the previous step.
141181

142182
Pre-build
143183
^^^^^^^^^
144-
.. warning::
145-
146-
On OS X, use ``python3 -m docker_tools`` instead of ``docker-tools`` in the following instructions. Likewise, use ``python3 -m rsmanage`` instead of ``rsmanage``.
147-
148184
For the use case of running the server, execute:
149185

150186
.. code-block:: bash
@@ -169,9 +205,11 @@ The build will take a **long** time (5-10 minutes in many cases). When this comp
169205

170206
#. **Reboot your computer** to update your group membership.
171207
#. Run the Docker Desktop if using WSL on Windows or using OS X.
172-
#. Open a terminal then ``cd RunestoneServer``.
208+
#. Open a terminal then ``cd runestone``.
209+
#. Activate your virtual environment -- see the second step of `create a virtual environment <Create then activate a Python virtual environment>`_.
210+
#. ``cd RunestoneServer``.
173211

174-
4. Configuration
212+
6. Configuration
175213
***********************
176214

177215
Most basic configuration can be done via two files you will need to create. These files
@@ -201,7 +239,7 @@ For the use case of running the server, you will need to modify these settings t
201239
You will NOT want to check either ``.env`` or ``models/1.py`` into source control, since these contain passwords. The ``.gitignore`` file is set to ignore both of them.
202240

203241

204-
5. Starting the containerized application
242+
7. Starting the containerized application
205243
*****************************************
206244

207245
Pre-start
@@ -229,7 +267,7 @@ For the developer use case, execute:
229267

230268
Post-start
231269
^^^^^^^^^^
232-
The first time you run the command will take a **lot** longer as it downloads containers then installs software into the various containers. You may ignore a red message about the Jobe container. After it is complete, you can go to http://localhost/ to see the application (if you configured a hostname, substitute it for localhost). If everything so far is set up correctly, you should see a welcome/login page. Continue in the instructions to add book(s), course(s) and a user account.
270+
The first time you run the command will take a **lot** longer as it downloads containers then installs software into the various containers. You may ignore the red message ``jobe error`` that appears during this process. After it is complete, you can go to http://localhost/ to see the application (if you configured a hostname, substitute it for localhost). If everything so far is set up correctly, you should see a welcome/login page. Continue in the instructions to add book(s), course(s) and a user account.
233271

234272
Introducing ``rsmanage``
235273
^^^^^^^^^^^^^^^^^^^^^^^^
@@ -244,7 +282,7 @@ The ``rsmanage`` command will run many useful commands inside the container for
244282
...and many other things. Just type ``rsmanage`` for a list of things it can do. For a list of options just type ``rsmanage`` and the subcommand you want followed by ``--help``; for example, ``rsmanage build --help``.
245283

246284

247-
6. Add books
285+
8. Add books
248286
**************************
249287

250288
No books are installed by default; you must add books using the following process. To add a book, you need to add its source code to the ``RunestoneServer/books/`` directory. Typically, that means cloning its source code. For example, to add
@@ -276,7 +314,7 @@ After cloning a book, you may need to add it to the database. Most of the stand
276314
If you are running docker on a remote host then make sure to set it to the name of the remote host.
277315

278316

279-
7. Add courses
317+
9. Add courses
280318
**************************
281319

282320
To add a course based on a book, run the ``rsmanage addcourse`` script. If you run it just like
@@ -309,7 +347,7 @@ You do not have to restart the server to make use of the course.
309347
a course with a name like ``thinkcspy`` you will be told that the course name is the same as the book.
310348

311349

312-
8. Add a user
350+
10. Add a user
313351
**************************
314352

315353
To add an initial instructor account to the course you have created, you can either create a new user or add
@@ -349,6 +387,12 @@ Operation
349387
---------
350388
The containerized application is configured to automatically start as soon as Docker / the Docker Desktop is started. Therefore, on OS X or Windows (when using WSL2): after a reboot or after manually shutting down the Docker Desktop, **remember to start the Docker Desktop application**.
351389

390+
Before using ``docker-tools`` or ``rsmanage``:
391+
392+
#. Open a terminal then ``cd runestone``.
393+
#. Activate your virtual environment -- see the second step of `create a virtual environment <Create then activate a Python virtual environment>`_.
394+
#. ``cd RunestoneServer``.
395+
352396

353397
Other Tips & Tricks
354398
-------------------------------

0 commit comments

Comments
 (0)