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

Commit 865a134

Browse files
committed
Merge remote-tracking branch 'Brad/master' into celery-move
2 parents df70c90 + 790ce12 commit 865a134

File tree

12 files changed

+218
-141
lines changed

12 files changed

+218
-141
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ ENV DOCKER_BUILD_ARGS=${DOCKER_BUILD_ARGS}
1919
# Define some ARGs which could be passed into while building.
2020
#
2121
# **Warning:** Changing this path will require changes in many other places: the Docker volume locations, the paths in ``pyproject.toml``, paths used to run tests, etc.
22-
ARG WEB2PY_PATH=/srv/web2py
23-
# And export some as env vars so they could be available at run time
24-
ENV WEB2PY_PATH=${WEB2PY_PATH}
22+
ENV WEB2PY_PATH=/srv/web2py
2523
ENV RUNESTONE_PATH=${WEB2PY_PATH}/applications/runestone
24+
ENV BOOK_SERVER_PATH=/srv/BookServer
2625

2726
# Click needs these encodings for Python 3.
2827
ENV LC_ALL=C.UTF-8

VERSION

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
RunestoneServer-6.0.4
1+
RunestoneServer-6.0.5
2+
3+
Changes in 6.0.5
4+
5+
- fix delete course
6+
- misc peer assignment fixes
7+
- RunestoneServer-6.0.4
28

39
Changes in 6.0.4
410

controllers/admin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,9 @@ def deletecourse():
931931
students.update(course_id=bcid)
932932
uset = db(db.user_courses.course_id == courseid)
933933
uset.delete()
934+
# remove the rows from useinfo
935+
infoset = db(db.useinfo.course_id == course_name)
936+
infoset.delete()
934937
db(db.courses.id == courseid).delete()
935938
try:
936939
session.clear()
@@ -1656,6 +1659,8 @@ def get_assignment_release_states():
16561659
return json.dumps({})
16571660

16581661

1662+
# Called to assemble the list of questions for the assignment builder
1663+
#
16591664
def _get_toc_and_questions():
16601665
# return a dictionary with a nested dictionary representing everything the
16611666
# picker will need in the instructor's assignment authoring tab

docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
version: "3"
55

66
services:
7-
# jobe:
8-
# image: runestone/jobeinabox
9-
# build: ./jobeinabox/
10-
# volumes:
11-
# - ./jobeinabox/files:/usr/local/lib/java
7+
jobe:
8+
image: runestone/jobeinabox
9+
build: ./jobeinabox/
10+
volumes:
11+
- ./jobeinabox/files:/usr/local/lib/java
1212
runestone:
1313
image: runestone/server
1414
restart: always
@@ -56,5 +56,5 @@ services:
5656
GOOGLE_GA: ${GOOGLE_GA}
5757
ADS_FILE: '${ADS_FILE}'
5858
QUICK_START: ${QUICK_START}
59-
# links:
60-
# - jobe
59+
links:
60+
- jobe

docker/README.rst

Lines changed: 70 additions & 25 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,8 @@ 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+
Next, `install Python 3 <https://docs.python-guide.org/starting/install3/osx/>`_.
64+
6365
Windows
6466
^^^^^^^
6567
If running on Windows, either:
@@ -89,15 +91,55 @@ Next, install ``curl`` by opening an Ubuntu terminal then typing:
8991
9092
sudo apt-get install -y curl
9193
92-
2. Run the bootstrap script
93-
***************************
94+
2. Download the bootstrap script
95+
********************************
96+
To keep your filesystem tidy, create a directory before running the following commands, since these commands download several scripts and subdirectories. To do this:
97+
98+
.. code-block:: bash
99+
100+
mkdir rsdocker
101+
cd rsdocker
102+
103+
.. note::
104+
105+
On OS X, avoid placing your files in the Documents folder, since security features introduced in OS X 12.4 require you to give Docker `additional permissions <https://support.apple.com/guide/mac-help/control-access-to-files-and-folders-on-mac-mchld5a35146/mac>`_.
106+
94107
Next, download the bootstrap script. To do this, open a terminal in Ubuntu or OS X then type:
95108

96109
.. code-block:: bash
97110
98111
curl -fLO https://raw.githubusercontent.com/RunestoneInteractive/RunestoneServer/master/docker/docker_tools.py
99112
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.
113+
This downloads the bootstrap script.
114+
115+
116+
3. Create then activate a Python virtual environment
117+
****************************************************
118+
A Python virtual environment ensures that all the Python dependencies installed by this process don't interfere with your global / system Python installation.
119+
120+
#. `Create a Python virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment>`_ named ``rsvenv`` (RuneStone Virtual ENVironment):
121+
122+
.. code-block:: bash
123+
124+
python3 -m venv rsvenv
125+
126+
#. `Activate the virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment>`_ you just created.
127+
128+
On Windows:
129+
130+
.. code-block:: bash
131+
132+
rsvenv\Scripts\activate
133+
134+
On Linux and OS X:
135+
136+
.. code-block:: bash
137+
138+
. rsvenv/bin/activate
139+
140+
4. Run the bootstrap script
141+
***************************
142+
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.
101143

