sagemath/sage

Make docker images from tox/GitHub CI workflow, regular Sage Docker images, gitpod, CoCalc interoperable

mkoeppe opened this issue · 29 comments

  1. Adjust directory names to something that works for both cases ...

    • docker/Dockerfile currently has:
      • SAGE_ROOT=/home/sage/sage
      • SAGE_LOCAL=$SAGE_ROOT/local
    • Docker images built with tox/GH Actions (including Gitpod) and also computop/sage have:
      • SAGE_ROOT=/sage
      • SAGE_LOCAL=/sage/local
    • After this ticket:
      • SAGE_ROOT=/sage
      • SAGE_LOCAL=/opt/sage
    • CoCalc Docker image has:
      • SAGE_ROOT=/usr/local/sage
      • SAGE_LOCAL=/usr/local/sage/local
  2. #33851: Define a script package representing "useful stuff to have on a Docker image"

  3. Replace all apt-get in docker/Dockerfile by using a Docker image built using build/bin/write-dockerfile as the base image.

  4. By default, docker/Dockerfile would use configure --without-system-... a lot so that CI is done against "the reference distribution"

  5. Move build/bin/write-dockerfile.sh into docker/

  6. Add a mechanism (environment variable) to tox -e docker... to copy SAGE_LOCAL from a given Docker image.

CC: @kliem @dimpase @embray @saraedum @slel @fchapoton @tobiasdiez @williamstein @culler @NathanDunfield

Component: docker

Keywords: ci, ContinuousIntegration, sd109

Issue created by migration from https://trac.sagemath.org/ticket/29536

Description changed:

--- 
+++ 
@@ -1,3 +1,7 @@
 ... by adjusting directory names to something that works for both cases ...
 
+`docker/Dockerfile`:
+- `SAGE_ROOT=/home/sage/sage`
+- `SAGE_LOCAL=$SAGE_ROOT/local`
 
+
comment:2

by the way, we don't seem to have in docs an explanation regarding file shared between docker images and regular file system of the host system.

Changed keywords from ci, ContinuousIntegration to ci, ContinuousIntegration, sd109

Description changed:

--- 
+++ 
@@ -1,7 +1,12 @@
-... by adjusting directory names to something that works for both cases ...
+1. adjust directory names to something that works for both cases ...
 
-`docker/Dockerfile`:
-- `SAGE_ROOT=/home/sage/sage`
-- `SAGE_LOCAL=$SAGE_ROOT/local`
+   `docker/Dockerfile`:
+   - `SAGE_ROOT=/home/sage/sage`
+   - `SAGE_LOCAL=$SAGE_ROOT/local`
 
+2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
 
+3. Replace all `apt-get` in `docker/Dockerfile` by using a Docker image built using `build/bin/write-dockerfile` as the base image.
+
+4. By default, `docker/Dockerfile` would use `configure --without-system-...` a lot so that CI is done against "the reference distribution"
+
comment:5

I'm confused--should this say "GitHub" in the title or "GitLab"? I don't know of any GitHub CI docker images.

comment:6

Replying to @embray:

I'm confused--should this say "GitHub" in the title or "GitLab"? I don't know of any GitHub CI docker images.

please see
https://doc.sagemath.org/html/en/developer/index.html#testing-on-multiple-platforms

we now have a builder of docker images for multiple platforms, configurable, and by default hosted on github.

Description changed:

--- 
+++ 
@@ -1,8 +1,8 @@
 1. adjust directory names to something that works for both cases ...
 
-   `docker/Dockerfile`:
-   - `SAGE_ROOT=/home/sage/sage`
-   - `SAGE_LOCAL=$SAGE_ROOT/local`
+   `docker/Dockerfile` currently has:
+    - `SAGE_ROOT=/home/sage/sage`
+    - `SAGE_LOCAL=$SAGE_ROOT/local`
 
 2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
 

Description changed:

--- 
+++ 
@@ -10,3 +10,7 @@
 
 4. By default, `docker/Dockerfile` would use `configure --without-system-...` a lot so that CI is done against "the reference distribution"
 
+
+5. Move `build/bin/write-dockerfile` into `docker/`
+
+

Dependencies: #30960

comment:14

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

Description changed:

--- 
+++ 
@@ -13,4 +13,6 @@
 
 5. Move `build/bin/write-dockerfile` into `docker/`
 
+6. Add a mechanism (environment variable) to `tox -e docker...` to copy SAGE_LOCAL from a given Docker image.
 
+
comment:17

Given that GitLab Docker build is broken for ages, can we arrange for GitHub-built docker images to be pushed to the main Docker repo,
or at least create some sort of advertised Docker repo on GitHub?

Description changed:

--- 
+++ 
@@ -16,3 +16,5 @@
 6. Add a mechanism (environment variable) to `tox -e docker...` to copy SAGE_LOCAL from a given Docker image.
 
 
+
+Gitpod - see #32749
comment:22

Bikeshedding time! Let's pick SAGE_ROOT, SAGE_LOCAL. My proposal is in the ticket description.

