Runestone testing server and library database

68 views
Skip to first unread message

Sean Fitzpatrick

unread,
Aug 5, 2022, 2:34:08 PM8/5/22
to PreTeXt support
I have a rudimentary Runestone server running in a docker container, set to development mode.

Unlike past attempts, things ran pretty well.
(One suggestion: the `rsmanage build --ptx` command should invoke `pretext build runestone -g`. Otherwise assets need to be build manually ahead of time for it to work.)

But the last line of the build output has me stumped:

"Missing library table?  You may need to run an alembic migration."

Maybe I needed to build a library database before building the book?

Jones, Bryan

unread,
Aug 5, 2022, 2:38:57 PM8/5/22
to pretext...@googlegroups.com
Sean,

Your database might be out of date -- it doesn't get recreated by default. Deleting it should cause Runestone to auto-recreate it. I assume this is just for testing, there's no critical info in your db?

Bryan

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/66c0dff8-44b6-4bf0-8e07-24c61f3f2425n%40googlegroups.com.


--
Bryan A. Jones, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
231 Simrall / PO Box 9571
Mississippi State University
Mississippi State, MS 39762
http://www.ece.msstate.edu/~bjones
bjones AT ece DOT msstate DOT edu
voice 662-325-3149
fax 662-325-2298

Our Master, Jesus Christ, is on his way. He'll show up right on
time, his arrival guaranteed by the Blessed and Undisputed Ruler,
High King, High God.
- 1 Tim. 6:14b-15 (The Message)

Sean Fitzpatrick

unread,
Aug 5, 2022, 3:02:18 PM8/5/22
to pretext...@googlegroups.com
This is a Docker build from about an hour ago. There's nothing in it at all.

Jones, Bryan

unread,
Aug 5, 2022, 3:55:37 PM8/5/22
to pretext...@googlegroups.com
Sean,

Try:

docker compose stop
docker compose rm runestoneserver-db-1
docker compose up

Does that help?

Sean Fitzpatrick

unread,
Aug 5, 2022, 4:14:07 PM8/5/22
to pretext...@googlegroups.com
I get that same message at the end of the build.

What I've done:

- set up the virtual environment
- (with the boostrap script previously downloaded) docker-tools build
- docker compose up -d (default setting in .env is development)
- rsmanage addcourse linalg (this is the book name set up in PreTeXt)
- in books folder, clone by GitHub repo, and change to the correct branch
- generate assets for the PreTeXt book
- rsmanage build --ptx linalg (here is where I get the message about the library)
- rsmanage adduser (I added a single instructor user to the linalg course)

If I open a web browser to localhost and sign in as the user I created, I get a 502 bad gateway.

I can change the setting in .env from development to production, but past experience suggests that the rsmanage build command will fail in that case.
I can recreate the course and user (if you stop the container and then restart, they disappear) but things don't work well in that case either.

Bradley Miller

unread,
Aug 7, 2022, 7:18:15 PM8/7/22
to pretext...@googlegroups.com
Oh, good grief!

The change to the schema is still on a branch!!

I will fix that tomorrow!

Brad

Bradley Miller, PhD
Professor Emeritus Computer Science
Luther College
Founder, Runestone Academy
Blog: A Reputable Journal

Sean Fitzpatrick

unread,
Aug 8, 2022, 12:18:58 AM8/8/22
to PreTeXt support
Thanks. Do I understand correctly that one cannot update an existing docker image?
Most of what I've seen online suggests that you should remove and then build the updated version.

Sean Fitzpatrick

unread,
Aug 9, 2022, 6:02:22 PM8/9/22
to PreTeXt support
It seems I've done something to mess up everything docker on my machine:
I tried removing the previous docker container and then downloading the new version and rebuilding.

As far as I know, I followed all the same steps as in the past, but there is no longer anything at http://localhost after I run docker compose up -d.
During the build step, docker-tools is finding some cached version -- instead of taking a long time, it finishes immediately, with references to cached versions.

Jones, Bryan

unread,
Aug 15, 2022, 10:11:33 AM8/15/22
to pretext...@googlegroups.com
Sean,

Sorry, this got buried in my inbox. How can I help?

Bryan

Sean Fitzpatrick

unread,
Aug 15, 2022, 10:36:20 AM8/15/22
to pretext...@googlegroups.com
Hi Bryan,

I'm wondering if there is a good way to purge everything docker-related and start over, in case I accidentally broke something. I'm on Ubuntu.