102144
Use case: running the server
103145
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -109,11 +151,11 @@ For the use case of running the server, execute:
109151
110152
**OR**
111153

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
154+
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
113155
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114156
For the developer use case:
115157

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.
158+
#. `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>`_.
117159

118160
#. In the terminal, run:
119161

@@ -125,7 +167,7 @@ For the developer use case:
125167

126168
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.
127169

128-
3. Build the necessary containers
170+
5. Build the necessary containers
129171
*********************************
130172
In the terminal, type:
131173

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

142184
Pre-build
143185
^^^^^^^^^
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-
148186
For the use case of running the server, execute:
149187

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

170208
#. **Reboot your computer** to update your group membership.
171209
#. Run the Docker Desktop if using WSL on Windows or using OS X.
172-
#. Open a terminal then ``cd RunestoneServer``.
210+
#. Open a terminal then ``cd rsvenv``.
211+
#. Activate your virtual environment -- see the second step of `create a virtual environment <Create then activate a Python virtual environment>`_.
212+
#. ``cd RunestoneServer``.
173213

174-
4. Configuration
214+
6. Configuration
175215
***********************
176216

177217
Most basic configuration can be done via two files you will need to create. These files
@@ -201,7 +241,7 @@ For the use case of running the server, you will need to modify these settings t
201241
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.
202242

203243

204-
5. Starting the containerized application
244+
7. Starting the containerized application
205245
*****************************************
206246

207247
Pre-start
@@ -229,7 +269,7 @@ For the developer use case, execute:
229269

230270
Post-start
231271
^^^^^^^^^^
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.
272+
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.
233273

234274
Introducing ``rsmanage``
235275
^^^^^^^^^^^^^^^^^^^^^^^^
@@ -238,21 +278,21 @@ The ``rsmanage`` command will run many useful commands inside the container for
238278
* Add a course - ``rsmanage addcourse``
239279
* Add a user - ``rsmanage adduser``
240280
* Get information about a course ``rsmanage courseinfo``
241-
* Build a book - ``rsmanage build --course bookname``
281+
* Build a book - ``rsmanage build bookname``
242282
* Get a database shell in the current database - ``rsmanage db``
243283

244284
...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``.
245285

246286

247-
6. Add books
287+
8. Add books
248288
**************************
249289

250290
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
251291
`thinkcspy <https://github.com/RunestoneInteractive/thinkcspy>`_:
252292

253293
.. code-block:: bash
254294
255-
rsmanage build --course thinkcspy --clone https://github.com/RunestoneInteractive/thinkcspy.git
295+
rsmanage build thinkcspy --clone https://github.com/RunestoneInteractive/thinkcspy.git
256296
257297
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.
258298

@@ -276,7 +316,7 @@ After cloning a book, you may need to add it to the database. Most of the stand
276316
If you are running docker on a remote host then make sure to set it to the name of the remote host.
277317

278318

279-
7. Add courses
319+
9. Add courses
280320
**************************
281321

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

311351

312-
8. Add a user
352+
10. Add a user
313353
**************************
314354

315355
To add an initial instructor account to the course you have created, you can either create a new user or add
@@ -336,7 +376,7 @@ Once you have logged in as an instructor, you can bulk add students through the
336376
It is also possible to use a csv file to add multiple instructors or students as you start
337377
up the server. However, this process is brittle (any error loading the information results
338378
in the server entering a restart loop as it fails to load). To do so, make a file named either
339-
`instructors.csv` or `students.csv` in a folder called `configs` in the RunestoneServer folder.
379+
`instructors.csv` or `students.csv` in a folder called `configs` in the ``RunestoneServer/`` folder.
340380
The format of the csv files is to have one person per line with the format of each line as follows:
341381

342382
username,email,first_name,last_name,pw,course
@@ -349,6 +389,12 @@ Operation
349389
---------
350390
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**.
351391

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

353399
Other Tips & Tricks
354400
-------------------------------
@@ -379,14 +425,13 @@ Shelling Inside
379425
**********************************
380426

381427
You can shell into the container to look around, or otherwise test. When you enter,
382-
you'll be in the web2py folder, where runestone is an application under applications. From
383-
the RunestoneServer directory do:
428+
you'll be in the web2py folder, where ``runestone/`` is an application under ``applications/``. From the ``RunestoneServer/`` directory do:
384429

385430
.. code-block:: bash
386431
387432
docker-tools shell
388433
389-
Remember that the folder under web2py applications/runestone is bound to your host,
434+
Remember that the folder under ``web2py/applications/runestone`` is bound to your host,
390435
so **do not edit files from inside the container** otherwise they will have a change
391436
in permissions on the host.
392437

@@ -448,7 +493,7 @@ system. You need to do the following:
448493

449494
#. 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.
450495

451-
#. Now that your course is registered, rebuild it using the command ``rsmanage build --course <book_name>`` command.
496+
#. Now that your course is registered, rebuild it using the command ``rsmanage build <book_name>`` command. If this is a PreTeXt book then build with the command ``rsmanage build --ptx <book_name>`` where the ``book_name`` should match the document-id specified in the docinfo section of the pretext book. Often found in ``bookinfo.ptx`` but sometimes as a peer of ``<book>`` in the ``main.ptx`` file for the book.
452497

453498

454499
Changing dependencies

0 commit comments

Comments
 (0)