Skip to content
This repository was archived by the owner on Dec 17, 2019. It is now read-only.

First reorganization #16

Merged
merged 3 commits into from
Feb 25, 2016
Merged

First reorganization #16

merged 3 commits into from
Feb 25, 2016

Conversation

embray
Copy link
Collaborator

@embray embray commented Feb 24, 2016

This is a first set of changes to reorganize the sage images, including the makefile, their dockerfiles, and the sage installation script that runs in the containers. This doesn't do everything I want yet, but it partially addresses:

  • Optimize the size of the images #3 -- many unnecessary files have been removed, reducing the sizes of the sagemath and sagemath-develop images from ~7 GB to ~4 GB. More could probably be done but that's a good start.
  • Install the startup scripts in ~sage/bin #6 -- all files used by sage are installed with full permissions granted to the sage user. By default sage is installed to /opt/sage/ (the sage user does not have permissions on /opt/ but they can read/write to /opt/sage/. Their DOT_SAGE is still in the sage user's home directory). However, it is also possible to change the installation location for sage. Regardless the sage user has full permissions on the install location.
  • Other minor improvements that should make future work easier.

Still to do (in a separate PR):

  • The Dockerfiles for sagemath and sagemath-develop are identical except for the default value of the SAGE_BRANCH argument. I intend to eliminate the separate sagemath-develop Dockerfile, and instead add additional make targets for "develop" versions of all relevant images (currently just "sagemath" and "sagemath-jupyter"--sagemath-patchbot is of course a separate case). Building the "-develop" versions is mostly just a matter of running the build target with an additional option to change the SAGE_BRANCH variable. This would finally eliminate any duplication.

sagemath and sagemath-develop images, reducing the duplication
between them.  Improved the Makeful to clarify which files are
generated and should be ignored by git.
…so that it goes into the correct .sage directory.
cd sage

# Sage can't be built as root, for reasons...
sudo -H -E -u sage make || exit 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note--I've reworked this script so that it is run as root (before the USER sage command in the Dockerfile). This gives it freedom to perform operations that should be done as root, like creating links in /usr/bin/. However it runs the sage build as the sage user.

This means there's actually no reason for the sage user to be in the sudoers list in the first place, and we could remove that entirely (though this PR doesn't do that yet).

@embray
Copy link
Collaborator Author

embray commented Feb 24, 2016

The Dockerfiles for sagemath and sagemath-develop are identical except for the default value of the SAGE_BRANCH argument. I intend to eliminate the separate sagemath-develop Dockerfile, and instead add additional make targets for "develop" versions of all relevant images (currently just "sagemath" and "sagemath-jupyter"--sagemath-patchbot is of course a separate case). Building the "-develop" versions is mostly just a matter of running the build target with an additional option to change the SAGE_BRANCH variable. This would finally eliminate any duplication.

Although, that plan has a bit of a bug in it, which is that images like sagemath-jupyter wouldn't respond to a change in the SAGE_BRANCH argument, since it is built from the existing sagemath image. A hypthetical sagemath-jupyter-devel image would have to be build from a different base image. As I already found, the base image in a Dockerfile can't be changed via a build argument. So this would have to be handled differently.

For now I'll just make a special case for sagemath and sagemath-devel and worry about adding additional "-devel" images, if we want them, later.

embray added a commit that referenced this pull request Feb 25, 2016
@embray embray merged commit a77dc10 into sagemath:master Feb 25, 2016
@embray embray deleted the reorg branch February 25, 2016 18:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant