You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 30, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docker/README.rst
+62-18Lines changed: 62 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ Docker Deployment
3
3
4
4
.. TODO
5
5
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?
7
7
8
8
Enable the script to download and install the Docker Desktop if necessary.
9
9
@@ -60,6 +60,10 @@ If running on OS X, install then run the `Docker Desktop <https://www.docker.com
60
60
61
61
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.
62
62
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.
@@ -89,15 +93,51 @@ Next, install ``curl`` by opening an Ubuntu terminal then typing:
89
93
90
94
sudo apt-get install -y curl
91
95
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
+
94
105
Next, download the bootstrap script. To do this, open a terminal in Ubuntu or OS X then type:
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
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.
101
141
102
142
Use case: running the server
103
143
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -109,11 +149,11 @@ For the use case of running the server, execute:
109
149
110
150
**OR**
111
151
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
#. `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>`_.
117
157
118
158
#. In the terminal, run:
119
159
@@ -125,7 +165,7 @@ For the developer use case:
125
165
126
166
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.
127
167
128
-
3. Build the necessary containers
168
+
5. Build the necessary containers
129
169
*********************************
130
170
In the terminal, type:
131
171
@@ -141,10 +181,6 @@ The next command depends on the use case you chose in the previous step.
141
181
142
182
Pre-build
143
183
^^^^^^^^^
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
-
148
184
For the use case of running the server, execute:
149
185
150
186
.. code-block:: bash
@@ -169,9 +205,11 @@ The build will take a **long** time (5-10 minutes in many cases). When this comp
169
205
170
206
#. **Reboot your computer** to update your group membership.
171
207
#. 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``.
173
211
174
-
4. Configuration
212
+
6. Configuration
175
213
***********************
176
214
177
215
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
201
239
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.
202
240
203
241
204
-
5. Starting the containerized application
242
+
7. Starting the containerized application
205
243
*****************************************
206
244
207
245
Pre-start
@@ -229,7 +267,7 @@ For the developer use case, execute:
229
267
230
268
Post-start
231
269
^^^^^^^^^^
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.
233
271
234
272
Introducing ``rsmanage``
235
273
^^^^^^^^^^^^^^^^^^^^^^^^
@@ -244,7 +282,7 @@ The ``rsmanage`` command will run many useful commands inside the container for
244
282
...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``.
245
283
246
284
247
-
6. Add books
285
+
8. Add books
248
286
**************************
249
287
250
288
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
276
314
If you are running docker on a remote host then make sure to set it to the name of the remote host.
277
315
278
316
279
-
7. Add courses
317
+
9. Add courses
280
318
**************************
281
319
282
320
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.
309
347
a course with a name like ``thinkcspy`` you will be told that the course name is the same as the book.
310
348
311
349
312
-
8. Add a user
350
+
10. Add a user
313
351
**************************
314
352
315
353
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
349
387
---------
350
388
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**.
351
389
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>`_.
0 commit comments