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
+13-21Lines changed: 13 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,23 +206,23 @@ For the use case of running the server, you will need to modify these settings t
206
206
207
207
Pre-start
208
208
^^^^^^^^^
209
-
Once your environment is ready to go, you can use ``docker-compose`` to bring the containers up. This command will create four containers to run different parts of the application stack (the Runestone server, redis cache, postgres DB, jobe code testing environment).
209
+
Once your environment is ready to go, you can use ``dockercompose`` to bring the containers up. This command will create four containers to run different parts of the application stack (the Runestone server, redis cache, postgres DB, jobe code testing environment).
210
210
211
211
For the use case of running the server, execute:
212
212
213
213
.. code-block:: bash
214
214
215
-
docker-compose up -d
215
+
dockercompose up -d
216
216
217
-
This run the container in the background (detached mode). Use ``docker-compose logs --follow`` to view logging data as the container starts up and runs.
217
+
This run the container in the background (detached mode). Use ``dockercompose logs --follow`` to view logging data as the container starts up and runs.
218
218
219
219
**OR**
220
220
221
221
For the developer use case, execute:
222
222
223
223
.. code-block:: bash
224
224
225
-
docker-compose up
225
+
dockercompose up
226
226
227
227
This displays logging data from the container in the terminal. To Stop the container, press when ctrl-c.
228
228
@@ -254,11 +254,11 @@ No books are installed by default; you must add books using the following proces
After cloning a book, you may need to add it to the database. Most of the standard books are already there, but you can use ``rsmanage addcourse`` to add it if needed.
257
258
258
259
.. note::
259
260
260
-
TODO: Edit/improve the docs from this point forward.
261
-
261
+
PreTeXt authors, see `Publishing to Runestone Academy <https://pretextbook.org/doc/guide/html/sec-publishing-to-runestone-academy.html>`_. The following information applies only *authoring* books using the Runestone.
262
262
263
263
.. warning::
264
264
@@ -268,8 +268,6 @@ No books are installed by default; you must add books using the following proces
268
268
If there is a mismatch, you will want to rename the folder you cloned the code into so that it
269
269
matches the ``project_name``.
270
270
271
-
After cloning a book, you may need to add it to the database. Most of the standard books are already there, but you can use ``rsmanage addcourse`` to add it if needed.
272
-
273
271
.. note::
274
272
275
273
Most Runestone books set ``master_url`` to ``get_master_url()`` in their ``pavement.py`` file. However, if the book
@@ -349,7 +347,7 @@ trying to load the same records and entering a restart loop because the records
349
347
350
348
Operation
351
349
---------
352
-
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.
350
+
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**.
353
351
354
352
355
353
Other Tips & Tricks
@@ -423,12 +421,12 @@ Testing the Entrypoint
423
421
**********************************
424
422
425
423
If you want to test the script, the easiest thing
426
-
to do is add a command to the docker-compose to disable it, and then run commands
424
+
to do is add a command to the ``dockercompose`` to disable it, and then run commands
427
425
interactively by shelling into the container.
428
426
429
427
Bring up the containers and then shell inside. Once inside, you can then issue commands
430
428
to test the entry point script - since the other containers were started
431
-
with docker-compose everything in them is ready to go.
429
+
with ``dockercompose`` everything in them is ready to go.
432
430
433
431
File Permissions
434
432
**********************************
@@ -441,23 +439,17 @@ container enough privileges to do your work.
441
439
Writing Your Own Book
442
440
**********************************
443
441
442
+
.. note::
443
+
444
+
PreTeXt authors, see `Publishing to Runestone Academy <https://pretextbook.org/doc/guide/html/sec-publishing-to-runestone-academy.html>`_. The following information applies only *authoring* books using the Runestone.
445
+
444
446
If you are writing your own book you will want to get that book set up properly in the Runestone
445
447
system. You need to do the following:
446
448
447
449
#. Run the command ``rsmanage addcourse``. Use the project name you configured in ``pavement.py`` as the name of BOTH the course and the basecourse when it asks.
448
450
449
451
#. Now that your course is registered, rebuild it using the command ``rsmanage build --course <book_name>`` command.
450
452
451
-
#. If this book is a PreTeXt book you will need to navigate to the directory that contains the ``runestone-manifest.xml`` file and run the command:
Copy file name to clipboardExpand all lines: docker/docker_tools.py
+23-31Lines changed: 23 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@
67
67
# Local application bootstrap
68
68
# ---------------------------
69
69
# Everything after this depends on Unix utilities. We can't use ``is_win`` because we don't know if ``ci_utils`` is available.
70
-
ifsys.platform=="win32":
70
+
ifsys.platform=="win32x":
71
71
sys.exit("ERROR: You must run this program in WSL/VirtualBox/VMWare/etc.")
72
72
73
73
# See if we're root.
@@ -180,16 +180,6 @@ def pip_user() -> str:
180
180
print("Note: this must be an initial install; additional commands missing.")
181
181
182
182
183
-
# Global variables
184
-
# ================
185
-
# .. note::
186
-
#
187
-
# Update these regularly!
188
-
#
189
-
# See the `Docker compose release page <https://github.com/docker/compose/releases>`_ for the latest version.
190
-
DOCKER_COMPOSE_VERSION="2.29.2"
191
-
192
-
193
183
# CLI
194
184
# ===
195
185
# Create a series of subcommands for this CLI.
@@ -207,15 +197,6 @@ def cli() -> None:
207
197
208
198
# ``init`` command
209
199
# ================
210
-
# Check if we're running in WSL or OS X -- don't install Docker if so.
211
-
defcheck_requires_docker_desktop() ->None:
212
-
if (is_linuxand"WSL"inPath("/proc/version").read_text()) oris_darwin:
213
-
sys.exit(
214
-
"ERROR: Docker Desktop not detected. You must install and run this\n"
215
-
"before proceeding."
216
-
)
217
-
218
-
219
200
@cli.command()
220
201
@click.option(
221
202
"--clone-rs",
@@ -237,9 +218,16 @@ def init(
237
218
try:
238
219
xqt("docker --version")
239
220
exceptsubprocess.CalledProcessErrorase:
240
-
check_requires_docker_desktop()
221
+
print(f"Unable to run docker: {e}")
222
+
# Ensure the Docker Desktop is running if we're running in WSL. On Windows, the ``docker`` command doesn't exist when the Docker Desktop isn't running.
# The group add doesn't take effect until the user logs out then back in. Work around it for now.
259
247
did_group_add=True
260
248
261
-
# Ensure docker-compose is installed.
249
+
# Ensure the Docker Desktop is running if this is OS X. On OS X, the ``docker`` command exists, but can't run the hello, world script. It also serves as a sanity check for the other platforms.
250
+
print("Checking that Docker works...")
262
251
try:
263
-
xqt("docker-compose --version")
252
+
xqt("docker run hello-world")
264
253
exceptsubprocess.CalledProcessErrorase:
265
-
check_requires_docker_desktop()
266
-
print(f"Unable to run docker-compose: {e} Installing...")
267
-
# This is from the `docker-compose install instructions <https://docs.docker.com/compose/install/#install-compose-on-linux-systems>`_.
"poetry run celery --app=scheduled_builder worker --pool=threads "
91
-
"--concurrency=3 --loglevel=info &",
91
+
"--concurrency=3 --loglevel=info "
92
+
# This redirect ensures output ends up in the Docker log even if the servers are restarted. Sending to ``/dev/stdout`` only works at initial startup, but doesn't redirect after the servers are restarted. For more discussion, see `Github <https://github.com/moby/moby/issues/19616#issuecomment-174355979>`_.
Run unit tests. All tests are disabled by default; manually select which test to run.
183
190
184
191
PASSTHROUGH: These arguments are passed directly to the underlying "pytest" command. To pass options to this command, prefix this argument with "--". For example, use "docker_tools.py test -- -k test_just_this" instead of "docker_tools.py test -k test_just_this" (which produces an error).
185
192
186
193
"""
187
194
ensure_in_docker()
195
+
ifnotbksandnotrcandnotrs:
196
+
sys.exit(
197
+
"ERROR: No tests selected to run. Pass any combination of --rs, --rs,\n"
198
+
"and/or --bks."
199
+
)
188
200
_stop_servers()
189
201
pytest="$RUNESTONE_PATH/.venv/bin/pytest"
190
202
passthrough_args=" ".join(passthrough)
@@ -261,7 +273,7 @@ def ensure_in_docker(
261
273
returnTrue
262
274
# Get the name of the container running the Runestone servers.
Copy file name to clipboardExpand all lines: pyproject.toml
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ pathlib2 = "^2.0.0"
36
36
Paver = ">= 1.2.4"
37
37
# This is actually an rsmanage dependency. It's here so that rsmanage can be installed without installing this, which requires Postgres (available only in the container).
0 commit comments