(The only important constraint for me is: Don't nest SAGE_LOCAL within SAGE_ROOT - for flexibility such as bind-mounting a new version of the source tree over SAGE_ROOT without hiding SAGE_LOCAL.)

Description changed:

--- 
+++ 
@@ -1,20 +1,24 @@
-1. adjust directory names to something that works for both cases ...
-
-   `docker/Dockerfile` currently has:
-    - `SAGE_ROOT=/home/sage/sage`
-    - `SAGE_LOCAL=$SAGE_ROOT/local`
+1. Adjust directory names to something that works for both cases ...
+   - `docker/Dockerfile` currently has:
+      - `SAGE_ROOT=/home/sage/sage`
+      - `SAGE_LOCAL=$SAGE_ROOT/local`
+   - Docker images built with tox/GH Actions (including Gitpod) have:
+      - `SAGE_ROOT=/sage`
+      - `SAGE_LOCAL=/sage/local`
+   - **After this ticket:**
+      - `SAGE_ROOT=/sage`
+      - `SAGE_LOCAL=/opt/sage`
 
 2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
+   - perhaps call it `_devtools`? 
 
 3. Replace all `apt-get` in `docker/Dockerfile` by using a Docker image built using `build/bin/write-dockerfile` as the base image.
 
 4. By default, `docker/Dockerfile` would use `configure --without-system-...` a lot so that CI is done against "the reference distribution"
 
 
-5. Move `build/bin/write-dockerfile` into `docker/`
+5. Move `build/bin/write-dockerfile.sh` into `docker/`
 
 6. Add a mechanism (environment variable) to `tox -e docker...` to copy SAGE_LOCAL from a given Docker image.
 
 
-
-Gitpod - see #32749

Changed dependencies from #30960 to #33740

Description changed:

--- 
+++ 
@@ -11,6 +11,7 @@
 
 2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
    - perhaps call it `_devtools`? 
+   - include the stuff added in #33740 to `environment-dev.yml`
 
 3. Replace all `apt-get` in `docker/Dockerfile` by using a Docker image built using `build/bin/write-dockerfile` as the base image.
 

Description changed:

--- 
+++ 
@@ -12,6 +12,7 @@
 2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
    - perhaps call it `_devtools`? 
    - include the stuff added in #33740 to `environment-dev.yml`
+   - solve #27677, #29153
 
 3. Replace all `apt-get` in `docker/Dockerfile` by using a Docker image built using `build/bin/write-dockerfile` as the base image.
 

Description changed:

--- 
+++ 
@@ -11,7 +11,7 @@
 
 2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
    - perhaps call it `_devtools`? 
-   - include the stuff added in #33740 to `environment-dev.yml`
+   - include the stuff added in #33740 to `environment-dev.yml` and #33671
    - solve #27677, #29153
 
 3. Replace all `apt-get` in `docker/Dockerfile` by using a Docker image built using `build/bin/write-dockerfile` as the base image.

Description changed:

--- 
+++ 
@@ -10,7 +10,7 @@
       - `SAGE_LOCAL=/opt/sage`
 
 2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
-   - perhaps call it `_devtools`? 
+   - perhaps call it `_develop`? 
    - include the stuff added in #33740 to `environment-dev.yml` and #33671
    - solve #27677, #29153
 

Description changed:

--- 
+++ 
@@ -9,10 +9,7 @@
       - `SAGE_ROOT=/sage`
       - `SAGE_LOCAL=/opt/sage`
 
-2. Define a script package representing "useful stuff to have on a Docker image" (more than the `_recommended` package from #29557)
-   - perhaps call it `_develop`? 
-   - include the stuff added in #33740 to `environment-dev.yml` and #33671
-   - solve #27677, #29153
+2. #33851: Define a script package representing "useful stuff to have on a Docker image" 
 
 3. Replace all `apt-get` in `docker/Dockerfile` by using a Docker image built using `build/bin/write-dockerfile` as the base image.
 

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

10338a7Change ci as well
0cf7334Add sage-setup as install-requires dep
6d2b149Use relative paths to not install src package
1dba3baMaybe thats the correct shebang?
c1b2fbfRevert install_requires change
ad56ba3Go back to two pip installs for now
b42f5f5Readd how to use specific python version
87f360cReadd name arg
01eb374Merge #33740
58e112abootstrap-conda: Use script package _develop instead of hardcoded list of dev tools; remove unused RECOMMENDED

Changed commit from 58e112a to none

Changed dependencies from #33740 to none

Description changed:

--- 
+++ 
@@ -8,6 +8,9 @@
    - **After this ticket:**
       - `SAGE_ROOT=/sage`
       - `SAGE_LOCAL=/opt/sage`
+   - CoCalc Docker image has:
+      - `SAGE_ROOT=/usr/local/sage`
+      - `SAGE_LOCAL=/usr/local/sage/local`
 
 2. #33851: Define a script package representing "useful stuff to have on a Docker image" 
 

Description changed:

--- 
+++ 
@@ -2,7 +2,7 @@
    - `docker/Dockerfile` currently has:
       - `SAGE_ROOT=/home/sage/sage`
       - `SAGE_LOCAL=$SAGE_ROOT/local`
-   - Docker images built with tox/GH Actions (including Gitpod) have:
+   - Docker images built with tox/GH Actions (including Gitpod) and also `computop/sage` have:
       - `SAGE_ROOT=/sage`
       - `SAGE_LOCAL=/sage/local`
    - **After this ticket:**