-
-
Notifications
You must be signed in to change notification settings - Fork 166
Patch5 for docker two stage #1435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch5 for docker two stage #1435
Conversation
…d line which enables Rserve in localOverrides.conf
…nt admin directory already exists. make sure that a default admin user with admin password is enrolled in the course and echo that fact to the installer of the WW docker box. update README
…dual course and not newly created there is a possibility that it's permissions will not be correct and can't be fixed from the web interface.
… line break just before file name to be edited seemed to fix things.
…rade the admin course database tables
… environment. Also replace the hardwired webworkWrite with a variable $WEBWORK_DB_USER (since we're already defining it)
…docker-entrypoint script
|
Doing a find/replace on the config files is fragile, as evidenced by the changes to the password quoting. For changes to localOverrides.conf, would it make more sense to either have the docker build generate that file from scratch (which should be safe since the .dist version is entirely commented out), or simply add new config options at the end of the file (before the closing line)? This way if the text changes in the .dist version it wouldn't break the find/replace. |
taniwallach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my testing there are several bugs.
- The
admin_usertable is not being recreated due to an error in thebashscript condition. - The
wwshcommand is not executing what is intended when it would be called. - Dropping the global statistics table leads to it not be recreated, as the relevant line was commented out.
Corrections are proposed in the "line comments".
docker-compose.yml
Outdated
|
|
||
| # Extra Ubuntu packages to install during startup | ||
| #ADD_APT_PACKAGES: vim telnet | ||
| ADD_APT_PACKAGES: vim less |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend leaving the ADD_APT_PACKAGES line commented out, and explaining how to use it in the documentation.
Adding packages here causes a significant start-up delay for them to be installed. Users who need to access the shell inside a running docker container can either install things when needed, or can make the decision to pay the penalty in start-up time.
Installing extra support related packages to the base image is not considered to be appropriate due to DevOps concerns about keeping the image as small/clean as possible. (There are old posts from @xcompass about that, and the consensus seemed to be to do so.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see their point, but not having less and an editor available inside the container is a real disadvantage for a brand new user who might want to fix some minor glitch in the local container file or just wants to have a look around. @xcompass suggested using environment variables to differentiate between production and development (and in this case newbie) builds. I notice that the installation of vim is not very clean (lots of warnings), and in any case perhaps nano would be a better editor to include. more is included automatically so perhaps we could make do without "less". (pun intended) I'll think some more about this.
|
Even with the patches discussed in my review, there is still an issue with the "local statistics" being missing, which triggers an error: I think that for "developers" and "simple" Docker use, the best solution is probably to disable local statistics by adding into |
About how to efficiently and safely modify |
|
I think that for "developers" and "simple" Docker use, the best solution is probably to disable local statistics by adding I think you are right, the developers and simple Docker use is unlikely to be used heavily for real students |
|
@mgage I've decided to get off my anti-docker horse and dig in. Can you give me some basics to try this out? I ran |
|
With the changes in this PR, you should not need to first edit So roughly you want to do: Another If you want to force a rebuild of the base OS image (the one which installs lots of Ubuntu packages, etc.) you would run: using the |
|
@mgage - I still think the condition to trigger the recreation of the admin course databases is broken. The change I suggested above fixes it for me. Here is my test protocol: Update the branch and rebuild the (stage2) image. Enter the container and delete the I see in the middle of the output: namely that the proposed version of Change the line in docker-config/docker-entrypoint.sh (diff below): Rebuild the container (to get the modified version of This time I see: The error about Open |
|
I fixed the line to -- just missed that item when I pushed your other suggestions. As to an earlier comment to Peter Staab. docker-compose.yml still needs to be edited to set the root password for mariaDB. Is there an alternative method that doesn't modify docker-compose.yml? I keep catching myself just before I commit changes in docker-compose.yml and have to go back and fix the password so that it is not revealed. |
|
I'm still getting the error The line editing the showLibraryLocalStatistics flag failed to include the fact that the original line in localOverrides.conf began with a # since it was commented out. |
I cannot think of any reason why it could not be set in the Trying this out requires totally removing the storage volume for the database, as AFAIK only when a new database is first created is the |
|
I think we should probably also add |
|
I just quickly tested a change to The new root SQL password was tested as follows: I tested the fix to |
by specific request.
Move mysql root password to .env
taniwallach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than not liking the startup delay due to ADD_APT_PACKAGES all the key changes in this PR now works in my tests.
The startup delay is something I and others can avoid by commenting out the ADD_APT_PACKAGES line.
- The
admin_usertable is recreated when missing, and a full table schema check is done then. - The
adminuser account get created. - The SQL root password is set in
.envand gets processed from there on the first creation of the database. - The library browser works properly "out of the box".
I did not test using R, but the setting change makes sense.
Lots of "small" Docker changes: * Changes that change owner of htdocs/tmp to www-data * enable Rserve in localOverrides.conf * insure that that admin course tables are up to date when the current admin directory already exists but the admin_user table is missing. * Add a default admin user with admin password when the admin_user table was missing. * Make sure the admin course is owned by www-data. Even if it is a residual course and not newly created there is a possibility that it's permissions will not be correct and can't be fixed from the web interface. * turn showLibraryLocalStats off, remove extraneous repeated line * include nano and less by default in Docker startup (`ADD_APT_PACKAGES`) for use by developers via docker-compose.yml. Can be commented out by people who are disturbed by the startup delay. * Move mysql root password to .env. Add .env to .gitignore so only updated by specific request. Co-authored-by: Nathan Wallach <taniwallach@gmail.com>
I believe this is in good enough shape to be looked at. I have not yet done all the tests
that I want to do to make sure it's solid. I'm open to suggestions for improvements.
htdocs/tmp is now owned by www-data
if either the admin directory or the admin course tables are missing then they are replaced.
for the time being I've put off including install instructions -- we can discuss that later.