Either that, or I need to figure out why there is nothing at localhost any more.
(If I deleted an old docker image but didn't shut it down correctly, could there be conflicting items trying to run at http://localhost ?)

It seems that something is no longer going right during the setup phase.

In a new folder:

- I've set up and activated a new Python virtual environment.
- I've downloaded the boostrap script, and run it.
- I've done the initial build with docker-tools
- I've used 'docker compose up -d' to bring up the server.

There is nothing at localhost, but other things have gone wrong as well.
If I try to use rsmanage (for example, 'rsmanage addcourse') it fails, due to the module 'zmq' not being found. So not all Python dependencies are being installed in the virtual environment.

Jones, Bryan

unread,
Aug 15, 2022, 11:02:53 AM8/15/22
to pretext...@googlegroups.com
Sean,

docker system prune -a

Does that help? (I'm assuming you've pulled the latest from the RunestoneServer, RunestoneComponents, and BookServer repos?)

Bryan

Sean Fitzpatrick

unread,
Aug 15, 2022, 11:15:54 AM8/15/22
to pretext...@googlegroups.com
I was using the use case of running the server, where you don't clone the repositories.
But I can try doing things that way, and see if it's any better.

It's also possible that something is wrong with my virtual environment, since I'm missing Python modules that Runestone needs.
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/HLjbSmj7INg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/CAHhYbD8vSd9L3u3H9_EQCE7c9sqXc_A_gOGYMSm%3DxFBYBh4N9Q%40mail.gmail.com.

Sean Fitzpatrick

unread,
Aug 15, 2022, 11:53:20 AM8/15/22
to pretext...@googlegroups.com
The 'docker system prune -a' command did the trick!

Forcing it to rebuild everything from scratch was what was needed.
If I need to update my docker image of Runestone in the future, what is the recommended way to do that? Can I install updates inside the container?
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/HLjbSmj7INg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/CAHhYbD8vSd9L3u3H9_EQCE7c9sqXc_A_gOGYMSm%3DxFBYBh4N9Q%40mail.gmail.com.

Sean Fitzpatrick

unread,
Aug 15, 2022, 12:18:12 PM8/15/22
to PreTeXt support
OK, an update:

- the docker image builds successfully now.
- generating assets for a pretext book doesn't work well: xelatex is not installed in Docker, which means I can't build latex images. (Workaround: build them outside the container, and copy them into place)
- I have to shell inside to manually run the PreTeXt CLI to generate asymptote images. Without this step, the html/runestone build will fail
- Running 'rsmanage build --ptx' successfully builds the book, but I still get the library error that started this thread
- Trying to log into the course that was created to use this book still produces a bad gateway.

Steps to reproduce:

> mkdir runestone
> cd runestone
> python -m venv rsenv
> . rsenv/bin/activate
(rsenv) > python docker_tools.py init
(rsenv) > cd RunestoneServer
(rsenv) > docker-tools build
-- reboot --
beginning again in the virtual environment, in the RunestoneServer folder
(rsenv) > docker compose up -d
(rsenv) > rsmanage addcourse
-- add course called "linalg" --
(rsenv) > cd books
(rsenv) > mv Math3410/ linalg/
(rsenv) > cd linalg
(rsenv) > git checkout 2022new
(rsenv) > cd ..
-- manually generate and copy assets I'm unable to do in Runestone --
(rsenv) > rsmanage  build --ptx linalg
-- build is successful, but ends with "missing library table" message
(rsenv) > rsmanage adduser
-- add user to linalg course --

In web browser, go to http://localhost, and try to log in as newly created user.

This takes me to http://localhost/ns/books/published/linalg/index.html, where I get 502 Bad Gateway

Jones, Bryan

unread,
Aug 15, 2022, 5:20:16 PM8/15/22
to pretext...@googlegroups.com
Sean,

If you run docker-tools build --tex, it will apt install texlive-full xsltproc pdf2svg. Will this install xelatex?

You don't have to create a venv (although it's not a bad idea either).

After running docker compose up -d (note that docker-compose is the old name, the newer version is docker compose), run docker-tools shell, then do everything after inside the container. Does that help?

Bryan

Sean Fitzpatrick

unread,
Aug 15, 2022, 5:44:06 PM8/15/22
to pretext...@googlegroups.com
That would install xelatex, yes. Thanks.

I decided to try using the "developer use case", where all the GitHub repos get cloned.

I run into the same library issue. This time I can see the error messages:

runestoneserver-db-1         | 2022-08-15 21:38:26.814 UTC [127] ERROR:  relation "library" does not exist at character 15
runestoneserver-db-1         | 2022-08-15 21:38:26.814 UTC [127] STATEMENT:  select * from library where basecourse = 'linalg'

Possibly the library database doesn't get built when the .env file has
SERVER_CONFIG=development ?

But previous attempts have suggested that the steps to build a book don't work if I change the server config to production. I'll see what happens if I try that.

Sean Fitzpatrick

unread,
Aug 15, 2022, 5:50:42 PM8/15/22
to pretext...@googlegroups.com
OK, some progress: if I bring up the docker container with the server config set to production:

- I still get the same library error
- But I can create a user and log into the course, even though it's not added to the library.

So perhaps you can only see the book once you change the server config to production, although I still don't know what to do about the missing library database.

Jones, Bryan

unread,
Aug 15, 2022, 6:08:05 PM8/15/22
to pretext...@googlegroups.com
I'm guessing the library error is something Brad added? I don't recognize it...

Sean Fitzpatrick

unread,
Aug 15, 2022, 6:11:33 PM8/15/22
to pretext...@googlegroups.com
Maybe. Once the book is built, I can add a user to the course it's built for, log in, and access the book. But it doesn't appear in the "Our Library" tab.

One other problem: perhaps this is the same 'menu regression' Brad posted about on pretext-dev, but I can't get to the user menu.

In both Chrome and Firefox, there is a gap between the icon for the menu, and the menu.
If I move my mouse cursor off of the icon to reach the menu, the menu disappears:

Reply all
Reply to author
Forward
0 new messages