From 06416317f35f0f3f4a603cb8a9bae829b2a5b726 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 8 Jul 2022 17:02:27 -0700 Subject: [PATCH 01/96] Add devcontainer for ubuntu --- .devcontainer/Dockerfile | 6 ++++++ .devcontainer/devcontainer.json | 11 +++++++++++ .vscode/settings.json | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..c47e122cf16 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,6 @@ +ARG VARIANT="jammy" +FROM ghcr.io/sagemath/sage/sage-docker-ubuntu-${VARIANT}-standard-with-system-packages:dev + +# Install additional packages needed for devcontainer support in VS code +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends gpgconf openssh-client diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..58a523bac20 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,11 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "Ubuntu", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic, xenial, trusty, etc. + "args": { "VARIANT": "jammy" } + }, + // Run commands after the container is started. + "postStartCommand": "configure && make build" +} diff --git a/.vscode/settings.json b/.vscode/settings.json index cb06559edea..af2b4536957 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,8 +24,9 @@ "python.linting.pycodestyleEnabled": true, "python.linting.enabled": true, "cSpell.words": [ - "furo" + "furo", "Conda", + "sagemath", "Cython" ], } From 4b0288e6789bc8293e545474f582cec7d1ec53c7 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 14 May 2022 12:06:26 +0000 Subject: [PATCH 02/96] Add bootstrap --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 58a523bac20..af6c5a23510 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,5 +7,5 @@ "args": { "VARIANT": "jammy" } }, // Run commands after the container is started. - "postStartCommand": "configure && make build" + "postStartCommand": "./bootstrap && ./configure && make build" } From 267085d366fe4f3f51a064b0454ded816ff91b4c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 14 May 2022 12:18:48 +0000 Subject: [PATCH 03/96] enable-build-as-root --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index af6c5a23510..1e1c610bdac 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,5 +7,5 @@ "args": { "VARIANT": "jammy" } }, // Run commands after the container is started. - "postStartCommand": "./bootstrap && ./configure && make build" + "postStartCommand": "./bootstrap && ./configure --enable-build-as-root && make build" } From 63ee3b18af0bf3f52f21d0054e5c539cf6b671f0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 14 May 2022 13:16:21 -0700 Subject: [PATCH 04/96] .devcontainer: Generalize to other distros --- .devcontainer/Dockerfile | 10 ++++------ .devcontainer/devcontainer.json | 12 +++++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c47e122cf16..67585ab311b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,4 @@ -ARG VARIANT="jammy" -FROM ghcr.io/sagemath/sage/sage-docker-ubuntu-${VARIANT}-standard-with-system-packages:dev - -# Install additional packages needed for devcontainer support in VS code -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends gpgconf openssh-client +ARG SYSTEM_FACTOR="ubuntu-jammy" +ARG PACKAGE_FACTOR="standard" +ARG DOCKER_TARGET="with-system-packages" +FROM ghcr.io/sagemath/sage/sage-docker-${SYSTEM_FACTOR}-${PACKAGE_FACTOR}-${DOCKER_TARGET}:dev diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1e1c610bdac..a410d377b16 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,17 @@ // For format details, see https://aka.ms/devcontainer.json. { - "name": "Ubuntu", + "name": "Ubuntu jammy", "build": { "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic, xenial, trusty, etc. - "args": { "VARIANT": "jammy" } + // See tox.ini for definitions + "args": { "SYSTEM_FACTOR": "ubuntu-jammy", + "PACKAGE_FACTOR": "standard", + "DOCKER_TARGET": "with-system-packages", + "DOCKER_TAG": "dev" + } }, + // Run commands after the container is created: + "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM install --yes $(sage-get-system-packages $SYSTEM _develop))", // Run commands after the container is started. "postStartCommand": "./bootstrap && ./configure --enable-build-as-root && make build" } From fff0164285210bb50bde1d04ca6e59f062bd85fb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 14 May 2022 15:14:40 -0700 Subject: [PATCH 05/96] .devcontainer/devcontainer.json: Use configure --prefix --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a410d377b16..e763221fe15 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,5 +13,5 @@ // Run commands after the container is created: "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM install --yes $(sage-get-system-packages $SYSTEM _develop))", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ./configure --enable-build-as-root && make build" + "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build" } From a32debfab8c3f0c4d0959c52674de16ab8e6b37d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 14 May 2022 15:37:35 -0700 Subject: [PATCH 06/96] .devcontainer/devcontainer.json: Use make build V=0 --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e763221fe15..8686a14bd78 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,5 +13,5 @@ // Run commands after the container is created: "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM install --yes $(sage-get-system-packages $SYSTEM _develop))", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build" + "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0" } From dfca38dc74502d7f11c5d7e6e19ad08d960db8f9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 14 May 2022 16:00:57 -0700 Subject: [PATCH 07/96] .devcontainer/devcontainer.json: Use with-targets --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8686a14bd78..0eaf0530286 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // See tox.ini for definitions "args": { "SYSTEM_FACTOR": "ubuntu-jammy", "PACKAGE_FACTOR": "standard", - "DOCKER_TARGET": "with-system-packages", + "DOCKER_TARGET": "with-targets", "DOCKER_TAG": "dev" } }, From 28c9d6b287a53bd5e787fce6faf54679ad32896c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 14 May 2022 16:36:27 -0700 Subject: [PATCH 08/96] .devcontainer/devcontainer.json: Install python extension --- .devcontainer/devcontainer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0eaf0530286..7807dd6e4cd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,5 +13,8 @@ // Run commands after the container is created: "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM install --yes $(sage-get-system-packages $SYSTEM _develop))", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0" + "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", + "extensions": [ + "ms-python.python" + ] } From 09505edb6c07626f5772ad265c28fe556bad6d6b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 15 May 2022 07:53:39 -0700 Subject: [PATCH 09/96] .devcontainer/devcontainer.json: Also install packages from build/pkgs/_develop/dependencies --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7807dd6e4cd..d3e3a81be46 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,7 @@ } }, // Run commands after the container is created: - "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM install --yes $(sage-get-system-packages $SYSTEM _develop))", + "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM install --yes $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies)))", // Run commands after the container is started. "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", "extensions": [ From 4bfa47c1b6a25de9aeeeea99d8a9e0d5ec29436b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 15 May 2022 08:17:12 -0700 Subject: [PATCH 10/96] .devcontainer: Fix use of sage-print-system-package-command --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d3e3a81be46..9dc38d671fd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,7 @@ } }, // Run commands after the container is created: - "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM install --yes $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies)))", + "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM --yes install $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies)))", // Run commands after the container is started. "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", "extensions": [ From 65e52925a4425a83269bae18c1304de6353f2e97 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 16 May 2022 11:47:45 -0700 Subject: [PATCH 11/96] .devcontainer/Dockerfile: Add argument DOCKER_TAG --- .devcontainer/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 67585ab311b..22465185f5e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,5 @@ ARG SYSTEM_FACTOR="ubuntu-jammy" ARG PACKAGE_FACTOR="standard" ARG DOCKER_TARGET="with-system-packages" -FROM ghcr.io/sagemath/sage/sage-docker-${SYSTEM_FACTOR}-${PACKAGE_FACTOR}-${DOCKER_TARGET}:dev +ARG DOCKER_TAG="dev" +FROM ghcr.io/sagemath/sage/sage-docker-${SYSTEM_FACTOR}-${PACKAGE_FACTOR}-${DOCKER_TARGET}:${DOCKER_TAG} From af60fe0809eb62a39081d89f9095e5bcea03719c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 16 May 2022 11:49:03 -0700 Subject: [PATCH 12/96] src/doc/en/developer/portability_testing.rst: Add section 'Using our pre-built Docker images published on ghcr.io' --- src/doc/en/developer/portability_testing.rst | 80 ++++++++++++++++++-- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index a0a7cbf40b8..ffa3bc531d0 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -945,19 +945,24 @@ options:: [mkoeppe@sage worktree-local]$ SKIP_SYSTEM_PKG_INSTALL=yes SKIP_BOOTSTRAP=1 SKIP_CONFIGURE=1 tox -e local-homebrew-macos-minimal -- bash -Automatic parallel tox runs on GitHub Actions ---------------------------------------------- +Automatic testing on multiple platforms on GitHub Actions +========================================================= The Sage source tree includes a default configuration for GitHub -Actions that runs tox on a multitude of platforms on every pull -request and on every push of a tag (but not of a branch) to a -repository for which GitHub Actions are enabled. +Actions that runs our portability tests with tox on a multitude of +platforms on every pull request and on every push of a tag (but not of +a branch) to a repository for which GitHub Actions are enabled. -This is defined in the file ``$SAGE_ROOT/.github/workflows/tox.yml``. +In particular, it automatically runs on our main repository on every +release tag. + +This is defined in the files `$SAGE_ROOT/.github/workflows/tox*.yml +`_. An additional GitHub Actions workflow for testing on Cygwin, not based -on tox, is defined in the file -``$SAGE_ROOT/.github/workflows/ci-cygwin.yml``. +on tox, is defined in the files +`$SAGE_ROOT/.github/workflows/ci-cygwin*.yml +`_. GitHub Actions runs these build jobs on 2-core machines with 7 GB of RAM memory and 14 GB of SSD disk space, cf. @@ -1079,3 +1084,62 @@ Now you can pull the image and run it:: $ docker pull docker.pkg.github.com/YOUR-GITHUB-USERNAME/sage/sage-docker-fedora-31-standard-configured:f4bd671 $ docker run -it docker.pkg.github.com/YOUR-GITHUB-USERNAME/sage/sage-docker-fedora-31-standard-configured:f4bd671 bash + + +Using our pre-built Docker images published on ghcr.io +====================================================== + +Our portability CI on GitHub Actions builds `Docker images +`_ +for all tested Linux platforms (and system package configurations) and +makes them available on `GitHub Packages +`_ (ghcr.io). + +This makes it easy for developers to debug problems that showed up in +the build logs for a given platform. + +The image version corresponding to the latest development release +receives the additional Docker tag ``dev``, see for example the Docker +image for the platform `ubuntu-focal-standard +`_. Thus, +for example, the following command will work:: + + $ docker run -it ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional:dev bash + Unable to find image 'ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional:dev' locally + dev: Pulling from sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional + d5fd17ec1767: Already exists + 67586203f0c7: Pull complete + b63c529f4777: Pull complete + ... + 159775d1a3d2: Pull complete + Digest: sha256:e6ba5e12f59c6c4668692ef4cfe4ae5f242556482664fb347bf260f32bf8e698 + Status: Downloaded newer image for ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional:dev + root@8055a7ba0607:/sage# ./sage + ┌────────────────────────────────────────────────────────────────────┐ + │ SageMath version 9.6, Release Date: 2022-05-15 │ + │ Using Python 3.8.10. Type "help()" for help. │ + └────────────────────────────────────────────────────────────────────┘ + sage: + +Images whose names end with the suffix ``-with-targets-optional`` are +the results of full builds and a run of ``make ptest``. They also +contain a copy of the source tree and the full logs of the build and +test. + +Also `smaller images corresponding to earlier build stages +`_ +are available: + + * ``-with-system-packages`` provides a system installation with + system packages installed, no source tree, + + * ``-configured`` contains a partial source tree + (:envvar:`SAGE_ROOT`) and has completed the bootstrapping phase and + the run of the ``configure`` script, + + * ``-with-targets-pre`` contains the full source tree and a full + installation of all non-Python packages (:envvar:`SAGE_LOCAL`), + + * ``-with-targets`` contains the full source tree and a full + installation of Sage, including the HTML documentation, but ``make + ptest`` has not been run yet. From ee58027165f9841aa656ebb361f35af0da7ac312 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 16 May 2022 11:49:18 -0700 Subject: [PATCH 13/96] src/doc/en/developer/portability_testing.rst: Add section 'Developing with our pre-built Docker images as devcontainers in VS Code' --- src/doc/en/developer/portability_testing.rst | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index ffa3bc531d0..befc1e05f41 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1143,3 +1143,31 @@ are available: * ``-with-targets`` contains the full source tree and a full installation of Sage, including the HTML documentation, but ``make ptest`` has not been run yet. + + +Developing with our pre-built Docker images as devcontainers in VS Code +======================================================================= + +VS Code is very +convenient for working with Docker containers thanks to the `Visual +Studio Code Remote - Containers +`_ extension. + +Sage provides a configuration file +`$SAGE_ROOT/.devcontainer/devcontainer.json +`_ +for this purpose. + +Opening the Sage repository in the configured devcontainer pulls the +image from ghcr.io, installs `additional system packages for +development <../reference/spkg/_develop.html>`_, and builds Sage from +source, reusing the installation (:envvar:`SAGE_LOCAL`, +:envvar:`SAGE_VENV`) from the image. + +By default, it uses ``ubuntu-jammy-standard`` and the most recent +development version Sage (``dev`` tag). You can edit the +configuration file to change to a different platform or another +version. After editing, run "Remote-Containers: Rebuild Container" +from the Command Palette. See the `devcontainer.json reference +`_ +for more information. From d7a961f43979593d669dfab51c48b152e6c72b1e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 10:44:21 -0700 Subject: [PATCH 14/96] devcontainer-ubuntu-jammy-standard.json: Renamed from devcontainer.json --- ...{devcontainer.json => devcontainer-ubuntu-jammy-standard.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .devcontainer/{devcontainer.json => devcontainer-ubuntu-jammy-standard.json} (100%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer-ubuntu-jammy-standard.json similarity index 100% rename from .devcontainer/devcontainer.json rename to .devcontainer/devcontainer-ubuntu-jammy-standard.json From 4ae65bd2d2aca38fd1537d60b31752f472480dd2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 10:59:07 -0700 Subject: [PATCH 15/96] .devcontainer: Factor out script post_create.sh --- .devcontainer/devcontainer-ubuntu-jammy-standard.json | 2 +- .devcontainer/post_create.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 .devcontainer/post_create.sh diff --git a/.devcontainer/devcontainer-ubuntu-jammy-standard.json b/.devcontainer/devcontainer-ubuntu-jammy-standard.json index 9dc38d671fd..8b0b9b7ce34 100644 --- a/.devcontainer/devcontainer-ubuntu-jammy-standard.json +++ b/.devcontainer/devcontainer-ubuntu-jammy-standard.json @@ -11,7 +11,7 @@ } }, // Run commands after the container is created: - "postCreateCommand": "export PATH=$(pwd)/build/bin:$PATH && SYSTEM=$(sage-guess-package-system) && eval $(sage-print-system-package-command $SYSTEM --yes install $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies)))", + "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", "extensions": [ diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh new file mode 100755 index 00000000000..3bdbdd13763 --- /dev/null +++ b/.devcontainer/post_create.sh @@ -0,0 +1,8 @@ +#! /bin/sh +# Run this script from SAGE_ROOT. +# +# Install standard development tools - see SAGE_ROOT/build/pkgs/_develop +# This includes the prerequisites for VS Code remote containers, +export PATH=$(pwd)/build/bin:$PATH +SYSTEM=$(sage-guess-package-system) +eval $(sage-print-system-package-command $SYSTEM --yes install $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies))) From 2a5b1a4a169d2c1fda23beac664b0daa3a1eb733 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 11:02:42 -0700 Subject: [PATCH 16/96] .devcontainer/devcontainer-cocalc.json: New --- .devcontainer/devcontainer-cocalc.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .devcontainer/devcontainer-cocalc.json diff --git a/.devcontainer/devcontainer-cocalc.json b/.devcontainer/devcontainer-cocalc.json new file mode 100644 index 00000000000..ded362a9d88 --- /dev/null +++ b/.devcontainer/devcontainer-cocalc.json @@ -0,0 +1,12 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "CoCalc Docker", + "image": "sagemathinc/cocalc" + // Run commands after the container is created: + "postCreateCommand": ".devcontainer/post_create.sh", + // Run commands after the container is started. + "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv && make build V=0", + "extensions": [ + "ms-python.python" + ] +} From ebd242b8d5433714a5103a4b29825002331f94eb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 11:24:59 -0700 Subject: [PATCH 17/96] src/doc/en/developer/portability_testing.rst: Copy or symlink the devcontainer.json sample file --- src/doc/en/developer/portability_testing.rst | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index befc1e05f41..134e059a41e 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1153,21 +1153,27 @@ convenient for working with Docker containers thanks to the `Visual Studio Code Remote - Containers `_ extension. -Sage provides a configuration file -`$SAGE_ROOT/.devcontainer/devcontainer.json -`_ +Sage provides sample ``devcontainer.json`` configuration files +`$SAGE_ROOT/.devcontainer/devcontainer-*.json +`_ for this purpose. -Opening the Sage repository in the configured devcontainer pulls the +To get started, copy (or symlink) the sample file +`devcontainer-ubuntu-jammy-standard.json +`_ +to ``devcontainer.json`` in the same directory. It uses +``ubuntu-jammy-standard`` and the most recent development version Sage +(``dev`` tag). You can edit a copy of the configuration file to +change to a different platform or another version. + +Then, opening the Sage repository in the configured devcontainer pulls the image from ghcr.io, installs `additional system packages for development <../reference/spkg/_develop.html>`_, and builds Sage from source, reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) from the image. -By default, it uses ``ubuntu-jammy-standard`` and the most recent -development version Sage (``dev`` tag). You can edit the -configuration file to change to a different platform or another -version. After editing, run "Remote-Containers: Rebuild Container" -from the Command Palette. See the `devcontainer.json reference +After editing the configuration file (or changing the symlink), run +"Remote-Containers: Rebuild Container" from the Command Palette. See +the `devcontainer.json reference `_ for more information. From 8e4f9ce3cc4737d40c97be894c3b91c2ed835b98 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 11:30:08 -0700 Subject: [PATCH 18/96] .devcontainer/devcontainer: Use MAKE='make -j12' --- .devcontainer/devcontainer-cocalc.json | 3 +++ .devcontainer/devcontainer-ubuntu-jammy-standard.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.devcontainer/devcontainer-cocalc.json b/.devcontainer/devcontainer-cocalc.json index ded362a9d88..5da9164aaa5 100644 --- a/.devcontainer/devcontainer-cocalc.json +++ b/.devcontainer/devcontainer-cocalc.json @@ -2,6 +2,9 @@ { "name": "CoCalc Docker", "image": "sagemathinc/cocalc" + "containerEnv": { + "MAKE": "make -j12" + }, // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. diff --git a/.devcontainer/devcontainer-ubuntu-jammy-standard.json b/.devcontainer/devcontainer-ubuntu-jammy-standard.json index 8b0b9b7ce34..329235ea1ca 100644 --- a/.devcontainer/devcontainer-ubuntu-jammy-standard.json +++ b/.devcontainer/devcontainer-ubuntu-jammy-standard.json @@ -10,6 +10,9 @@ "DOCKER_TAG": "dev" } }, + "containerEnv": { + "MAKE": "make -j12" + }, // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. From 48041f2ec2994c4849c064bdaf526ef243ae9d33 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 16:23:09 -0700 Subject: [PATCH 19/96] .devcontainer/post_create.sh: Handle option --sudo --- .devcontainer/post_create.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index 3bdbdd13763..a64d8007bd0 100755 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -1,8 +1,8 @@ #! /bin/sh -# Run this script from SAGE_ROOT. +# Run this script from SAGE_ROOT. Invoke with "--sudo" if sudo is needed. # # Install standard development tools - see SAGE_ROOT/build/pkgs/_develop # This includes the prerequisites for VS Code remote containers, export PATH=$(pwd)/build/bin:$PATH SYSTEM=$(sage-guess-package-system) -eval $(sage-print-system-package-command $SYSTEM --yes install $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies))) +eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies))) From 28794f5d8a87ad4602de3388be3d83f3605e3d1e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 16:24:58 -0700 Subject: [PATCH 20/96] .devcontainer/devcontainer-computop-sage.json: New --- .devcontainer/devcontainer-computop-sage.json | 15 +++++++++++++++ .gitignore | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 .devcontainer/devcontainer-computop-sage.json diff --git a/.devcontainer/devcontainer-computop-sage.json b/.devcontainer/devcontainer-computop-sage.json new file mode 100644 index 00000000000..147c9fd6e85 --- /dev/null +++ b/.devcontainer/devcontainer-computop-sage.json @@ -0,0 +1,15 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "computop/sage Docker", + "image": "computop/sage" + "containerEnv": { + "MAKE": "make -j12" + }, + // Run commands after the container is created: + "postCreateCommand": ".devcontainer/post_create.sh --sudo", + // Run commands after the container is started. + "postStartCommand": "./bootstrap && ./configure --prefix=/sage/local --with-sage-venv && make build V=0", + "extensions": [ + "ms-python.python" + ] +} diff --git a/.gitignore b/.gitignore index 59b7fb8b9e4..c19c1ee4576 100644 --- a/.gitignore +++ b/.gitignore @@ -212,6 +212,9 @@ src/ENV/ src/env.bak/ src/venv.bak/ +# devcontainer +/.devcontainer/devcontainer.json + # mypy **/.mypy_cache/ From afae9632023645d0842ecbc660a02cfd7b5a43d0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 16:48:51 -0700 Subject: [PATCH 21/96] .devcontainer/devcontainer-computop-sage.json: Stop it from injecting old SAGE_ROOT into every shell --- .devcontainer/devcontainer-computop-sage.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer-computop-sage.json b/.devcontainer/devcontainer-computop-sage.json index 147c9fd6e85..840de8e9d5e 100644 --- a/.devcontainer/devcontainer-computop-sage.json +++ b/.devcontainer/devcontainer-computop-sage.json @@ -6,7 +6,8 @@ "MAKE": "make -j12" }, // Run commands after the container is created: - "postCreateCommand": ".devcontainer/post_create.sh --sudo", + // Install build tools, get rid of sourcing /sage/activate in non-login shells. + "postCreateCommand": ".devcontainer/post_create.sh --sudo && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Run commands after the container is started. "postStartCommand": "./bootstrap && ./configure --prefix=/sage/local --with-sage-venv && make build V=0", "extensions": [ From ebb73134fd06b478ad0891b020751614c8214236 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 18:49:30 -0700 Subject: [PATCH 22/96] src/bin/sage-env: Key SAGE_ENV_SOURCED also to SAGE_SRC because the PATH setting depends on it --- src/bin/sage-env | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/sage-env b/src/bin/sage-env index 5875e617c32..b451326eb7d 100644 --- a/src/bin/sage-env +++ b/src/bin/sage-env @@ -115,9 +115,8 @@ fi # Don't execute the commands more than once for the same version of # sage-env... for the same combination of SAGE_LOCAL and SAGE_VENV. -# "5" indicates the version of the format of the value of SAGE_ENV_VERSION. -# The current format was introduced in #32745. -SAGE_ENV_VERSION="5:$SAGE_LOCAL:$SAGE_VENV" +# "6" indicates the version of the format of the value of SAGE_ENV_VERSION. +SAGE_ENV_VERSION="6:$SAGE_LOCAL:$SAGE_VENV:$SAGE_SRC" if [ "$SAGE_ENV_SOURCED" = "$SAGE_ENV_VERSION" ]; then # Already sourced, nothing to do. return 0 From a586e4d5dd8df6d2fb80007ad2f160df2086e5c6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 18:53:44 -0700 Subject: [PATCH 23/96] build/make/Makefile.in: Put SAGE_SRC/bin in front of SAGE_VENV/bin so that sage-env-config is sourced from SAGE_SRC --- build/make/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 6b168c12e1f..a3e13e379e9 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -505,7 +505,7 @@ $(1)-$(4)-no-deps: echo "$$($(4)_DISABLED_MESSAGE)" 2>&1; \ exit 1; \ else \ - sage-logger -p 'SAGE_CHECK=$$(SAGE_CHECK_$(1)) PATH=$$($(4))/bin:$$$$PATH $$(SAGE_SPKG) $$(SAGE_SPKG_OPTIONS) \ + sage-logger -p 'SAGE_CHECK=$$(SAGE_CHECK_$(1)) PATH=$$(SAGE_SRC)/bin:$$($(4))/bin:$$$$PATH $$(SAGE_SPKG) $$(SAGE_SPKG_OPTIONS) \ $(if $(filter $(1),$(TOOLCHAIN_DEPS)),--keep-existing) \ $(1)-$(2) $$($(4))' '$$(SAGE_LOGS)/$(1)-$(2).log'; \ fi From bd9ceaec1bf5e342671d2dc7a40b7ac4d56cceaa Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 May 2022 23:16:25 -0700 Subject: [PATCH 24/96] .devcontainer/devcontainer-computop-sage.json: More workarounds --- .devcontainer/devcontainer-computop-sage.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer-computop-sage.json b/.devcontainer/devcontainer-computop-sage.json index 840de8e9d5e..54e57b412d2 100644 --- a/.devcontainer/devcontainer-computop-sage.json +++ b/.devcontainer/devcontainer-computop-sage.json @@ -9,7 +9,10 @@ // Install build tools, get rid of sourcing /sage/activate in non-login shells. "postCreateCommand": ".devcontainer/post_create.sh --sudo && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ./configure --prefix=/sage/local --with-sage-venv && make build V=0", + // Do not run configure within a sage-env (see #29485). + // The pari package is broken in the computop/sage 9.5 image, need to reinstall. + // Also libnauty is broken. + "postStartCommand": "./bootstrap && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv) && make pari-clean nauty-clean build V=0", "extensions": [ "ms-python.python" ] From 1cfa0383f227e0774a8abd260c755f337590a91f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 May 2022 11:18:48 -0700 Subject: [PATCH 25/96] .devcontainer/post_create.sh: First update package lists, also install _prereq --- .devcontainer/post_create.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index a64d8007bd0..eb2c70040d2 100755 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -5,4 +5,5 @@ # This includes the prerequisites for VS Code remote containers, export PATH=$(pwd)/build/bin:$PATH SYSTEM=$(sage-guess-package-system) -eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $(sage-get-system-packages $SYSTEM _develop $(head -n 1 build/pkgs/_develop/dependencies))) +eval $(sage-print-system-package-command $SYSTEM "$@" update) +eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $(sage-get-system-packages $SYSTEM _prereq _develop $(head -n 1 build/pkgs/_develop/dependencies))) From 5ea2bf0e04d5c0611cda82867e4f8c8afd5bc1cf Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 May 2022 11:19:08 -0700 Subject: [PATCH 26/96] .devcontainer/devcontainer-sagemath-sagemath.json: New --- .../devcontainer-sagemath-sagemath.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .devcontainer/devcontainer-sagemath-sagemath.json diff --git a/.devcontainer/devcontainer-sagemath-sagemath.json b/.devcontainer/devcontainer-sagemath-sagemath.json new file mode 100644 index 00000000000..9225680fb56 --- /dev/null +++ b/.devcontainer/devcontainer-sagemath-sagemath.json @@ -0,0 +1,18 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "sagemath/sagemath Docker", + // sagemath/sagemath-dev as of 9.5 is broken? + "image": "sagemath/sagemath:develop" + "containerEnv": { + "MAKE": "make -j12" + }, + // Run commands after the container is created: + // Install build tools + "postCreateCommand": ".devcontainer/post_create.sh --sudo" + // Run commands after the container is started. + // Do not run configure within a sage-env (see #29485). + "postStartCommand": "./bootstrap && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/home/sage/sage/local --with-sage-venv) && make build V=0", + "extensions": [ + "ms-python.python" + ] +} From ac8bed772941291b7dfb038539716bad3e6f3e3c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 May 2022 18:07:20 -0700 Subject: [PATCH 27/96] .devcontainer/devcontainer-archlinux-latest-downstream.json: New --- .../devcontainer-archlinux-latest-downstream.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .devcontainer/devcontainer-archlinux-latest-downstream.json diff --git a/.devcontainer/devcontainer-archlinux-latest-downstream.json b/.devcontainer/devcontainer-archlinux-latest-downstream.json new file mode 100644 index 00000000000..1c59923ab56 --- /dev/null +++ b/.devcontainer/devcontainer-archlinux-latest-downstream.json @@ -0,0 +1,12 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "archlinux:latest downstream Sage", + "image": "archlinux:latest", + // Run commands after the container is created: + "postCreateCommand": ".devcontainer/post_create.sh && pacman -Sy --noconfirm sagemath sagemath-doc", + // Run commands after the container is started. + "postStartCommand": "./bootstrap && ln -sf /usr venv", + "extensions": [ + "ms-python.python" + ] +} From 5380a51ff7fc9490dd24912ea9a91715ad82401d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 May 2022 19:56:55 -0700 Subject: [PATCH 28/96] .devcontainer/devcontainer-archlinux-latest-downstream.json: Install pip, notebook --- .devcontainer/devcontainer-archlinux-latest-downstream.json | 2 +- build/pkgs/notebook/distros/arch.txt | 1 + build/pkgs/pip/distros/arch.txt | 1 + build/pkgs/tox/distros/arch.txt | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 build/pkgs/notebook/distros/arch.txt create mode 100644 build/pkgs/pip/distros/arch.txt create mode 100644 build/pkgs/tox/distros/arch.txt diff --git a/.devcontainer/devcontainer-archlinux-latest-downstream.json b/.devcontainer/devcontainer-archlinux-latest-downstream.json index 1c59923ab56..af1a759eec3 100644 --- a/.devcontainer/devcontainer-archlinux-latest-downstream.json +++ b/.devcontainer/devcontainer-archlinux-latest-downstream.json @@ -3,7 +3,7 @@ "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", // Run commands after the container is created: - "postCreateCommand": ".devcontainer/post_create.sh && pacman -Sy --noconfirm sagemath sagemath-doc", + "postCreateCommand": ".devcontainer/post_create.sh && pacman -Sy --noconfirm sagemath sagemath-doc jupyter-notebook python-pip", // Run commands after the container is started. "postStartCommand": "./bootstrap && ln -sf /usr venv", "extensions": [ diff --git a/build/pkgs/notebook/distros/arch.txt b/build/pkgs/notebook/distros/arch.txt new file mode 100644 index 00000000000..4d5656e81e6 --- /dev/null +++ b/build/pkgs/notebook/distros/arch.txt @@ -0,0 +1 @@ +jupyter-notebook diff --git a/build/pkgs/pip/distros/arch.txt b/build/pkgs/pip/distros/arch.txt new file mode 100644 index 00000000000..311c1b821ca --- /dev/null +++ b/build/pkgs/pip/distros/arch.txt @@ -0,0 +1 @@ +python-pip diff --git a/build/pkgs/tox/distros/arch.txt b/build/pkgs/tox/distros/arch.txt new file mode 100644 index 00000000000..cd20859a9df --- /dev/null +++ b/build/pkgs/tox/distros/arch.txt @@ -0,0 +1 @@ +python-tox From ece0fde5cae01eb3af9d3404d8db4a02cddfe804 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 May 2022 21:38:43 -0700 Subject: [PATCH 29/96] .devcontainer/devcontainer-conda-forge-latest-downstream.json: New --- .../devcontainer-conda-forge-latest-downstream.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .devcontainer/devcontainer-conda-forge-latest-downstream.json diff --git a/.devcontainer/devcontainer-conda-forge-latest-downstream.json b/.devcontainer/devcontainer-conda-forge-latest-downstream.json new file mode 100644 index 00000000000..45746f374f7 --- /dev/null +++ b/.devcontainer/devcontainer-conda-forge-latest-downstream.json @@ -0,0 +1,12 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "condaforge/mambaforge:latest downstream Sage", + "image": "condaforge/mambaforge:latest", + // Run commands after the container is created: + "postCreateCommand": ".devcontainer/post_create.sh && mamba install --yes sage", + // Run commands after the container is started. + "postStartCommand": "./bootstrap && ln -sf $CONDA_PREFIX venv", + "extensions": [ + "ms-python.python" + ] +} From 9772b1c11dd8d5ebda4d089f4577eb69e1222f59 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 19 May 2022 20:59:02 -0700 Subject: [PATCH 30/96] .devcontainer/post_create.sh: Simplify using new options of sage-print-system-package-command --- .devcontainer/post_create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index eb2c70040d2..e7d8ab4db0d 100755 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -6,4 +6,4 @@ export PATH=$(pwd)/build/bin:$PATH SYSTEM=$(sage-guess-package-system) eval $(sage-print-system-package-command $SYSTEM "$@" update) -eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $(sage-get-system-packages $SYSTEM _prereq _develop $(head -n 1 build/pkgs/_develop/dependencies))) +eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq _develop $(head -n 1 build/pkgs/_develop/dependencies) $EXTRA_SAGE_PACKAGES) From b44280c724f57e272726af88d903beb16bdaef80 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 19 May 2022 20:59:31 -0700 Subject: [PATCH 31/96] .devcontainer/devcontainer-archlinux-latest-downstream.json: Use spkg _sagemath --- .devcontainer/devcontainer-archlinux-latest-downstream.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer-archlinux-latest-downstream.json b/.devcontainer/devcontainer-archlinux-latest-downstream.json index af1a759eec3..0f733fce0c8 100644 --- a/.devcontainer/devcontainer-archlinux-latest-downstream.json +++ b/.devcontainer/devcontainer-archlinux-latest-downstream.json @@ -3,7 +3,7 @@ "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", // Run commands after the container is created: - "postCreateCommand": ".devcontainer/post_create.sh && pacman -Sy --noconfirm sagemath sagemath-doc jupyter-notebook python-pip", + "postCreateCommand": "EXTRA_SAGE_PACKAGES='_sagemath notebook pip' .devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": "./bootstrap && ln -sf /usr venv", "extensions": [ From 64ad9d07ae267816e8138c68a04b3a87937e8785 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 20 May 2022 12:53:26 -0700 Subject: [PATCH 32/96] .devcontainer: Move devcontainer.json files to separate directories for Codespaces --- .../devcontainer.json} | 0 .../{devcontainer-cocalc.json => cocalc/devcontainer.json} | 0 .../devcontainer.json} | 0 .../devcontainer.json} | 0 .../devcontainer.json} | 0 .../devcontainer.json} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename .devcontainer/{devcontainer-archlinux-latest-downstream.json => archlinux-latest-downstream/devcontainer.json} (100%) rename .devcontainer/{devcontainer-cocalc.json => cocalc/devcontainer.json} (100%) rename .devcontainer/{devcontainer-computop-sage.json => computop-sage/devcontainer.json} (100%) rename .devcontainer/{devcontainer-conda-forge-latest-downstream.json => conda-forge-latest-downstream/devcontainer.json} (100%) rename .devcontainer/{devcontainer-sagemath-sagemath.json => sagemath-sagemath/devcontainer.json} (100%) rename .devcontainer/{devcontainer-ubuntu-jammy-standard.json => ubuntu-jammy-standard/devcontainer.json} (100%) diff --git a/.devcontainer/devcontainer-archlinux-latest-downstream.json b/.devcontainer/archlinux-latest-downstream/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer-archlinux-latest-downstream.json rename to .devcontainer/archlinux-latest-downstream/devcontainer.json diff --git a/.devcontainer/devcontainer-cocalc.json b/.devcontainer/cocalc/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer-cocalc.json rename to .devcontainer/cocalc/devcontainer.json diff --git a/.devcontainer/devcontainer-computop-sage.json b/.devcontainer/computop-sage/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer-computop-sage.json rename to .devcontainer/computop-sage/devcontainer.json diff --git a/.devcontainer/devcontainer-conda-forge-latest-downstream.json b/.devcontainer/conda-forge-latest-downstream/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer-conda-forge-latest-downstream.json rename to .devcontainer/conda-forge-latest-downstream/devcontainer.json diff --git a/.devcontainer/devcontainer-sagemath-sagemath.json b/.devcontainer/sagemath-sagemath/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer-sagemath-sagemath.json rename to .devcontainer/sagemath-sagemath/devcontainer.json diff --git a/.devcontainer/devcontainer-ubuntu-jammy-standard.json b/.devcontainer/ubuntu-jammy-standard/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer-ubuntu-jammy-standard.json rename to .devcontainer/ubuntu-jammy-standard/devcontainer.json From a813a75d84ba7fbfc01ec495f8761b497f1fb9c6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 20 May 2022 13:03:14 -0700 Subject: [PATCH 33/96] src/doc/en/developer/portability_testing.rst: Update --- src/doc/en/developer/portability_testing.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 134e059a41e..7fe1bf256b1 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1154,14 +1154,14 @@ Studio Code Remote - Containers `_ extension. Sage provides sample ``devcontainer.json`` configuration files -`$SAGE_ROOT/.devcontainer/devcontainer-*.json +`$SAGE_ROOT/.devcontainer/*/devcontainer.json `_ for this purpose. To get started, copy (or symlink) the sample file -`devcontainer-ubuntu-jammy-standard.json -`_ -to ``devcontainer.json`` in the same directory. It uses +`.devcontainer/ubuntu-jammy-standard/devcontainer.json +`_ +to ``devcontainer.json`` in the directory ``.devcontainer``. It uses ``ubuntu-jammy-standard`` and the most recent development version Sage (``dev`` tag). You can edit a copy of the configuration file to change to a different platform or another version. From 60e58d3b2a66eba9d2465a12d139fa25555d41bb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 20 May 2022 13:18:31 -0700 Subject: [PATCH 34/96] src/doc/en/developer/portability_testing.rst: Add link to GitHub devcontainer doc --- src/doc/en/developer/portability_testing.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 7fe1bf256b1..49fcddd3bd7 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1174,6 +1174,8 @@ source, reusing the installation (:envvar:`SAGE_LOCAL`, After editing the configuration file (or changing the symlink), run "Remote-Containers: Rebuild Container" from the Command Palette. See -the `devcontainer.json reference +the `VS Code devcontainer.json reference `_ +and the `GitHub introduction to dev containers +`_ for more information. From 6137928532ae81548b9c2ac87eb71687022941cd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 20 May 2022 14:32:09 -0700 Subject: [PATCH 35/96] src/doc/en/developer/portability_testing.rst: Fix rst --- src/doc/en/developer/portability_testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 49fcddd3bd7..102115aa504 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1148,7 +1148,7 @@ are available: Developing with our pre-built Docker images as devcontainers in VS Code ======================================================================= -VS Code is very +`VS Code ` is very convenient for working with Docker containers thanks to the `Visual Studio Code Remote - Containers `_ extension. From 0b9fc68a6978c78e1fe7b98e6121d187737037aa Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 20 May 2022 16:05:46 -0700 Subject: [PATCH 36/96] .devcontainer/*/devcontainer.json: Use 'make configure' instead of './bootstrap' to match instructions in README --- .devcontainer/archlinux-latest-downstream/devcontainer.json | 2 +- .devcontainer/cocalc/devcontainer.json | 2 +- .devcontainer/computop-sage/devcontainer.json | 2 +- .devcontainer/conda-forge-latest-downstream/devcontainer.json | 2 +- .devcontainer/sagemath-sagemath/devcontainer.json | 2 +- .devcontainer/ubuntu-jammy-standard/devcontainer.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.devcontainer/archlinux-latest-downstream/devcontainer.json b/.devcontainer/archlinux-latest-downstream/devcontainer.json index 0f733fce0c8..a52cf869878 100644 --- a/.devcontainer/archlinux-latest-downstream/devcontainer.json +++ b/.devcontainer/archlinux-latest-downstream/devcontainer.json @@ -5,7 +5,7 @@ // Run commands after the container is created: "postCreateCommand": "EXTRA_SAGE_PACKAGES='_sagemath notebook pip' .devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ln -sf /usr venv", + "postStartCommand": "make configure && ln -sf /usr venv", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/cocalc/devcontainer.json b/.devcontainer/cocalc/devcontainer.json index 5da9164aaa5..5a51894682c 100644 --- a/.devcontainer/cocalc/devcontainer.json +++ b/.devcontainer/cocalc/devcontainer.json @@ -8,7 +8,7 @@ // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv && make build V=0", + "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv && make build V=0", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/computop-sage/devcontainer.json b/.devcontainer/computop-sage/devcontainer.json index 54e57b412d2..2228c6699f8 100644 --- a/.devcontainer/computop-sage/devcontainer.json +++ b/.devcontainer/computop-sage/devcontainer.json @@ -12,7 +12,7 @@ // Do not run configure within a sage-env (see #29485). // The pari package is broken in the computop/sage 9.5 image, need to reinstall. // Also libnauty is broken. - "postStartCommand": "./bootstrap && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv) && make pari-clean nauty-clean build V=0", + "postStartCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv) && make pari-clean nauty-clean build V=0", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/conda-forge-latest-downstream/devcontainer.json b/.devcontainer/conda-forge-latest-downstream/devcontainer.json index 45746f374f7..22463c2dd29 100644 --- a/.devcontainer/conda-forge-latest-downstream/devcontainer.json +++ b/.devcontainer/conda-forge-latest-downstream/devcontainer.json @@ -5,7 +5,7 @@ // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh && mamba install --yes sage", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ln -sf $CONDA_PREFIX venv", + "postStartCommand": "make configure && ln -sf $CONDA_PREFIX venv", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/sagemath-sagemath/devcontainer.json b/.devcontainer/sagemath-sagemath/devcontainer.json index 9225680fb56..214491aef31 100644 --- a/.devcontainer/sagemath-sagemath/devcontainer.json +++ b/.devcontainer/sagemath-sagemath/devcontainer.json @@ -11,7 +11,7 @@ "postCreateCommand": ".devcontainer/post_create.sh --sudo" // Run commands after the container is started. // Do not run configure within a sage-env (see #29485). - "postStartCommand": "./bootstrap && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/home/sage/sage/local --with-sage-venv) && make build V=0", + "postStartCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/home/sage/sage/local --with-sage-venv) && make build V=0", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/ubuntu-jammy-standard/devcontainer.json b/.devcontainer/ubuntu-jammy-standard/devcontainer.json index 329235ea1ca..e544f561a17 100644 --- a/.devcontainer/ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/ubuntu-jammy-standard/devcontainer.json @@ -16,7 +16,7 @@ // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": "./bootstrap && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", + "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", "extensions": [ "ms-python.python" ] From 17922881e1f198ab7ad145d8f0608ecfdb874d60 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 22 May 2022 07:32:23 -0700 Subject: [PATCH 37/96] .devcontainer: Use prefixes 'downstream-', 'portability-' --- .../devcontainer.json | 0 .../devcontainer.json | 0 .../devcontainer.json | 0 src/doc/en/developer/portability_testing.rst | 4 ++-- 4 files changed, 2 insertions(+), 2 deletions(-) rename .devcontainer/{archlinux-latest-downstream => downstream-archlinux-latest}/devcontainer.json (100%) rename .devcontainer/{conda-forge-latest-downstream => downstream-conda-forge-latest}/devcontainer.json (100%) rename .devcontainer/{ubuntu-jammy-standard => portability-ubuntu-jammy-standard}/devcontainer.json (100%) diff --git a/.devcontainer/archlinux-latest-downstream/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json similarity index 100% rename from .devcontainer/archlinux-latest-downstream/devcontainer.json rename to .devcontainer/downstream-archlinux-latest/devcontainer.json diff --git a/.devcontainer/conda-forge-latest-downstream/devcontainer.json b/.devcontainer/downstream-conda-forge-latest/devcontainer.json similarity index 100% rename from .devcontainer/conda-forge-latest-downstream/devcontainer.json rename to .devcontainer/downstream-conda-forge-latest/devcontainer.json diff --git a/.devcontainer/ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json similarity index 100% rename from .devcontainer/ubuntu-jammy-standard/devcontainer.json rename to .devcontainer/portability-ubuntu-jammy-standard/devcontainer.json diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 102115aa504..da95ef4440c 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1159,8 +1159,8 @@ Sage provides sample ``devcontainer.json`` configuration files for this purpose. To get started, copy (or symlink) the sample file -`.devcontainer/ubuntu-jammy-standard/devcontainer.json -`_ +`.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +`_ to ``devcontainer.json`` in the directory ``.devcontainer``. It uses ``ubuntu-jammy-standard`` and the most recent development version Sage (``dev`` tag). You can edit a copy of the configuration file to From b828e559e1851f7ab4c1cdcc851701561bd01bb7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 8 Jul 2022 17:29:01 -0700 Subject: [PATCH 38/96] Remove use of _develop package --- .../downstream-archlinux-latest/devcontainer.json | 2 +- .devcontainer/post_create.sh | 10 ++++++---- src/doc/en/developer/portability_testing.rst | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index a52cf869878..df959894af8 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -3,7 +3,7 @@ "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", // Run commands after the container is created: - "postCreateCommand": "EXTRA_SAGE_PACKAGES='_sagemath notebook pip' .devcontainer/post_create.sh", + "postCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": "make configure && ln -sf /usr venv", "extensions": [ diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index e7d8ab4db0d..d680746fb33 100755 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -1,9 +1,11 @@ #! /bin/sh # Run this script from SAGE_ROOT. Invoke with "--sudo" if sudo is needed. -# -# Install standard development tools - see SAGE_ROOT/build/pkgs/_develop -# This includes the prerequisites for VS Code remote containers, export PATH=$(pwd)/build/bin:$PATH SYSTEM=$(sage-guess-package-system) eval $(sage-print-system-package-command $SYSTEM "$@" update) -eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq _develop $(head -n 1 build/pkgs/_develop/dependencies) $EXTRA_SAGE_PACKAGES) +if [ -n "$EXTRA_SAGE_PACKAGES" ]; then + eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq $EXTRA_SAGE_PACKAGES) +fi +if [ -n "$EXTRA_SYSTEM_PACKAGES" ]; then + eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $EXTRA_SYSTEM_PACKAGES) +fi diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index da95ef4440c..5fd2e051fd4 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1168,7 +1168,7 @@ change to a different platform or another version. Then, opening the Sage repository in the configured devcontainer pulls the image from ghcr.io, installs `additional system packages for -development <../reference/spkg/_develop.html>`_, and builds Sage from +development`_, and builds Sage from source, reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) from the image. From e12ca6cf399c6898873de5ebbc363a7e7e442d0e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 8 Jul 2022 17:41:06 -0700 Subject: [PATCH 39/96] .devcontainer: Install git --- .devcontainer/post_create.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index d680746fb33..0a9dd9951d1 100755 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -3,9 +3,7 @@ export PATH=$(pwd)/build/bin:$PATH SYSTEM=$(sage-guess-package-system) eval $(sage-print-system-package-command $SYSTEM "$@" update) -if [ -n "$EXTRA_SAGE_PACKAGES" ]; then - eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq $EXTRA_SAGE_PACKAGES) -fi +eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq git $EXTRA_SAGE_PACKAGES) if [ -n "$EXTRA_SYSTEM_PACKAGES" ]; then eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $EXTRA_SYSTEM_PACKAGES) fi From 6a6ce788c8de36347a10ad431387fc29b3895b38 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 8 Jul 2022 18:54:38 -0700 Subject: [PATCH 40/96] src/doc/en/developer/portability_testing.rst: Fix markup --- src/doc/en/developer/portability_testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 5fd2e051fd4..0002c24b17d 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1167,8 +1167,8 @@ to ``devcontainer.json`` in the directory ``.devcontainer``. It uses change to a different platform or another version. Then, opening the Sage repository in the configured devcontainer pulls the -image from ghcr.io, installs `additional system packages for -development`_, and builds Sage from +image from ghcr.io, installs additional system packages for +development, and builds Sage from source, reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) from the image. From 029c9a08ca06efd08ff10fc3952453b4ad3c2bbb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Jul 2022 14:52:04 -0700 Subject: [PATCH 41/96] .devcontainer/post_create.sh: Install python3 so that python3-venv is available on Debian --- .devcontainer/post_create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index 0a9dd9951d1..0e443230898 100755 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -3,7 +3,7 @@ export PATH=$(pwd)/build/bin:$PATH SYSTEM=$(sage-guess-package-system) eval $(sage-print-system-package-command $SYSTEM "$@" update) -eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq git $EXTRA_SAGE_PACKAGES) +eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq python3 git $EXTRA_SAGE_PACKAGES) if [ -n "$EXTRA_SYSTEM_PACKAGES" ]; then eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $EXTRA_SYSTEM_PACKAGES) fi From 132083f3450318a09d23352f9fce9d7c75333612 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 10 Aug 2022 22:51:53 -0700 Subject: [PATCH 42/96] src/doc/en/developer/portability_testing.rst: Explain the downstream-... devcontainers --- src/doc/en/developer/portability_testing.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 65846a1bb43..70e945d50a5 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1179,3 +1179,17 @@ the `VS Code devcontainer.json reference and the `GitHub introduction to dev containers `_ for more information. + +In addition to the ``.devcontainer/portability-.../devcontainer.json`` files, Sage also +provides several other sample ``devcontainer.json`` configuration files: + +- `.devcontainer/downstream-archlinux-latest/devcontainer.json + `_ + configures a container with an installation of `Arch Linux ` + and its SageMath package. (Arch Linux packaging is downstream from the Sage project, + hence the prefix ``downstream-...``; the suffix ``latest`` indicates + the most recent version of Arch Linux as available on Docker Hub.) + +- `.devcontainer/downstream-conda-forge-latest/devcontainer.json + `_ + similarly configures a container with an installation of conda-forge and its SageMath package. From d0790b4b33b427493dd99c1b29cc4cb27e56f6f7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 10 Aug 2022 23:07:50 -0700 Subject: [PATCH 43/96] src/doc/en/developer/portability_testing.rst: Explain more about devcontainers --- src/doc/en/developer/portability_testing.rst | 25 +++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 70e945d50a5..8dc671fd502 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1185,7 +1185,7 @@ provides several other sample ``devcontainer.json`` configuration files: - `.devcontainer/downstream-archlinux-latest/devcontainer.json `_ - configures a container with an installation of `Arch Linux ` + configures a container with an installation of `Arch Linux `_ and its SageMath package. (Arch Linux packaging is downstream from the Sage project, hence the prefix ``downstream-...``; the suffix ``latest`` indicates the most recent version of Arch Linux as available on Docker Hub.) @@ -1193,3 +1193,26 @@ provides several other sample ``devcontainer.json`` configuration files: - `.devcontainer/downstream-conda-forge-latest/devcontainer.json `_ similarly configures a container with an installation of conda-forge and its SageMath package. + +- `.devcontainer/cocalc/devcontainer.json + `_ + configures a container with `the CoCalc Docker image `_. + It then updates the installation of SageMath in this container by building from + the current source tree. + +- `.devcontainer/computop-sage/devcontainer.json + `_ + configures a container with the `Docker image from the 3-manifolds + project `_, providing + SnapPy, Regina, PHCPack, etc. It then updates the installation of + SageMath in this container by building from the current source tree. + +- `.devcontainer/sagemath-sagemath/devcontainer.json + `_ + configures a container with `SageMath's official Docker image `_. + It then updates the installation of SageMath in this container by building from + the current source tree. + +These ``devcontainer.json`` configuration files are useful for testing +user scripts on these deployments of SageMath. You may also find it +useful to copy these configurations into your own projects or to adapt them to your needs. From a9f37fa8f1ecaf7b3181c71a6da75197905b3e92 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 10 Aug 2022 23:24:31 -0700 Subject: [PATCH 44/96] .devcontainer/Dockerfile: Add comment --- .devcontainer/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 22465185f5e..52ca0bc6c75 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,5 @@ +# This Dockerfile is used by all portability-.../devcontainer.json files, +# which provide the actual values for the 4 arguments defined below. ARG SYSTEM_FACTOR="ubuntu-jammy" ARG PACKAGE_FACTOR="standard" ARG DOCKER_TARGET="with-system-packages" From 0e1542b3a43d155565519dd0d3b08cbcf40b648b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 10 Aug 2022 23:29:02 -0700 Subject: [PATCH 45/96] .devcontainer/: Add two more portability-... configurations --- .../devcontainer.json | 23 +++++++++++++++++++ .../devcontainer.json | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json create mode 100644 .devcontainer/portability-debian-buster-i386-standard/devcontainer.json diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json new file mode 100644 index 00000000000..91ea05d2d11 --- /dev/null +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -0,0 +1,23 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "Centos 7", + "build": { + "dockerfile": "Dockerfile", + // See tox.ini for definitions + "args": { "SYSTEM_FACTOR": "centos-7-devtoolset-gcc_11", + "PACKAGE_FACTOR": "standard", + "DOCKER_TARGET": "with-targets", + "DOCKER_TAG": "dev" + } + }, + "containerEnv": { + "MAKE": "make -j12" + }, + // Run commands after the container is created: + "postCreateCommand": ".devcontainer/post_create.sh", + // Run commands after the container is started. + "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", + "extensions": [ + "ms-python.python" + ] +} diff --git a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json new file mode 100644 index 00000000000..7d50d30b496 --- /dev/null +++ b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json @@ -0,0 +1,23 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "Debian buster 32-bit", + "build": { + "dockerfile": "Dockerfile", + // See tox.ini for definitions + "args": { "SYSTEM_FACTOR": "debian-buster-i386", + "PACKAGE_FACTOR": "standard", + "DOCKER_TARGET": "with-targets", + "DOCKER_TAG": "dev" + } + }, + "containerEnv": { + "MAKE": "make -j12" + }, + // Run commands after the container is created: + "postCreateCommand": ".devcontainer/post_create.sh", + // Run commands after the container is started. + "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", + "extensions": [ + "ms-python.python" + ] +} From 8a8eb96727e0f4810032362cf31ceff1bb15ea5e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 11 Aug 2022 09:17:02 -0700 Subject: [PATCH 46/96] src/doc/en/developer/portability_testing.rst: Expand on using the VS Code remote containers extension --- src/doc/en/developer/portability_testing.rst | 51 ++++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 8dc671fd502..8ae23ad20d9 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1158,23 +1158,44 @@ Sage provides sample ``devcontainer.json`` configuration files `_ for this purpose. -To get started, copy (or symlink) the sample file +To get started, symlink (or copy) the sample file `.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json `_ -to ``devcontainer.json`` in the directory ``.devcontainer``. It uses -``ubuntu-jammy-standard`` and the most recent development version Sage -(``dev`` tag). You can edit a copy of the configuration file to -change to a different platform or another version. - -Then, opening the Sage repository in the configured devcontainer pulls the -image from ghcr.io, installs additional system packages for -development, and builds Sage from -source, reusing the installation (:envvar:`SAGE_LOCAL`, -:envvar:`SAGE_VENV`) from the image. - -After editing the configuration file (or changing the symlink), run -"Remote-Containers: Rebuild Container" from the Command Palette. See -the `VS Code devcontainer.json reference +to ``devcontainer.json`` in the directory ``.devcontainer``. For +example, in macOS using the shell:: + + [mkoeppe@sage sage] $ (cd .devcontainer && ln -s portability-ubuntu-jammy-standard/devcontainer.json .) + +Then, start VS Code:: + + [mkoeppe@sage sage] $ code . + +In VS Code, click the "Extension" icon on the left (or press +:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`X`; on macOS, :kbd:`Command` + +:kbd:`Shift` + :kbd:`X`) to open a list of extensions. Search for +"Remote - Containers" and install it if it is not already installed. + +With the extension installed, VS Code may prompt you whether you would +like to open the current directory in the devcontainer (yes). If it +does not, use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + +:kbd:`P`) to run the command "Remote-Containers: Reopen Folder in +Container". By clicking on "Show Log", you can see what it does: + +- It pulls the prebuilt image from ghcr.io; note that these + are multi-gigabyte images, so it may take a while. + +- As part of the "postCreateCommand", it installs additional system packages to + support VS Code and for development. Then it bootstraps and configures + the source tree and starts to build Sage from + source, reusing the installation (:envvar:`SAGE_LOCAL`, + :envvar:`SAGE_VENV`) from the prebuilt image. + +This sample file uses ``ubuntu-jammy-standard`` and the most recent +development version of Sage (``dev`` tag). You can edit a copy of the +configuration file to change to a different platform or another +version. After editing the configuration file (or changing the +symlink), run "Remote-Containers: Rebuild Container" from the Command +Palette. See the `VS Code devcontainer.json reference `_ and the `GitHub introduction to dev containers `_ From b78da73aec667a6f405ad7747fec30a02852a01b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 11 Aug 2022 09:26:18 -0700 Subject: [PATCH 47/96] .devcontainer/portability-Dockerfile: Rename from Dockerfile --- .devcontainer/{Dockerfile => portability-Dockerfile} | 0 .../devcontainer.json | 2 +- .../portability-debian-buster-i386-standard/devcontainer.json | 2 +- .../portability-ubuntu-jammy-standard/devcontainer.json | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename .devcontainer/{Dockerfile => portability-Dockerfile} (100%) diff --git a/.devcontainer/Dockerfile b/.devcontainer/portability-Dockerfile similarity index 100% rename from .devcontainer/Dockerfile rename to .devcontainer/portability-Dockerfile diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json index 91ea05d2d11..b1eaf54015c 100644 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -2,7 +2,7 @@ { "name": "Centos 7", "build": { - "dockerfile": "Dockerfile", + "dockerfile": "portability-Dockerfile", // See tox.ini for definitions "args": { "SYSTEM_FACTOR": "centos-7-devtoolset-gcc_11", "PACKAGE_FACTOR": "standard", diff --git a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json index 7d50d30b496..fc3b9d5db47 100644 --- a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json +++ b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json @@ -2,7 +2,7 @@ { "name": "Debian buster 32-bit", "build": { - "dockerfile": "Dockerfile", + "dockerfile": "portability-Dockerfile", // See tox.ini for definitions "args": { "SYSTEM_FACTOR": "debian-buster-i386", "PACKAGE_FACTOR": "standard", diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index e544f561a17..a5554b4d452 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -2,7 +2,7 @@ { "name": "Ubuntu jammy", "build": { - "dockerfile": "Dockerfile", + "dockerfile": "portability-Dockerfile", // See tox.ini for definitions "args": { "SYSTEM_FACTOR": "ubuntu-jammy", "PACKAGE_FACTOR": "standard", From 5cde5fe8c2b58d7d914318dccfdbf06385c77481 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 11 Aug 2022 09:32:07 -0700 Subject: [PATCH 48/96] src/doc/en/developer/portability_testing.rst: Expand on the devcontainer build --- src/doc/en/developer/portability_testing.rst | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 8ae23ad20d9..a1e6aa2b24c 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1181,19 +1181,24 @@ does not, use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`) to run the command "Remote-Containers: Reopen Folder in Container". By clicking on "Show Log", you can see what it does: -- It pulls the prebuilt image from ghcr.io; note that these - are multi-gigabyte images, so it may take a while. +- It pulls the prebuilt image from ghcr.io (via + `.devcontainer/portability-Dockerfile + `_); + note that these are multi-gigabyte images, so it may take a while. - As part of the "postCreateCommand", it installs additional system packages to - support VS Code and for development. Then it bootstraps and configures - the source tree and starts to build Sage from - source, reusing the installation (:envvar:`SAGE_LOCAL`, - :envvar:`SAGE_VENV`) from the prebuilt image. - -This sample file uses ``ubuntu-jammy-standard`` and the most recent -development version of Sage (``dev`` tag). You can edit a copy of the -configuration file to change to a different platform or another -version. After editing the configuration file (or changing the + support VS Code and for development. + +- Then, as part of the "postStartCommand", it bootstraps and + configures the source tree and starts to build Sage from source, + reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) + from the prebuilt image. + +This sample file uses ``ubuntu-jammy-standard``, the most recent +development version of Sage (``dev`` tag), and a full installation of +the Sage distribution (``with-targets``). You can edit a copy of the +configuration file to change to a different platform, another +version, or build stage. After editing the configuration file (or changing the symlink), run "Remote-Containers: Rebuild Container" from the Command Palette. See the `VS Code devcontainer.json reference `_ From bc0198af8d65b2d72c6ca7e9d2b70202e945e516 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 11 Aug 2022 09:49:53 -0700 Subject: [PATCH 49/96] .devcontainer/portability-post_start.sh: New, use it to simplify portability-.../devcontainer.json --- .../devcontainer.json | 2 +- .../devcontainer.json | 2 +- .devcontainer/portability-post_start.sh | 18 ++++++++++++++++++ .../devcontainer.json | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 .devcontainer/portability-post_start.sh diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json index b1eaf54015c..7b94ae1e906 100644 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -16,7 +16,7 @@ // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", + "postStartCommand": ".devcontainer/portability-post_start.sh", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json index fc3b9d5db47..9f4d6cb1cef 100644 --- a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json +++ b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json @@ -16,7 +16,7 @@ // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", + "postStartCommand": ".devcontainer/portability-post_start.sh", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/portability-post_start.sh b/.devcontainer/portability-post_start.sh new file mode 100755 index 00000000000..2945504f1c5 --- /dev/null +++ b/.devcontainer/portability-post_start.sh @@ -0,0 +1,18 @@ +#! /bin/sh +# The portability-.../devcontainer.json configurations run this script after the container is started. +# +# The script assumes that it is run from SAGE_ROOT. +# +# If "config.log" or "logs" are symlinks (for example, created by 'tox -e local-...', +# or after https://trac.sagemath.org/ticket/33262), remove them. +for f in config.log logs; do + if [ -L $f ]; then + rm -f $f + fi +done +# Bootstrap, configure, and build the Sage distribution, reusing the Sage installation from the prebuilt image. +set -e +set -x +make configure +./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv +make build V=0 diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index a5554b4d452..0d6c1bcf22d 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -16,7 +16,7 @@ // Run commands after the container is created: "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv && make build V=0", + "postStartCommand": ".devcontainer/portability-post_start.sh", "extensions": [ "ms-python.python" ] From 869f6e2eec454da74899394e5feb0f5222311a5c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 11 Aug 2022 10:36:19 -0700 Subject: [PATCH 50/96] .devcontainer/portability-post_start.sh: If upstream is a symlink, remove it; keep logs in container if possible --- .devcontainer/portability-post_start.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/portability-post_start.sh b/.devcontainer/portability-post_start.sh index 2945504f1c5..d19e37002c8 100755 --- a/.devcontainer/portability-post_start.sh +++ b/.devcontainer/portability-post_start.sh @@ -4,12 +4,17 @@ # The script assumes that it is run from SAGE_ROOT. # # If "config.log" or "logs" are symlinks (for example, created by 'tox -e local-...', -# or after https://trac.sagemath.org/ticket/33262), remove them. -for f in config.log logs; do +# or after https://trac.sagemath.org/ticket/33262), they might point outside of +# the devcontainer, so remove them. Likewise for upstream. +for f in config.log logs upstream; do if [ -L $f ]; then rm -f $f fi done +# If possible (ensured after https://trac.sagemath.org/ticket/33262), keep the logs in the container. +if [ ! -f logs ]; then + ln -s /sage/logs logs +fi # Bootstrap, configure, and build the Sage distribution, reusing the Sage installation from the prebuilt image. set -e set -x From 8bd20238d836a14dfde9a3a49d28abfe44768f21 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 11 Aug 2022 21:18:00 +0900 Subject: [PATCH 51/96] Some edits --- .devcontainer/cocalc/devcontainer.json | 2 +- .devcontainer/computop-sage/devcontainer.json | 2 +- .../devcontainer.json | 2 +- .../devcontainer.json | 2 +- .../devcontainer.json | 2 +- .../devcontainer.json | 2 +- .../devcontainer.json | 2 +- .../sagemath-sagemath/devcontainer.json | 2 +- src/doc/en/developer/portability_testing.rst | 95 ++++++++++--------- 9 files changed, 58 insertions(+), 53 deletions(-) diff --git a/.devcontainer/cocalc/devcontainer.json b/.devcontainer/cocalc/devcontainer.json index 5a51894682c..7752a065bd3 100644 --- a/.devcontainer/cocalc/devcontainer.json +++ b/.devcontainer/cocalc/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "CoCalc Docker", "image": "sagemathinc/cocalc" diff --git a/.devcontainer/computop-sage/devcontainer.json b/.devcontainer/computop-sage/devcontainer.json index 2228c6699f8..a852d04a6dd 100644 --- a/.devcontainer/computop-sage/devcontainer.json +++ b/.devcontainer/computop-sage/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "computop/sage Docker", "image": "computop/sage" diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index df959894af8..5f1a9d94543 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", diff --git a/.devcontainer/downstream-conda-forge-latest/devcontainer.json b/.devcontainer/downstream-conda-forge-latest/devcontainer.json index 22463c2dd29..d7528beee72 100644 --- a/.devcontainer/downstream-conda-forge-latest/devcontainer.json +++ b/.devcontainer/downstream-conda-forge-latest/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "condaforge/mambaforge:latest downstream Sage", "image": "condaforge/mambaforge:latest", diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json index 7b94ae1e906..67408930a2f 100644 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "Centos 7", "build": { diff --git a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json index 9f4d6cb1cef..9e002922051 100644 --- a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json +++ b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "Debian buster 32-bit", "build": { diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index 0d6c1bcf22d..cd3e8d86909 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "Ubuntu jammy", "build": { diff --git a/.devcontainer/sagemath-sagemath/devcontainer.json b/.devcontainer/sagemath-sagemath/devcontainer.json index 214491aef31..501bc46702e 100644 --- a/.devcontainer/sagemath-sagemath/devcontainer.json +++ b/.devcontainer/sagemath-sagemath/devcontainer.json @@ -1,4 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. +// See https://aka.ms/devcontainer.json for format details. { "name": "sagemath/sagemath Docker", // sagemath/sagemath-dev as of 9.5 is broken? diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index a1e6aa2b24c..2d59dad71c7 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -70,7 +70,7 @@ example, to run the current stable (LTS) version of Ubuntu interactively, you can use the shell command:: [mkoeppe@sage sage]$ docker run -it ubuntu:latest - root@9f3398da43c2:/# + root@9f3398da43c2:/# Here ``ubuntu`` is referred to as the "image (name)" and ``latest`` as the "tag". Other releases of Ubuntu are available under different @@ -118,9 +118,9 @@ this time let's mount the current directory into it:: root@39d693b2a75d:/# cd sage root@39d693b2a75d:/sage# ls COPYING.txt ... Makefile ... config configure configure.ac ... src tox.ini - + Typical Docker images provide minimal installations of packages only:: - + root@39d693b2a75d:/sage# command -v python root@39d693b2a75d:/sage# command -v gcc root@39d693b2a75d:/sage# @@ -128,7 +128,7 @@ Typical Docker images provide minimal installations of packages only:: As you can see above, the image ``ubuntu:latest`` has neither a Python nor a GCC installed, which are among the build prerequisites of Sage. We need to install them using the distribution's package manager first. - + Sage facilitates testing various distributions on Docker as follows. Discovering the system's package system @@ -136,7 +136,7 @@ Discovering the system's package system :: - root@39d693b2a75d:/sage# build/bin/sage-guess-package-system + root@39d693b2a75d:/sage# build/bin/sage-guess-package-system debian Let's install gcc, hoping that the Ubuntu package providing it is @@ -191,7 +191,7 @@ on our container to install the necessary build prerequisites:: root@39d693b2a75d:/sage# apt-get install binutils make m4 perl python3 tar bc gcc g++ ca-certificates Reading package lists... Done - Building dependency tree + Building dependency tree Reading state information... Done tar is already the newest version (1.29b-2ubuntu0.1). The following additional packages will be installed: @@ -204,7 +204,7 @@ automatically generated from the database of package names.) Now we can start the build:: - root@39d693b2a75d:/sage# ./configure + root@39d693b2a75d:/sage# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking for root user... yes configure: error: You cannot build Sage as root, switch to an unprivileged user. (If building in a container, use --enable-build-as-root.) @@ -236,7 +236,7 @@ packages. For example:: root@39d693b2a75d:/sage# ls build/pkgs/arb/distros/ arch.txt conda.txt debian.txt gentoo.txt - root@39d693b2a75d:/sage# cat build/pkgs/arb/distros/debian.txt + root@39d693b2a75d:/sage# cat build/pkgs/arb/distros/debian.txt libflint-arb-dev Note that these package equivalencies are based on a current stable or @@ -258,7 +258,7 @@ Let us install a subset of these packages:: Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-0ubuntu2) ... root@39d693b2a75d:/sage# - + Committing a container to disk ------------------------------ @@ -324,7 +324,7 @@ The ``Dockerfile`` instructs the command ``docker build`` to build a new Docker image. Let us take a quick look at the generated file; this is slightly simplified:: - [mkoeppe@sage sage]$ cat Dockerfile + [mkoeppe@sage sage]$ cat Dockerfile # Automatically generated by SAGE_ROOT/build/bin/write-dockerfile.sh # the :comments: separate the generated file into sections # to simplify writing scripts that customize this file @@ -419,7 +419,7 @@ We can now start a container using the image id shown in the last step:: -rw-r--r-- 1 root root 6025 Mar 26 22:27 ratpoints-2.1.3.p5.log root@fab59e09a641:/sage# ls -l local/lib/*rat* -rw-r--r-- 1 root root 177256 Mar 26 22:27 local/lib/libratpoints.a - + You can customize the image build process further by editing the ``Dockerfile``. For example, by default, the generated ``Dockerfile`` configures, builds, and tests Sage. By deleting or commenting out the @@ -545,13 +545,13 @@ create an image from the container:: Note: SAGE_ROOT=/sage (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ ls /usr/lib/libfl* /usr/lib/libflint-2.5.2.so /usr/lib/libflint-2.5.2.so.13.5.2 /usr/lib/libflint.a /usr/lib/libflint.so - (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ apt-get update && apt-get install apt-file + (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ apt-get update && apt-get install apt-file (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ apt-file update (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ apt-file search "/usr/lib/libfl.a" flex-old: /usr/lib/libfl.a freebsd-buildutils: /usr/lib/libfl.a (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ apt-get install flex-old - (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ ./spkg-install + (sage-buildsh) root@2d9ac65f4572:surf-1.0.6-gcc6$ ./spkg-install checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes ... @@ -564,7 +564,7 @@ create an image from the container:: [mkoeppe@sage sage]$ A standard case of bitrot. - + Automatic Docker-based build testing using tox ---------------------------------------------- @@ -633,11 +633,11 @@ To run an environment:: [mkoeppe@sage sage]$ tox -e docker-slackware-14.2-minimal [mkoeppe@sage sage]$ tox -e docker-ubuntu-bionic-standard - + Arbitrary extra arguments to ``docker build`` can be supplied through the environment variable ``EXTRA_DOCKER_BUILD_ARGS``. For example, for a non-silent build (``make V=1``), use:: - + [mkoeppe@sage sage]$ EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"V=1\"" \ tox -e docker-ubuntu-bionic-standard @@ -867,7 +867,7 @@ an isolated copy of Homebrew with all prerequisites for bootstrapping:: ... local-homebrew-macos-minimal: commands succeeded congratulations :) - + The tox environment uses the subdirectory ``homebrew`` of the environment directory ``.tox/local-homebrew-macos-minimal`` as the Homebrew prefix. This installation does not interact in any way with @@ -985,7 +985,7 @@ system configurations. For more information, see the `GitHub documentation `_. -Alternatively, you can create and push a custom tag in order to trigger a run of tests as follows. +Alternatively, you can create and push a custom tag in order to trigger a run of tests as follows. Let's assume that ``github`` is the name of the remote corresponding to your GitHub fork of the Sage repository:: @@ -1107,19 +1107,19 @@ for example, the following command will work:: $ docker run -it ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional:dev bash Unable to find image 'ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional:dev' locally dev: Pulling from sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional - d5fd17ec1767: Already exists - 67586203f0c7: Pull complete + d5fd17ec1767: Already exists + 67586203f0c7: Pull complete b63c529f4777: Pull complete ... - 159775d1a3d2: Pull complete + 159775d1a3d2: Pull complete Digest: sha256:e6ba5e12f59c6c4668692ef4cfe4ae5f242556482664fb347bf260f32bf8e698 Status: Downloaded newer image for ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets-optional:dev - root@8055a7ba0607:/sage# ./sage + root@8055a7ba0607:/sage# ./sage ┌────────────────────────────────────────────────────────────────────┐ │ SageMath version 9.6, Release Date: 2022-05-15 │ │ Using Python 3.8.10. Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ - sage: + sage: Images whose names end with the suffix ``-with-targets-optional`` are the results of full builds and a run of ``make ptest``. They also @@ -1145,11 +1145,11 @@ are available: ptest`` has not been run yet. -Developing with our pre-built Docker images as devcontainers in VS Code -======================================================================= +Using our pre-built Docker images for development in VS Code +============================================================ -`VS Code ` is very -convenient for working with Docker containers thanks to the `Visual +`VS Code `_ is very +convenient for developing with Docker containers thanks to the `Visual Studio Code Remote - Containers `_ extension. @@ -1158,11 +1158,15 @@ Sage provides sample ``devcontainer.json`` configuration files `_ for this purpose. -To get started, symlink (or copy) the sample file -`.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json -`_ -to ``devcontainer.json`` in the directory ``.devcontainer``. For -example, in macOS using the shell:: +To get started, symlink (or copy) one of the sample files to +``$SAGE_ROOT/.devcontainer/devcontainer.json``. For example, choose +`$SAGE_ROOT/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +`_, which uses the Docker image based on ``ubuntu-jammy-standard``, +the most recent +development version of Sage (``dev`` tag), and a full installation of +the Sage distribution (``with-targets``). + +For example, in macOS, you can do this using the shell as follows:: [mkoeppe@sage sage] $ (cd .devcontainer && ln -s portability-ubuntu-jammy-standard/devcontainer.json .) @@ -1178,8 +1182,9 @@ In VS Code, click the "Extension" icon on the left (or press With the extension installed, VS Code may prompt you whether you would like to open the current directory in the devcontainer (yes). If it does not, use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + -:kbd:`P`) to run the command "Remote-Containers: Reopen Folder in -Container". By clicking on "Show Log", you can see what it does: +:kbd:`P`), enter the command "Remote-Containers: Reopen Folder in +Container" , and hit :kbd:`Enter`. +By clicking on "Show Log", you can see what it does: - It pulls the prebuilt image from ghcr.io (via `.devcontainer/portability-Dockerfile @@ -1194,10 +1199,7 @@ Container". By clicking on "Show Log", you can see what it does: reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) from the prebuilt image. -This sample file uses ``ubuntu-jammy-standard``, the most recent -development version of Sage (``dev`` tag), and a full installation of -the Sage distribution (``with-targets``). You can edit a copy of the -configuration file to change to a different platform, another +You can edit a copy of the configuration file to change to a different platform, another version, or build stage. After editing the configuration file (or changing the symlink), run "Remote-Containers: Rebuild Container" from the Command Palette. See the `VS Code devcontainer.json reference @@ -1206,34 +1208,36 @@ and the `GitHub introduction to dev containers `_ for more information. -In addition to the ``.devcontainer/portability-.../devcontainer.json`` files, Sage also -provides several other sample ``devcontainer.json`` configuration files: +In addition to the +``$SAGE_ROOT/.devcontainer/portability-.../devcontainer.json`` files, Sage also +provides several other sample ``devcontainer.json`` configuration files in the +directory ``$SAGE_ROOT/.devcontainer``: -- `.devcontainer/downstream-archlinux-latest/devcontainer.json +- `downstream-archlinux-latest/devcontainer.json `_ configures a container with an installation of `Arch Linux `_ and its SageMath package. (Arch Linux packaging is downstream from the Sage project, hence the prefix ``downstream-...``; the suffix ``latest`` indicates the most recent version of Arch Linux as available on Docker Hub.) -- `.devcontainer/downstream-conda-forge-latest/devcontainer.json +- `downstream-conda-forge-latest/devcontainer.json `_ similarly configures a container with an installation of conda-forge and its SageMath package. -- `.devcontainer/cocalc/devcontainer.json +- `cocalc/devcontainer.json `_ configures a container with `the CoCalc Docker image `_. It then updates the installation of SageMath in this container by building from the current source tree. -- `.devcontainer/computop-sage/devcontainer.json +- `computop-sage/devcontainer.json `_ configures a container with the `Docker image from the 3-manifolds project `_, providing SnapPy, Regina, PHCPack, etc. It then updates the installation of SageMath in this container by building from the current source tree. -- `.devcontainer/sagemath-sagemath/devcontainer.json +- `sagemath-sagemath/devcontainer.json `_ configures a container with `SageMath's official Docker image `_. It then updates the installation of SageMath in this container by building from @@ -1242,3 +1246,4 @@ provides several other sample ``devcontainer.json`` configuration files: These ``devcontainer.json`` configuration files are useful for testing user scripts on these deployments of SageMath. You may also find it useful to copy these configurations into your own projects or to adapt them to your needs. + From 9439ce6966629e20ac118fa92649dcf13d7c8f14 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Fri, 12 Aug 2022 10:18:07 +0900 Subject: [PATCH 52/96] More edits --- .devcontainer/cocalc/devcontainer.json | 2 +- .devcontainer/computop-sage/devcontainer.json | 2 +- .devcontainer/portability-post_start.sh | 9 ++-- .../sagemath-sagemath/devcontainer.json | 2 +- src/doc/en/developer/portability_testing.rst | 42 +++++++++++-------- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.devcontainer/cocalc/devcontainer.json b/.devcontainer/cocalc/devcontainer.json index 7752a065bd3..303d77bd51e 100644 --- a/.devcontainer/cocalc/devcontainer.json +++ b/.devcontainer/cocalc/devcontainer.json @@ -1,7 +1,7 @@ // See https://aka.ms/devcontainer.json for format details. { "name": "CoCalc Docker", - "image": "sagemathinc/cocalc" + "image": "sagemathinc/cocalc", "containerEnv": { "MAKE": "make -j12" }, diff --git a/.devcontainer/computop-sage/devcontainer.json b/.devcontainer/computop-sage/devcontainer.json index a852d04a6dd..c73ae9a564e 100644 --- a/.devcontainer/computop-sage/devcontainer.json +++ b/.devcontainer/computop-sage/devcontainer.json @@ -1,7 +1,7 @@ // See https://aka.ms/devcontainer.json for format details. { "name": "computop/sage Docker", - "image": "computop/sage" + "image": "computop/sage", "containerEnv": { "MAKE": "make -j12" }, diff --git a/.devcontainer/portability-post_start.sh b/.devcontainer/portability-post_start.sh index d19e37002c8..95a49473e2b 100755 --- a/.devcontainer/portability-post_start.sh +++ b/.devcontainer/portability-post_start.sh @@ -1,5 +1,6 @@ #! /bin/sh -# The portability-.../devcontainer.json configurations run this script after the container is started. +# The portability-.../devcontainer.json configurations run this script after +# the container is started. # # The script assumes that it is run from SAGE_ROOT. # @@ -11,11 +12,13 @@ for f in config.log logs upstream; do rm -f $f fi done -# If possible (ensured after https://trac.sagemath.org/ticket/33262), keep the logs in the container. +# If possible (ensured after https://trac.sagemath.org/ticket/33262), keep the +# logs in the container. if [ ! -f logs ]; then ln -s /sage/logs logs fi -# Bootstrap, configure, and build the Sage distribution, reusing the Sage installation from the prebuilt image. +# Bootstrap, configure, and build the Sage distribution, reusing the Sage +# installation from the prebuilt image. set -e set -x make configure diff --git a/.devcontainer/sagemath-sagemath/devcontainer.json b/.devcontainer/sagemath-sagemath/devcontainer.json index 501bc46702e..58112128e4a 100644 --- a/.devcontainer/sagemath-sagemath/devcontainer.json +++ b/.devcontainer/sagemath-sagemath/devcontainer.json @@ -2,7 +2,7 @@ { "name": "sagemath/sagemath Docker", // sagemath/sagemath-dev as of 9.5 is broken? - "image": "sagemath/sagemath:develop" + "image": "sagemath/sagemath:develop", "containerEnv": { "MAKE": "make -j12" }, diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 2d59dad71c7..e443b926e9f 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1153,10 +1153,16 @@ convenient for developing with Docker containers thanks to the `Visual Studio Code Remote - Containers `_ extension. -Sage provides sample ``devcontainer.json`` configuration files +If the extension is not already installed, then in VS Code, click the +"Extension" icon on the left (or press :kbd:`Ctrl` + :kbd:`Shift` + :kbd:`X`; +on macOS, :kbd:`Command` + :kbd:`Shift` + :kbd:`X`) to open a list of +extensions. Search for "Remote - Containers" and install it. + +The extension needs a ``devcontainer.json`` configuration file to work. Sage +provides sample ``devcontainer.json`` configuration files `$SAGE_ROOT/.devcontainer/*/devcontainer.json -`_ -for this purpose. +`_ for this +purpose. To get started, symlink (or copy) one of the sample files to ``$SAGE_ROOT/.devcontainer/devcontainer.json``. For example, choose @@ -1166,28 +1172,28 @@ the most recent development version of Sage (``dev`` tag), and a full installation of the Sage distribution (``with-targets``). -For example, in macOS, you can do this using the shell as follows:: +In macOS for example, you can do this using the shell as follows:: [mkoeppe@sage sage] $ (cd .devcontainer && ln -s portability-ubuntu-jammy-standard/devcontainer.json .) -Then, start VS Code:: +Now start VS Code:: [mkoeppe@sage sage] $ code . -In VS Code, click the "Extension" icon on the left (or press -:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`X`; on macOS, :kbd:`Command` + -:kbd:`Shift` + :kbd:`X`) to open a list of extensions. Search for -"Remote - Containers" and install it if it is not already installed. +Then VS Code may prompt you whether you would like to open the current +directory in the configured devcontainer (yes). If it does not, use the command palette +(:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`), enter the command "Remote-Containers: +Reopen Folder in Container" , and hit :kbd:`Enter`. + +If the above ``code .`` command does not work, start VS Code as a regular application, then in the +command palette of VS Code, enter "Remote-Containers: Open Folder Container", +and hit :kbd:`Enter`, and choose the Sage repository ``$SAGE_ROOT``. -With the extension installed, VS Code may prompt you whether you would -like to open the current directory in the devcontainer (yes). If it -does not, use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + -:kbd:`P`), enter the command "Remote-Containers: Reopen Folder in -Container" , and hit :kbd:`Enter`. -By clicking on "Show Log", you can see what it does: +Once VS Code starts running the configured devcontainer, by clicking on "Show Log", +you can see what it does: - It pulls the prebuilt image from ghcr.io (via - `.devcontainer/portability-Dockerfile + `$SAGE_ROOT/.devcontainer/portability-Dockerfile `_); note that these are multi-gigabyte images, so it may take a while. @@ -1201,8 +1207,8 @@ By clicking on "Show Log", you can see what it does: You can edit a copy of the configuration file to change to a different platform, another version, or build stage. After editing the configuration file (or changing the -symlink), run "Remote-Containers: Rebuild Container" from the Command -Palette. See the `VS Code devcontainer.json reference +symlink), run "Remote-Containers: Rebuild Container" from the command +palette. See the `VS Code devcontainer.json reference `_ and the `GitHub introduction to dev containers `_ From 4bd8169eb26349b8a0f64cb03c983e0adfe8f8ff Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Fri, 12 Aug 2022 10:21:37 +0900 Subject: [PATCH 53/96] A typo --- src/doc/en/developer/portability_testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index e443b926e9f..600086f46c2 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1186,7 +1186,7 @@ directory in the configured devcontainer (yes). If it does not, use the command Reopen Folder in Container" , and hit :kbd:`Enter`. If the above ``code .`` command does not work, start VS Code as a regular application, then in the -command palette of VS Code, enter "Remote-Containers: Open Folder Container", +command palette of VS Code, enter "Remote-Containers: Open Folder in Container", and hit :kbd:`Enter`, and choose the Sage repository ``$SAGE_ROOT``. Once VS Code starts running the configured devcontainer, by clicking on "Show Log", From 1bad4cab778c109dfe3c89130804d6429a366431 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Fri, 12 Aug 2022 20:26:47 +0900 Subject: [PATCH 54/96] Some tiny edits --- .devcontainer/cocalc/devcontainer.json | 2 +- .devcontainer/computop-sage/devcontainer.json | 2 +- .devcontainer/downstream-archlinux-latest/devcontainer.json | 2 +- .devcontainer/downstream-conda-forge-latest/devcontainer.json | 2 +- .devcontainer/portability-Dockerfile | 3 ++- .../devcontainer.json | 2 +- .../portability-debian-buster-i386-standard/devcontainer.json | 2 +- .devcontainer/portability-post_start.sh | 2 +- .../portability-ubuntu-jammy-standard/devcontainer.json | 2 +- .devcontainer/sagemath-sagemath/devcontainer.json | 4 ++-- src/doc/en/developer/portability_testing.rst | 4 ++-- 11 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.devcontainer/cocalc/devcontainer.json b/.devcontainer/cocalc/devcontainer.json index 303d77bd51e..c62375d75e0 100644 --- a/.devcontainer/cocalc/devcontainer.json +++ b/.devcontainer/cocalc/devcontainer.json @@ -5,7 +5,7 @@ "containerEnv": { "MAKE": "make -j12" }, - // Run commands after the container is created: + // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv && make build V=0", diff --git a/.devcontainer/computop-sage/devcontainer.json b/.devcontainer/computop-sage/devcontainer.json index c73ae9a564e..244ebf0e750 100644 --- a/.devcontainer/computop-sage/devcontainer.json +++ b/.devcontainer/computop-sage/devcontainer.json @@ -5,7 +5,7 @@ "containerEnv": { "MAKE": "make -j12" }, - // Run commands after the container is created: + // Run commands after the container is created. // Install build tools, get rid of sourcing /sage/activate in non-login shells. "postCreateCommand": ".devcontainer/post_create.sh --sudo && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Run commands after the container is started. diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index 5f1a9d94543..8f0b1480700 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -2,7 +2,7 @@ { "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", - // Run commands after the container is created: + // Run commands after the container is created. "postCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": "make configure && ln -sf /usr venv", diff --git a/.devcontainer/downstream-conda-forge-latest/devcontainer.json b/.devcontainer/downstream-conda-forge-latest/devcontainer.json index d7528beee72..a38b23f880a 100644 --- a/.devcontainer/downstream-conda-forge-latest/devcontainer.json +++ b/.devcontainer/downstream-conda-forge-latest/devcontainer.json @@ -2,7 +2,7 @@ { "name": "condaforge/mambaforge:latest downstream Sage", "image": "condaforge/mambaforge:latest", - // Run commands after the container is created: + // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh && mamba install --yes sage", // Run commands after the container is started. "postStartCommand": "make configure && ln -sf $CONDA_PREFIX venv", diff --git a/.devcontainer/portability-Dockerfile b/.devcontainer/portability-Dockerfile index 52ca0bc6c75..532a1854258 100644 --- a/.devcontainer/portability-Dockerfile +++ b/.devcontainer/portability-Dockerfile @@ -1,5 +1,6 @@ # This Dockerfile is used by all portability-.../devcontainer.json files, -# which provide the actual values for the 4 arguments defined below. +# which provide the actual values for the 4 arguments defined below, which +# feed into the FROM statement that determines the base Docker image. ARG SYSTEM_FACTOR="ubuntu-jammy" ARG PACKAGE_FACTOR="standard" ARG DOCKER_TARGET="with-system-packages" diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json index 67408930a2f..f6f53ebc87b 100644 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -13,7 +13,7 @@ "containerEnv": { "MAKE": "make -j12" }, - // Run commands after the container is created: + // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": ".devcontainer/portability-post_start.sh", diff --git a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json index 9e002922051..c7ea829b269 100644 --- a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json +++ b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json @@ -13,7 +13,7 @@ "containerEnv": { "MAKE": "make -j12" }, - // Run commands after the container is created: + // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": ".devcontainer/portability-post_start.sh", diff --git a/.devcontainer/portability-post_start.sh b/.devcontainer/portability-post_start.sh index 95a49473e2b..45d0cfb5555 100755 --- a/.devcontainer/portability-post_start.sh +++ b/.devcontainer/portability-post_start.sh @@ -6,7 +6,7 @@ # # If "config.log" or "logs" are symlinks (for example, created by 'tox -e local-...', # or after https://trac.sagemath.org/ticket/33262), they might point outside of -# the devcontainer, so remove them. Likewise for upstream. +# the dev container, so remove them. Likewise for upstream. for f in config.log logs upstream; do if [ -L $f ]; then rm -f $f diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index cd3e8d86909..1ce79588c26 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -13,7 +13,7 @@ "containerEnv": { "MAKE": "make -j12" }, - // Run commands after the container is created: + // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. "postStartCommand": ".devcontainer/portability-post_start.sh", diff --git a/.devcontainer/sagemath-sagemath/devcontainer.json b/.devcontainer/sagemath-sagemath/devcontainer.json index 58112128e4a..02d5c9fa8db 100644 --- a/.devcontainer/sagemath-sagemath/devcontainer.json +++ b/.devcontainer/sagemath-sagemath/devcontainer.json @@ -6,8 +6,8 @@ "containerEnv": { "MAKE": "make -j12" }, - // Run commands after the container is created: - // Install build tools + // Run commands after the container is created. + // Install build tools. "postCreateCommand": ".devcontainer/post_create.sh --sudo" // Run commands after the container is started. // Do not run configure within a sage-env (see #29485). diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 600086f46c2..68873a51781 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1181,7 +1181,7 @@ Now start VS Code:: [mkoeppe@sage sage] $ code . Then VS Code may prompt you whether you would like to open the current -directory in the configured devcontainer (yes). If it does not, use the command palette +directory in the dev container (yes). If it does not, use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`), enter the command "Remote-Containers: Reopen Folder in Container" , and hit :kbd:`Enter`. @@ -1189,7 +1189,7 @@ If the above ``code .`` command does not work, start VS Code as a regular applic command palette of VS Code, enter "Remote-Containers: Open Folder in Container", and hit :kbd:`Enter`, and choose the Sage repository ``$SAGE_ROOT``. -Once VS Code starts running the configured devcontainer, by clicking on "Show Log", +Once VS Code starts running the dev container, by clicking on "show log", you can see what it does: - It pulls the prebuilt image from ghcr.io (via From 85fa6ad0653a7c37b4861be80f25d1550a75f5b5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 12 Aug 2022 12:05:48 -0700 Subject: [PATCH 55/96] .devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json: Enable the devtoolset --- .../devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json index f6f53ebc87b..273a5deabab 100644 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -16,7 +16,7 @@ // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": ".devcontainer/portability-post_start.sh", + "postStartCommand": ". /opt/rh/devtoolset-11/enable && .devcontainer/portability-post_start.sh", "extensions": [ "ms-python.python" ] From 7f9ba982ba3e35e88c0bec99df4eefa348cf42b0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 12 Aug 2022 12:06:52 -0700 Subject: [PATCH 56/96] .devcontainer/portability-post_start.sh: Fix up logs symlinkery --- .devcontainer/portability-post_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/portability-post_start.sh b/.devcontainer/portability-post_start.sh index 45d0cfb5555..03e1605b0aa 100755 --- a/.devcontainer/portability-post_start.sh +++ b/.devcontainer/portability-post_start.sh @@ -14,7 +14,7 @@ for f in config.log logs upstream; do done # If possible (ensured after https://trac.sagemath.org/ticket/33262), keep the # logs in the container. -if [ ! -f logs ]; then +if [ ! -d logs ]; then ln -s /sage/logs logs fi # Bootstrap, configure, and build the Sage distribution, reusing the Sage From c06132dd7c7d7af1cdf1146fd189424c9bb7006e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 12 Aug 2022 12:07:16 -0700 Subject: [PATCH 57/96] .devcontainer/portability-post_start.sh: Pick up configuration from image --- .devcontainer/portability-post_start.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.devcontainer/portability-post_start.sh b/.devcontainer/portability-post_start.sh index 03e1605b0aa..a923fc0d106 100755 --- a/.devcontainer/portability-post_start.sh +++ b/.devcontainer/portability-post_start.sh @@ -22,5 +22,9 @@ fi set -e set -x make configure -./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv +if [ -x /sage/config.status ]; then + eval ./configure $(/sage/config.status --config) --enable-build-as-root --prefix=/sage/local --with-sage-venv +else + ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv +fi make build V=0 From 1355787df880d72dfaae58f3c62ace0cbdb82a9f Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Sat, 13 Aug 2022 09:21:00 +0900 Subject: [PATCH 58/96] Add note --- .../devcontainer.json | 2 +- .../devcontainer.json | 2 +- src/doc/en/developer/portability_testing.rst | 20 +++++++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json index 273a5deabab..4a97fb3cb2c 100644 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -3,7 +3,7 @@ "name": "Centos 7", "build": { "dockerfile": "portability-Dockerfile", - // See tox.ini for definitions + // See tox.ini for definitions. "args": { "SYSTEM_FACTOR": "centos-7-devtoolset-gcc_11", "PACKAGE_FACTOR": "standard", "DOCKER_TARGET": "with-targets", diff --git a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json index c7ea829b269..0e6bc8d88e0 100644 --- a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json +++ b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json @@ -3,7 +3,7 @@ "name": "Debian buster 32-bit", "build": { "dockerfile": "portability-Dockerfile", - // See tox.ini for definitions + // See tox.ini for definitions. "args": { "SYSTEM_FACTOR": "debian-buster-i386", "PACKAGE_FACTOR": "standard", "DOCKER_TARGET": "with-targets", diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 68873a51781..dd8b7ea4df1 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -986,7 +986,7 @@ system configurations. For more information, see the `GitHub documentation `_. Alternatively, you can create and push a custom tag in order to trigger a run of tests as follows. -Let's assume that ``github`` is the name of +Let's assume that ``my-github`` is the name of the remote corresponding to your GitHub fork of the Sage repository:: $ git remote -v | grep /my-github @@ -1185,9 +1185,10 @@ directory in the dev container (yes). If it does not, use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`), enter the command "Remote-Containers: Reopen Folder in Container" , and hit :kbd:`Enter`. -If the above ``code .`` command does not work, start VS Code as a regular application, then in the -command palette of VS Code, enter "Remote-Containers: Open Folder in Container", -and hit :kbd:`Enter`, and choose the Sage repository ``$SAGE_ROOT``. +If the above ``code .`` command does not work, start VS Code as a regular +application, then in the command palette of VS Code, enter "Remote-Containers: +Open Folder in Container", and hit :kbd:`Enter`, and choose the directory +``$SAGE_ROOT`` of your local Sage repository. Once VS Code starts running the dev container, by clicking on "show log", you can see what it does: @@ -1205,6 +1206,17 @@ you can see what it does: reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) from the prebuilt image. +After VS Code finished configuring the dev container, your local Sage +repository at ``$SAGE_ROOT`` is available in the container at the directory +``/workspaces/``. You may need to open a new Terminal to start +working from the directory. + +.. NOTE:: + + Your Sage at ``$SAGE_ROOT`` was configured and rebuilt inside the dev + container. Hence after working with VS Code, you may want to rebuild the Sage + for your local platform. + You can edit a copy of the configuration file to change to a different platform, another version, or build stage. After editing the configuration file (or changing the symlink), run "Remote-Containers: Rebuild Container" from the command From a9ba6d276336fbded0ee6fc9bb25893c141a0a8c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 12 Aug 2022 18:07:51 -0700 Subject: [PATCH 59/96] .devcontainer/portability-debian-buster-i386-standard: Remove (does not work) --- .../devcontainer.json | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 .devcontainer/portability-debian-buster-i386-standard/devcontainer.json diff --git a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json b/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json deleted file mode 100644 index 0e6bc8d88e0..00000000000 --- a/.devcontainer/portability-debian-buster-i386-standard/devcontainer.json +++ /dev/null @@ -1,23 +0,0 @@ -// See https://aka.ms/devcontainer.json for format details. -{ - "name": "Debian buster 32-bit", - "build": { - "dockerfile": "portability-Dockerfile", - // See tox.ini for definitions. - "args": { "SYSTEM_FACTOR": "debian-buster-i386", - "PACKAGE_FACTOR": "standard", - "DOCKER_TARGET": "with-targets", - "DOCKER_TAG": "dev" - } - }, - "containerEnv": { - "MAKE": "make -j12" - }, - // Run commands after the container is created. - "postCreateCommand": ".devcontainer/post_create.sh", - // Run commands after the container is started. - "postStartCommand": ".devcontainer/portability-post_start.sh", - "extensions": [ - "ms-python.python" - ] -} From afe62c2902db425e494b55f474ba70f11e14e300 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 12 Aug 2022 18:19:30 -0700 Subject: [PATCH 60/96] src/doc/en/developer/portability_testing.rst: Expand note on going back to local --- src/doc/en/developer/portability_testing.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index dd8b7ea4df1..22b9c01c0b6 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1214,8 +1214,12 @@ working from the directory. .. NOTE:: Your Sage at ``$SAGE_ROOT`` was configured and rebuilt inside the dev - container. Hence after working with VS Code, you may want to rebuild the Sage - for your local platform. + container. In particular, ``$SAGE_ROOT/venv``, ``$SAGE_ROOT/prefix``, and + (possibly) ``$SAGE_ROOT/logs`` will be symbolic links that work inside the dev + container, but not in your local file system; and also the script + ``$SAGE_ROOT/sage`` will not work. Hence after working with the dev container, + you will want to remove ``logs`` if it is a symbolic link, and to re-run the + ``configure`` script. You can edit a copy of the configuration file to change to a different platform, another version, or build stage. After editing the configuration file (or changing the From 86876262faffac5f3fed12e08b0cf0b45e3e216c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 12 Aug 2022 23:14:26 -0700 Subject: [PATCH 61/96] .devcontainer/cocalc/devcontainer.json: Fix ecm build --- .devcontainer/cocalc/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/cocalc/devcontainer.json b/.devcontainer/cocalc/devcontainer.json index c62375d75e0..47a5a682dff 100644 --- a/.devcontainer/cocalc/devcontainer.json +++ b/.devcontainer/cocalc/devcontainer.json @@ -6,7 +6,8 @@ "MAKE": "make -j12" }, // Run commands after the container is created. - "postCreateCommand": ".devcontainer/post_create.sh", + // libgmp.a is broken and leads to a build failure of ecm. + "postCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", // Run commands after the container is started. "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv && make build V=0", "extensions": [ From 0ea8654bbd60b4bae5f1dc63c1494466d53473f1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 09:31:32 -0700 Subject: [PATCH 62/96] .devcontainer/computop-sage/devcontainer.json: Fix ecm build --- .devcontainer/computop-sage/devcontainer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/computop-sage/devcontainer.json b/.devcontainer/computop-sage/devcontainer.json index 244ebf0e750..639fc9543a4 100644 --- a/.devcontainer/computop-sage/devcontainer.json +++ b/.devcontainer/computop-sage/devcontainer.json @@ -7,11 +7,13 @@ }, // Run commands after the container is created. // Install build tools, get rid of sourcing /sage/activate in non-login shells. - "postCreateCommand": ".devcontainer/post_create.sh --sudo && sed -i.bak '/sage.*activate/d' ~/.bashrc", + // libgmp.a is broken and leads to a build failure of ecm. + "postCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Run commands after the container is started. // Do not run configure within a sage-env (see #29485). // The pari package is broken in the computop/sage 9.5 image, need to reinstall. // Also libnauty is broken. + "postStartCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv) && make pari-clean nauty-clean build V=0", "extensions": [ "ms-python.python" From 822d9d1e4ad254ab7284828655747c177eeac1cb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 10:54:57 -0700 Subject: [PATCH 63/96] .devcontainer/develop-docker-{cocalc,computop}/, .devcontainer/downstream-docker-{cocalc,computop,sagemath}: Rename/specialize from cocalc, computop-sage, sagemath-sagemath --- .../devcontainer.json | 0 .../devcontainer.json | 0 .../devcontainer.json | 16 +++++++++++ .../devcontainer.json | 21 ++++++++++++++ .../devcontainer.json | 0 src/doc/en/developer/portability_testing.rst | 28 ++++++++++++------- 6 files changed, 55 insertions(+), 10 deletions(-) rename .devcontainer/{cocalc => develop-docker-cocalc}/devcontainer.json (100%) rename .devcontainer/{computop-sage => develop-docker-computop}/devcontainer.json (100%) create mode 100644 .devcontainer/downstream-docker-cocalc/devcontainer.json create mode 100644 .devcontainer/downstream-docker-computop/devcontainer.json rename .devcontainer/{sagemath-sagemath => downstream-docker-sagemath}/devcontainer.json (100%) diff --git a/.devcontainer/cocalc/devcontainer.json b/.devcontainer/develop-docker-cocalc/devcontainer.json similarity index 100% rename from .devcontainer/cocalc/devcontainer.json rename to .devcontainer/develop-docker-cocalc/devcontainer.json diff --git a/.devcontainer/computop-sage/devcontainer.json b/.devcontainer/develop-docker-computop/devcontainer.json similarity index 100% rename from .devcontainer/computop-sage/devcontainer.json rename to .devcontainer/develop-docker-computop/devcontainer.json diff --git a/.devcontainer/downstream-docker-cocalc/devcontainer.json b/.devcontainer/downstream-docker-cocalc/devcontainer.json new file mode 100644 index 00000000000..bc97538c63b --- /dev/null +++ b/.devcontainer/downstream-docker-cocalc/devcontainer.json @@ -0,0 +1,16 @@ +// See https://aka.ms/devcontainer.json for format details. +{ + "name": "CoCalc Docker", + "image": "sagemathinc/cocalc", + "containerEnv": { + "MAKE": "make -j12" + }, + // Run commands after the container is created. + // libgmp.a is broken and leads to a build failure of ecm. + "postCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", + // Run commands after the container is started. + "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv", + "extensions": [ + "ms-python.python" + ] +} diff --git a/.devcontainer/downstream-docker-computop/devcontainer.json b/.devcontainer/downstream-docker-computop/devcontainer.json new file mode 100644 index 00000000000..0f9ba0b8841 --- /dev/null +++ b/.devcontainer/downstream-docker-computop/devcontainer.json @@ -0,0 +1,21 @@ +// See https://aka.ms/devcontainer.json for format details. +{ + "name": "computop/sage Docker", + "image": "computop/sage", + "containerEnv": { + "MAKE": "make -j12" + }, + // Run commands after the container is created. + // Install build tools, get rid of sourcing /sage/activate in non-login shells. + // libgmp.a is broken and leads to a build failure of ecm. + "postCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", + // Run commands after the container is started. + // Do not run configure within a sage-env (see #29485). + // The pari package is broken in the computop/sage 9.5 image, need to reinstall. + // Also libnauty is broken. + + "postStartCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv)", + "extensions": [ + "ms-python.python" + ] +} diff --git a/.devcontainer/sagemath-sagemath/devcontainer.json b/.devcontainer/downstream-docker-sagemath/devcontainer.json similarity index 100% rename from .devcontainer/sagemath-sagemath/devcontainer.json rename to .devcontainer/downstream-docker-sagemath/devcontainer.json diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 22b9c01c0b6..b4599a457fd 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1246,25 +1246,33 @@ directory ``$SAGE_ROOT/.devcontainer``: `_ similarly configures a container with an installation of conda-forge and its SageMath package. -- `cocalc/devcontainer.json - `_ +- `downstream-docker-sagemath/devcontainer.json + `_ + configures a container with `SageMath's official Docker image `_. + +- `downstream-docker-cocalc/devcontainer.json + `_ + configures a container with `the CoCalc Docker image `_. + +- `develop-docker-cocalc/devcontainer.json + `_ configures a container with `the CoCalc Docker image `_. It then updates the installation of SageMath in this container by building from the current source tree. -- `computop-sage/devcontainer.json - `_ +- `downstream-docker-computop/devcontainer.json + `_ + configures a container with the `Docker image from the 3-manifolds + project `_, providing + SnapPy, Regina, PHCPack, etc. + +- `develop-docker-computop/devcontainer.json + `_ configures a container with the `Docker image from the 3-manifolds project `_, providing SnapPy, Regina, PHCPack, etc. It then updates the installation of SageMath in this container by building from the current source tree. -- `sagemath-sagemath/devcontainer.json - `_ - configures a container with `SageMath's official Docker image `_. - It then updates the installation of SageMath in this container by building from - the current source tree. - These ``devcontainer.json`` configuration files are useful for testing user scripts on these deployments of SageMath. You may also find it useful to copy these configurations into your own projects or to adapt them to your needs. From cf27a5ecf82f203ba92e0bc4d84f4ff48d627ea9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 11:50:26 -0700 Subject: [PATCH 64/96] .devcontainer/downstream-docker-cocalc/devcontainer.json: Only run Sage config when in a Sage source tree --- .../downstream-docker-cocalc/devcontainer.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.devcontainer/downstream-docker-cocalc/devcontainer.json b/.devcontainer/downstream-docker-cocalc/devcontainer.json index bc97538c63b..161c562d04d 100644 --- a/.devcontainer/downstream-docker-cocalc/devcontainer.json +++ b/.devcontainer/downstream-docker-cocalc/devcontainer.json @@ -9,7 +9,15 @@ // libgmp.a is broken and leads to a build failure of ecm. "postCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", // Run commands after the container is started. - "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv", + // * If the workspace directory looks like a copy of the Sage source tree (SAGE_ROOT): + // - it bootstraps and configures the Sage distribution, + // - thus, the script ``./sage`` and the symlinks ``prefix``, ``venv`` are set as expected, + // - the source tree is prepared for rebuilding Sage based from the source tree on + // top of the existing installation from the Docker image. + // - however, do not start the build. + // * Otherwise, do nothing. This is so that users can copy this devcontainer.json file as is + // into their projects. + "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", "extensions": [ "ms-python.python" ] From 7ea06b3cecc6b841b6f20a56626efc7ae80dd654 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 12:13:20 -0700 Subject: [PATCH 65/96] src/doc/en/developer/portability_testing.rst: Expand on devcontainer directory prefixes --- src/doc/en/developer/portability_testing.rst | 31 ++++++++++++-------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index b4599a457fd..23e1da8108b 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1233,7 +1233,15 @@ for more information. In addition to the ``$SAGE_ROOT/.devcontainer/portability-.../devcontainer.json`` files, Sage also provides several other sample ``devcontainer.json`` configuration files in the -directory ``$SAGE_ROOT/.devcontainer``: +directory ``$SAGE_ROOT/.devcontainer``. + +Files named ``$SAGE_ROOT/.devcontainer/downstream-.../devcontainer.json`` configure +containers with an installation of downstream packages providing SageMath from a +package manager, or from a public Docker image that provides SageMath. +These ``devcontainer.json`` configuration files are useful for testing +user scripts on these deployments of SageMath. You may also find it +useful to copy these configurations into your own projects (they should +work without change) or to adapt them to your needs. - `downstream-archlinux-latest/devcontainer.json `_ @@ -1254,26 +1262,25 @@ directory ``$SAGE_ROOT/.devcontainer``: `_ configures a container with `the CoCalc Docker image `_. -- `develop-docker-cocalc/devcontainer.json - `_ - configures a container with `the CoCalc Docker image `_. - It then updates the installation of SageMath in this container by building from - the current source tree. - - `downstream-docker-computop/devcontainer.json `_ configures a container with the `Docker image from the 3-manifolds project `_, providing SnapPy, Regina, PHCPack, etc. +Files named ``$SAGE_ROOT/.devcontainer/develop-.../devcontainer.json`` configure +containers from a public Docker image that provides SageMath and then updates the +installation of SageMath in this container by building from the current source tree. + +- `develop-docker-cocalc/devcontainer.json + `_ + configures a container with `the CoCalc Docker image `_. + It then updates the installation of SageMath in this container by building from + the current source tree. + - `develop-docker-computop/devcontainer.json `_ configures a container with the `Docker image from the 3-manifolds project `_, providing SnapPy, Regina, PHCPack, etc. It then updates the installation of SageMath in this container by building from the current source tree. - -These ``devcontainer.json`` configuration files are useful for testing -user scripts on these deployments of SageMath. You may also find it -useful to copy these configurations into your own projects or to adapt them to your needs. - From c8b59ec134be569bdb4453f7c408d440219489f8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 12:23:30 -0700 Subject: [PATCH 66/96] .devcontainer/downstream-conda-forge-latest/devcontainer.json: Only run Sage config when in a Sage source tree --- .../downstream-conda-forge-latest/devcontainer.json | 10 +++++++++- .../downstream-docker-cocalc/devcontainer.json | 9 +++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.devcontainer/downstream-conda-forge-latest/devcontainer.json b/.devcontainer/downstream-conda-forge-latest/devcontainer.json index a38b23f880a..cf64cfc3d25 100644 --- a/.devcontainer/downstream-conda-forge-latest/devcontainer.json +++ b/.devcontainer/downstream-conda-forge-latest/devcontainer.json @@ -5,7 +5,15 @@ // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh && mamba install --yes sage", // Run commands after the container is started. - "postStartCommand": "make configure && ln -sf $CONDA_PREFIX venv", + // * If the workspace directory looks like a copy of the Sage source tree (SAGE_ROOT): + // - it bootstraps and configures the Sage distribution, + // - thus, the script ``./sage`` and the symlinks ``prefix``, ``venv`` are set as expected, + // - the source tree is prepared for rebuilding Sage based from the source tree on + // top of the existing installation from the Docker image. + // - however, it does not start the build. + // * Otherwise, it does nothing. This is so that users can copy this devcontainer.json file as is + // into their projects. + "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ln -sf $CONDA_PREFIX venv; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/downstream-docker-cocalc/devcontainer.json b/.devcontainer/downstream-docker-cocalc/devcontainer.json index 161c562d04d..d77f5f71df5 100644 --- a/.devcontainer/downstream-docker-cocalc/devcontainer.json +++ b/.devcontainer/downstream-docker-cocalc/devcontainer.json @@ -10,12 +10,9 @@ "postCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", // Run commands after the container is started. // * If the workspace directory looks like a copy of the Sage source tree (SAGE_ROOT): - // - it bootstraps and configures the Sage distribution, - // - thus, the script ``./sage`` and the symlinks ``prefix``, ``venv`` are set as expected, - // - the source tree is prepared for rebuilding Sage based from the source tree on - // top of the existing installation from the Docker image. - // - however, do not start the build. - // * Otherwise, do nothing. This is so that users can copy this devcontainer.json file as is + // - it bootstraps the Sage distribution, + // - sets the symlink ``venv`` as expected, + // * Otherwise, it does nothing. This is so that users can copy this devcontainer.json file as is // into their projects. "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", "extensions": [ From cb64abccfbb7e19e498d932fb7b17d5e7c675371 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 12:36:44 -0700 Subject: [PATCH 67/96] .devcontainer/downstream-docker-sagemath/devcontainer.json: Do not try to bootstrap/configure/build; only set synlinks when in a Sage source tree --- .devcontainer/downstream-docker-sagemath/devcontainer.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.devcontainer/downstream-docker-sagemath/devcontainer.json b/.devcontainer/downstream-docker-sagemath/devcontainer.json index 02d5c9fa8db..fd805860d99 100644 --- a/.devcontainer/downstream-docker-sagemath/devcontainer.json +++ b/.devcontainer/downstream-docker-sagemath/devcontainer.json @@ -1,17 +1,13 @@ // See https://aka.ms/devcontainer.json for format details. { "name": "sagemath/sagemath Docker", - // sagemath/sagemath-dev as of 9.5 is broken? "image": "sagemath/sagemath:develop", - "containerEnv": { - "MAKE": "make -j12" - }, // Run commands after the container is created. // Install build tools. "postCreateCommand": ".devcontainer/post_create.sh --sudo" // Run commands after the container is started. // Do not run configure within a sage-env (see #29485). - "postStartCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/home/sage/sage/local --with-sage-venv) && make build V=0", + "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then ln -s /home/sage/sage/venv venv && ln -s /home/sage/sage/local prefix; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", "extensions": [ "ms-python.python" ] From bb9ff58f60af07a4e15e8d667428ada9793237c9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 12:44:20 -0700 Subject: [PATCH 68/96] src/doc/en/developer/portability_testing.rst: Add link to _sagemath dummy package --- src/doc/en/developer/portability_testing.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 23e1da8108b..c951136a23b 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1237,7 +1237,8 @@ directory ``$SAGE_ROOT/.devcontainer``. Files named ``$SAGE_ROOT/.devcontainer/downstream-.../devcontainer.json`` configure containers with an installation of downstream packages providing SageMath from a -package manager, or from a public Docker image that provides SageMath. +package manager (see `the _sagemath dummy package <../reference/spkg/_sagemath.html>`_), +or from a public Docker image that provides SageMath. These ``devcontainer.json`` configuration files are useful for testing user scripts on these deployments of SageMath. You may also find it useful to copy these configurations into your own projects (they should From 6592b7d635fea77e407632b2060c02577cab36be Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 12:45:20 -0700 Subject: [PATCH 69/96] .devcontainer/downstream-docker-sagemath/devcontainer.json: Fixup --- .devcontainer/downstream-docker-sagemath/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/downstream-docker-sagemath/devcontainer.json b/.devcontainer/downstream-docker-sagemath/devcontainer.json index fd805860d99..a235bab1f2f 100644 --- a/.devcontainer/downstream-docker-sagemath/devcontainer.json +++ b/.devcontainer/downstream-docker-sagemath/devcontainer.json @@ -7,7 +7,7 @@ "postCreateCommand": ".devcontainer/post_create.sh --sudo" // Run commands after the container is started. // Do not run configure within a sage-env (see #29485). - "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then ln -s /home/sage/sage/venv venv && ln -s /home/sage/sage/local prefix; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", + "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then ln -sf /home/sage/sage/venv venv && ln -sf /home/sage/sage/local prefix; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", "extensions": [ "ms-python.python" ] From c5d883c7e24f0c7eef4f49bf2adf645248fb392b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 13:11:52 -0700 Subject: [PATCH 70/96] src/doc/en/developer/portability_testing.rst: Explain the devcontainer name prefix downstream-docker-... --- src/doc/en/developer/portability_testing.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index c951136a23b..a46d4f88eed 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1237,8 +1237,10 @@ directory ``$SAGE_ROOT/.devcontainer``. Files named ``$SAGE_ROOT/.devcontainer/downstream-.../devcontainer.json`` configure containers with an installation of downstream packages providing SageMath from a -package manager (see `the _sagemath dummy package <../reference/spkg/_sagemath.html>`_), -or from a public Docker image that provides SageMath. +package manager (``downstream-archlinux-...``, ``downstream-conda-forge``; +see also `the _sagemath dummy package <../reference/spkg/_sagemath.html>`_), +or from a public Docker image that provides SageMath (``docker-sagemath``, +``docker-cocalc``, ``docker-computop``). These ``devcontainer.json`` configuration files are useful for testing user scripts on these deployments of SageMath. You may also find it useful to copy these configurations into your own projects (they should From 3016ce985bd8b51fa3cb8f1438d751a7b7895a98 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 18:32:23 -0700 Subject: [PATCH 71/96] build/bin/sage-print-system-package-command (conda): Actually include options in command --- build/bin/sage-print-system-package-command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/bin/sage-print-system-package-command b/build/bin/sage-print-system-package-command index 4ee33ab0e65..b493ebd0ffb 100755 --- a/build/bin/sage-print-system-package-command +++ b/build/bin/sage-print-system-package-command @@ -142,7 +142,7 @@ case $system:$command in ;; *conda*:install) [ "$YES" = yes ] && options="$options --yes" - [ -n "$system_packages" ] && print_shell_command "conda install $system_packages" + [ -n "$system_packages" ] && print_shell_command "conda install $options $system_packages" ;; homebrew*:install) [ -n "$system_packages" ] && print_shell_command "brew install $system_packages" From 84a5e13bd2d17cfb27ac93ab0177193d5a0917db Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 13 Aug 2022 18:32:48 -0700 Subject: [PATCH 72/96] .devcontainer/downstream-conda-forge-latest/devcontainer.json: Do not use .devcontainer/post_create.sh --- .devcontainer/downstream-conda-forge-latest/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/downstream-conda-forge-latest/devcontainer.json b/.devcontainer/downstream-conda-forge-latest/devcontainer.json index cf64cfc3d25..d6799692c0a 100644 --- a/.devcontainer/downstream-conda-forge-latest/devcontainer.json +++ b/.devcontainer/downstream-conda-forge-latest/devcontainer.json @@ -3,7 +3,7 @@ "name": "condaforge/mambaforge:latest downstream Sage", "image": "condaforge/mambaforge:latest", // Run commands after the container is created. - "postCreateCommand": ".devcontainer/post_create.sh && mamba install --yes sage", + "postCreateCommand": "mamba install --yes sage", // Run commands after the container is started. // * If the workspace directory looks like a copy of the Sage source tree (SAGE_ROOT): // - it bootstraps and configures the Sage distribution, From 945de29b5be9c7bb3da86b306e36f284bae11103 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 14 Aug 2022 18:25:08 -0700 Subject: [PATCH 73/96] .devcontainer: Reduce parallelism to 4 --- .devcontainer/develop-docker-cocalc/devcontainer.json | 2 +- .devcontainer/develop-docker-computop/devcontainer.json | 2 +- .devcontainer/downstream-docker-cocalc/devcontainer.json | 2 +- .devcontainer/downstream-docker-computop/devcontainer.json | 2 +- .../devcontainer.json | 2 +- .../portability-ubuntu-jammy-standard/devcontainer.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.devcontainer/develop-docker-cocalc/devcontainer.json b/.devcontainer/develop-docker-cocalc/devcontainer.json index 47a5a682dff..20455fcebe1 100644 --- a/.devcontainer/develop-docker-cocalc/devcontainer.json +++ b/.devcontainer/develop-docker-cocalc/devcontainer.json @@ -3,7 +3,7 @@ "name": "CoCalc Docker", "image": "sagemathinc/cocalc", "containerEnv": { - "MAKE": "make -j12" + "MAKE": "make -j4" }, // Run commands after the container is created. // libgmp.a is broken and leads to a build failure of ecm. diff --git a/.devcontainer/develop-docker-computop/devcontainer.json b/.devcontainer/develop-docker-computop/devcontainer.json index 639fc9543a4..9754febbc22 100644 --- a/.devcontainer/develop-docker-computop/devcontainer.json +++ b/.devcontainer/develop-docker-computop/devcontainer.json @@ -3,7 +3,7 @@ "name": "computop/sage Docker", "image": "computop/sage", "containerEnv": { - "MAKE": "make -j12" + "MAKE": "make -j4" }, // Run commands after the container is created. // Install build tools, get rid of sourcing /sage/activate in non-login shells. diff --git a/.devcontainer/downstream-docker-cocalc/devcontainer.json b/.devcontainer/downstream-docker-cocalc/devcontainer.json index d77f5f71df5..a7ec23682a8 100644 --- a/.devcontainer/downstream-docker-cocalc/devcontainer.json +++ b/.devcontainer/downstream-docker-cocalc/devcontainer.json @@ -3,7 +3,7 @@ "name": "CoCalc Docker", "image": "sagemathinc/cocalc", "containerEnv": { - "MAKE": "make -j12" + "MAKE": "make -j4" }, // Run commands after the container is created. // libgmp.a is broken and leads to a build failure of ecm. diff --git a/.devcontainer/downstream-docker-computop/devcontainer.json b/.devcontainer/downstream-docker-computop/devcontainer.json index 0f9ba0b8841..bcf7f2e3cfe 100644 --- a/.devcontainer/downstream-docker-computop/devcontainer.json +++ b/.devcontainer/downstream-docker-computop/devcontainer.json @@ -3,7 +3,7 @@ "name": "computop/sage Docker", "image": "computop/sage", "containerEnv": { - "MAKE": "make -j12" + "MAKE": "make -j4" }, // Run commands after the container is created. // Install build tools, get rid of sourcing /sage/activate in non-login shells. diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json index 4a97fb3cb2c..eb416d68c85 100644 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json @@ -11,7 +11,7 @@ } }, "containerEnv": { - "MAKE": "make -j12" + "MAKE": "make -j4" }, // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh", diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index 1ce79588c26..80fdc0de1b3 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -11,7 +11,7 @@ } }, "containerEnv": { - "MAKE": "make -j12" + "MAKE": "make -j4" }, // Run commands after the container is created. "postCreateCommand": ".devcontainer/post_create.sh", From b29dfa784916838ec3f21ad26db340bf5602b190 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Aug 2022 07:37:06 -0700 Subject: [PATCH 74/96] .devcontainer/downstream-docker-sagemath: Remove --- .../downstream-docker-sagemath/devcontainer.json | 14 -------------- src/doc/en/developer/portability_testing.rst | 7 +------ 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 .devcontainer/downstream-docker-sagemath/devcontainer.json diff --git a/.devcontainer/downstream-docker-sagemath/devcontainer.json b/.devcontainer/downstream-docker-sagemath/devcontainer.json deleted file mode 100644 index a235bab1f2f..00000000000 --- a/.devcontainer/downstream-docker-sagemath/devcontainer.json +++ /dev/null @@ -1,14 +0,0 @@ -// See https://aka.ms/devcontainer.json for format details. -{ - "name": "sagemath/sagemath Docker", - "image": "sagemath/sagemath:develop", - // Run commands after the container is created. - // Install build tools. - "postCreateCommand": ".devcontainer/post_create.sh --sudo" - // Run commands after the container is started. - // Do not run configure within a sage-env (see #29485). - "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then ln -sf /home/sage/sage/venv venv && ln -sf /home/sage/sage/local prefix; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", - "extensions": [ - "ms-python.python" - ] -} diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index a46d4f88eed..23eb5b1bdf9 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1239,8 +1239,7 @@ Files named ``$SAGE_ROOT/.devcontainer/downstream-.../devcontainer.json`` config containers with an installation of downstream packages providing SageMath from a package manager (``downstream-archlinux-...``, ``downstream-conda-forge``; see also `the _sagemath dummy package <../reference/spkg/_sagemath.html>`_), -or from a public Docker image that provides SageMath (``docker-sagemath``, -``docker-cocalc``, ``docker-computop``). +or from a public Docker image that provides SageMath (``docker-cocalc``, ``docker-computop``). These ``devcontainer.json`` configuration files are useful for testing user scripts on these deployments of SageMath. You may also find it useful to copy these configurations into your own projects (they should @@ -1257,10 +1256,6 @@ work without change) or to adapt them to your needs. `_ similarly configures a container with an installation of conda-forge and its SageMath package. -- `downstream-docker-sagemath/devcontainer.json - `_ - configures a container with `SageMath's official Docker image `_. - - `downstream-docker-cocalc/devcontainer.json `_ configures a container with `the CoCalc Docker image `_. From b09e6d18bd5574f39b474ef5974eb1ab196d0723 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Aug 2022 21:21:08 -0700 Subject: [PATCH 75/96] .devcontainer/downstream-archlinux-latest/devcontainer.json: Remove a 'prefix' symlink if present --- .devcontainer/downstream-archlinux-latest/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index 8f0b1480700..3ce2e0fc60b 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -5,7 +5,8 @@ // Run commands after the container is created. "postCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh", // Run commands after the container is started. - "postStartCommand": "make configure && ln -sf /usr venv", + // There's no SAGE_LOCAL, so remove the symlink 'prefix'. + "postStartCommand": "make configure && rm -f prefix && ln -sf /usr venv", "extensions": [ "ms-python.python" ] From f99f09fe674666dfff47fd47326c2d216eec2047 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Aug 2022 21:45:46 -0700 Subject: [PATCH 76/96] .devcontainer/downstream-archlinux-latest/devcontainer.json: No need to bootstrap --- .devcontainer/downstream-archlinux-latest/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index 3ce2e0fc60b..be5613ffb40 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -6,7 +6,7 @@ "postCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh", // Run commands after the container is started. // There's no SAGE_LOCAL, so remove the symlink 'prefix'. - "postStartCommand": "make configure && rm -f prefix && ln -sf /usr venv", + "postStartCommand": "rm -f prefix && ln -sf /usr venv", "extensions": [ "ms-python.python" ] From b72ff17c346b2f64849a45400a226b74dc2f10f8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Aug 2022 22:00:48 -0700 Subject: [PATCH 77/96] Refinements for downstream-archlinux-latest --- .devcontainer/downstream-archlinux-latest/devcontainer.json | 3 ++- src/doc/en/developer/portability_testing.rst | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index be5613ffb40..93966269922 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -3,7 +3,8 @@ "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", // Run commands after the container is created. - "postCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh", + // Create an empty bashrc to avoid the error "No such file or directory" when opening a terminal. + "postCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh && touch ~/.bashrc", // Run commands after the container is started. // There's no SAGE_LOCAL, so remove the symlink 'prefix'. "postStartCommand": "rm -f prefix && ln -sf /usr venv", diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 23eb5b1bdf9..bc7662d6b06 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1252,6 +1252,12 @@ work without change) or to adapt them to your needs. hence the prefix ``downstream-...``; the suffix ``latest`` indicates the most recent version of Arch Linux as available on Docker Hub.) + When the message "Done. Press any key to close the terminal." appears in the terminal + named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new + terminal in VS Code `_, type ``sage`` + and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is + not configured.) + - `downstream-conda-forge-latest/devcontainer.json `_ similarly configures a container with an installation of conda-forge and its SageMath package. From 9215621a6fa51b9cb914fc91fb25ac6c82ccdbef Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Aug 2022 22:20:03 -0700 Subject: [PATCH 78/96] Copy instructions for downstream-conda-latest --- src/doc/en/developer/portability_testing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index bc7662d6b06..ffbbd969462 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1262,6 +1262,12 @@ work without change) or to adapt them to your needs. `_ similarly configures a container with an installation of conda-forge and its SageMath package. + When the message "Done. Press any key to close the terminal." appears in the terminal + named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new + terminal in VS Code `_, type ``sage`` + and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is + not configured.) + - `downstream-docker-cocalc/devcontainer.json `_ configures a container with `the CoCalc Docker image `_. From de05f69712024a42b171e76ba378761ba8c0d998 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Aug 2022 22:50:22 -0700 Subject: [PATCH 79/96] Copy instructions for downstream-* --- src/doc/en/developer/portability_testing.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index ffbbd969462..69d0895e52c 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1272,12 +1272,24 @@ work without change) or to adapt them to your needs. `_ configures a container with `the CoCalc Docker image `_. + When the message "Done. Press any key to close the terminal." appears in the terminal + named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new + terminal in VS Code `_, type ``sage`` + and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is + not configured.) + - `downstream-docker-computop/devcontainer.json `_ configures a container with the `Docker image from the 3-manifolds project `_, providing SnapPy, Regina, PHCPack, etc. + When the message "Done. Press any key to close the terminal." appears in the terminal + named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new + terminal in VS Code `_, type ``sage`` + and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is + not configured.) + Files named ``$SAGE_ROOT/.devcontainer/develop-.../devcontainer.json`` configure containers from a public Docker image that provides SageMath and then updates the installation of SageMath in this container by building from the current source tree. From 43abc572dca5342919c34406b3691d4cb67fe929 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 16 Aug 2022 22:52:30 -0700 Subject: [PATCH 80/96] .devcontainer/develop-docker-cocalc, portability-centos-7-devtoolset-gcc_11-standard: Remove --- .../develop-docker-cocalc/devcontainer.json | 16 ------------- .../devcontainer.json | 23 ------------------- src/doc/en/developer/portability_testing.rst | 6 ----- 3 files changed, 45 deletions(-) delete mode 100644 .devcontainer/develop-docker-cocalc/devcontainer.json delete mode 100644 .devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json diff --git a/.devcontainer/develop-docker-cocalc/devcontainer.json b/.devcontainer/develop-docker-cocalc/devcontainer.json deleted file mode 100644 index 20455fcebe1..00000000000 --- a/.devcontainer/develop-docker-cocalc/devcontainer.json +++ /dev/null @@ -1,16 +0,0 @@ -// See https://aka.ms/devcontainer.json for format details. -{ - "name": "CoCalc Docker", - "image": "sagemathinc/cocalc", - "containerEnv": { - "MAKE": "make -j4" - }, - // Run commands after the container is created. - // libgmp.a is broken and leads to a build failure of ecm. - "postCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", - // Run commands after the container is started. - "postStartCommand": "make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv && make build V=0", - "extensions": [ - "ms-python.python" - ] -} diff --git a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json b/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json deleted file mode 100644 index eb416d68c85..00000000000 --- a/.devcontainer/portability-centos-7-devtoolset-gcc_11-standard/devcontainer.json +++ /dev/null @@ -1,23 +0,0 @@ -// See https://aka.ms/devcontainer.json for format details. -{ - "name": "Centos 7", - "build": { - "dockerfile": "portability-Dockerfile", - // See tox.ini for definitions. - "args": { "SYSTEM_FACTOR": "centos-7-devtoolset-gcc_11", - "PACKAGE_FACTOR": "standard", - "DOCKER_TARGET": "with-targets", - "DOCKER_TAG": "dev" - } - }, - "containerEnv": { - "MAKE": "make -j4" - }, - // Run commands after the container is created. - "postCreateCommand": ".devcontainer/post_create.sh", - // Run commands after the container is started. - "postStartCommand": ". /opt/rh/devtoolset-11/enable && .devcontainer/portability-post_start.sh", - "extensions": [ - "ms-python.python" - ] -} diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 69d0895e52c..e296a168e72 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1294,12 +1294,6 @@ Files named ``$SAGE_ROOT/.devcontainer/develop-.../devcontainer.json`` configure containers from a public Docker image that provides SageMath and then updates the installation of SageMath in this container by building from the current source tree. -- `develop-docker-cocalc/devcontainer.json - `_ - configures a container with `the CoCalc Docker image `_. - It then updates the installation of SageMath in this container by building from - the current source tree. - - `develop-docker-computop/devcontainer.json `_ configures a container with the `Docker image from the 3-manifolds From bad3c162dbffb22c7367d9ebf585b340d4fe9485 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 17 Aug 2022 10:19:55 -0700 Subject: [PATCH 81/96] .devcontainer/post_create.sh: Install bootstrapping prerequisites --- .devcontainer/post_create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index 0e443230898..5067e93e4f7 100755 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -3,7 +3,7 @@ export PATH=$(pwd)/build/bin:$PATH SYSTEM=$(sage-guess-package-system) eval $(sage-print-system-package-command $SYSTEM "$@" update) -eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _prereq python3 git $EXTRA_SAGE_PACKAGES) +eval $(sage-print-system-package-command $SYSTEM --yes "$@" --spkg install _bootstrap _prereq python3 git $EXTRA_SAGE_PACKAGES) if [ -n "$EXTRA_SYSTEM_PACKAGES" ]; then eval $(sage-print-system-package-command $SYSTEM --yes "$@" install $EXTRA_SYSTEM_PACKAGES) fi From ab79e40b1b93f50fa091403103336dc5c981675f Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 18 Aug 2022 11:07:00 +0900 Subject: [PATCH 82/96] Edit duplicates --- src/doc/en/developer/portability_testing.rst | 75 +++++++++----------- 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index e296a168e72..da89fad56f9 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1206,10 +1206,13 @@ you can see what it does: reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) from the prebuilt image. -After VS Code finished configuring the dev container, your local Sage -repository at ``$SAGE_ROOT`` is available in the container at the directory -``/workspaces/``. You may need to open a new Terminal to start -working from the directory. +After VS Code finished configuring the dev container (when the message "Done. +Press any key to close the terminal." appears in the terminal named +"Configuring"), your local Sage repository at ``$SAGE_ROOT`` is available in +the container at the directory ``/workspaces/``. To use Sage +in a terminal, `open a new terminal in VS Code +`_, type ``./sage`` and hit +:kbd:`Enter`. .. NOTE:: @@ -1235,6 +1238,22 @@ In addition to the provides several other sample ``devcontainer.json`` configuration files in the directory ``$SAGE_ROOT/.devcontainer``. +Files named ``$SAGE_ROOT/.devcontainer/develop-.../devcontainer.json`` configure +containers from a public Docker image that provides SageMath and then updates the +installation of SageMath in this container by building from the current source tree. + +- `develop-docker-computop/devcontainer.json + `_ + configures a container with the `Docker image from the 3-manifolds + project `_, providing + SnapPy, Regina, PHCPack, etc. + +If you want to use one of these ``devcontainer.json`` files, copy (or symlink) +it and start VS Code as explained above. After VS Code finished configuring the +dev container, to use Sage in a terminal, `open a new terminal in VS Code +`_, type ``./sage`` and hit +:kbd:`Enter`. + Files named ``$SAGE_ROOT/.devcontainer/downstream-.../devcontainer.json`` configure containers with an installation of downstream packages providing SageMath from a package manager (``downstream-archlinux-...``, ``downstream-conda-forge``; @@ -1247,56 +1266,28 @@ work without change) or to adapt them to your needs. - `downstream-archlinux-latest/devcontainer.json `_ - configures a container with an installation of `Arch Linux `_ - and its SageMath package. (Arch Linux packaging is downstream from the Sage project, - hence the prefix ``downstream-...``; the suffix ``latest`` indicates - the most recent version of Arch Linux as available on Docker Hub.) - - When the message "Done. Press any key to close the terminal." appears in the terminal - named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new - terminal in VS Code `_, type ``sage`` - and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is - not configured.) + configures a container with an installation of `Arch Linux + `_ and its SageMath package. (The suffix ``latest`` + indicates the most recent version of Arch Linux as available on Docker Hub.) - `downstream-conda-forge-latest/devcontainer.json `_ - similarly configures a container with an installation of conda-forge and its SageMath package. - - When the message "Done. Press any key to close the terminal." appears in the terminal - named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new - terminal in VS Code `_, type ``sage`` - and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is - not configured.) + configures a container with an installation of conda-forge and its SageMath package. - `downstream-docker-cocalc/devcontainer.json `_ configures a container with `the CoCalc Docker image `_. - When the message "Done. Press any key to close the terminal." appears in the terminal - named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new - terminal in VS Code `_, type ``sage`` - and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is - not configured.) - - `downstream-docker-computop/devcontainer.json `_ configures a container with the `Docker image from the 3-manifolds project `_, providing SnapPy, Regina, PHCPack, etc. - When the message "Done. Press any key to close the terminal." appears in the terminal - named "Configuring", Sage is ready for use. To use Sage in a terminal, `open a new - terminal in VS Code `_, type ``sage`` - and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is - not configured.) +If you want to use one of these ``devcontainer.json`` files, copy (or symlink) +it and start VS Code as explained above. After VS Code finished configuring the +dev container, to use Sage in a terminal, `open a new terminal in VS Code +`_, type ``sage`` and hit +:kbd:`Enter`. (Do not use ``./sage``; this will not work because the source +tree is not configured.) -Files named ``$SAGE_ROOT/.devcontainer/develop-.../devcontainer.json`` configure -containers from a public Docker image that provides SageMath and then updates the -installation of SageMath in this container by building from the current source tree. - -- `develop-docker-computop/devcontainer.json - `_ - configures a container with the `Docker image from the 3-manifolds - project `_, providing - SnapPy, Regina, PHCPack, etc. It then updates the installation of - SageMath in this container by building from the current source tree. From 5ca1db842c5b5038dd20a214cfb41f9c3a3c60c9 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 18 Aug 2022 12:09:46 +0900 Subject: [PATCH 83/96] Note for reusing a dev container --- src/doc/en/developer/portability_testing.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index da89fad56f9..e96aa0b9d1e 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1214,6 +1214,13 @@ in a terminal, `open a new terminal in VS Code `_, type ``./sage`` and hit :kbd:`Enter`. +.. NOTE:: + + If you restart VS Code after configuring a dev container, VS Code starts + again configuring a new dev container. If you want to reuse the previous dev + container, you need to enter "Remote-Containers: Attach to Running + Container" in the command palette of VS Code and choose the dev container. + .. NOTE:: Your Sage at ``$SAGE_ROOT`` was configured and rebuilt inside the dev From f48d9111f944483334aecbf98f42c4e41e457d75 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 18 Aug 2022 12:49:13 +0900 Subject: [PATCH 84/96] Correct the new note --- src/doc/en/developer/portability_testing.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index e96aa0b9d1e..91ca5a460d4 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1216,9 +1216,8 @@ in a terminal, `open a new terminal in VS Code .. NOTE:: - If you restart VS Code after configuring a dev container, VS Code starts - again configuring a new dev container. If you want to reuse the previous dev - container, you need to enter "Remote-Containers: Attach to Running + If you want VS Code to use a previously configured dev container, first run + the dev container in Docker and enter "Remote-Containers: Attach to Running Container" in the command palette of VS Code and choose the dev container. .. NOTE:: From 79c3bcb261834938f8c0fff1f404ae7aecbc4ee7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 19 Aug 2022 21:41:27 -0700 Subject: [PATCH 85/96] .devcontainer/downstream-docker-cocalc/devcontainer.json: Use onCreateCommand, updateContentCommand --- .devcontainer/downstream-docker-cocalc/devcontainer.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.devcontainer/downstream-docker-cocalc/devcontainer.json b/.devcontainer/downstream-docker-cocalc/devcontainer.json index a7ec23682a8..fc37d271530 100644 --- a/.devcontainer/downstream-docker-cocalc/devcontainer.json +++ b/.devcontainer/downstream-docker-cocalc/devcontainer.json @@ -5,16 +5,14 @@ "containerEnv": { "MAKE": "make -j4" }, - // Run commands after the container is created. // libgmp.a is broken and leads to a build failure of ecm. - "postCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", - // Run commands after the container is started. + "onCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", // * If the workspace directory looks like a copy of the Sage source tree (SAGE_ROOT): // - it bootstraps the Sage distribution, // - sets the symlink ``venv`` as expected, // * Otherwise, it does nothing. This is so that users can copy this devcontainer.json file as is // into their projects. - "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", + "updateContentCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ./configure --enable-build-as-root --prefix=/usr/local/sage/local --with-sage-venv; else echo 'Edit .devcontainer/devcontainer.json (updateContentCommand) to run project-specific startup commands'; fi", "extensions": [ "ms-python.python" ] From fbfab5e4d5bc6c0c90d30f527c159ecb638c8782 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 19 Aug 2022 23:22:51 -0700 Subject: [PATCH 86/96] .devcontainer/downstream-docker-computop/devcontainer.json: Use onCreateCommand, updateContentCommand --- .devcontainer/downstream-docker-computop/devcontainer.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.devcontainer/downstream-docker-computop/devcontainer.json b/.devcontainer/downstream-docker-computop/devcontainer.json index bcf7f2e3cfe..923a18fdf89 100644 --- a/.devcontainer/downstream-docker-computop/devcontainer.json +++ b/.devcontainer/downstream-docker-computop/devcontainer.json @@ -5,16 +5,13 @@ "containerEnv": { "MAKE": "make -j4" }, - // Run commands after the container is created. // Install build tools, get rid of sourcing /sage/activate in non-login shells. // libgmp.a is broken and leads to a build failure of ecm. - "postCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", - // Run commands after the container is started. + "onCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Do not run configure within a sage-env (see #29485). // The pari package is broken in the computop/sage 9.5 image, need to reinstall. // Also libnauty is broken. - - "postStartCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv)", + "updateContentCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv)", "extensions": [ "ms-python.python" ] From 09289e5418e448bc0421a8bf4208930cd7a4dad5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 20 Aug 2022 00:21:14 -0700 Subject: [PATCH 87/96] .devcontainer/downstream-archlinux-latest/devcontainer.json: Use onCreateCommand, updateContentCommand --- .devcontainer/downstream-archlinux-latest/devcontainer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index 93966269922..c1682662873 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -2,12 +2,11 @@ { "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", - // Run commands after the container is created. // Create an empty bashrc to avoid the error "No such file or directory" when opening a terminal. - "postCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh && touch ~/.bashrc", + "onCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh && touch ~/.bashrc", // Run commands after the container is started. // There's no SAGE_LOCAL, so remove the symlink 'prefix'. - "postStartCommand": "rm -f prefix && ln -sf /usr venv", + "updateContentCommand": "rm -f prefix && ln -sf /usr venv", "extensions": [ "ms-python.python" ] From 968ec531a406c0fe1b938c8e37a10097505ac8df Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 20 Aug 2022 00:47:21 -0700 Subject: [PATCH 88/96] .devcontainer/downstream-conda-forge-latest/devcontainer.json: Use onCreateCommand, updateContentCommand --- .../downstream-conda-forge-latest/devcontainer.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.devcontainer/downstream-conda-forge-latest/devcontainer.json b/.devcontainer/downstream-conda-forge-latest/devcontainer.json index d6799692c0a..fe9f18eef8b 100644 --- a/.devcontainer/downstream-conda-forge-latest/devcontainer.json +++ b/.devcontainer/downstream-conda-forge-latest/devcontainer.json @@ -2,9 +2,8 @@ { "name": "condaforge/mambaforge:latest downstream Sage", "image": "condaforge/mambaforge:latest", - // Run commands after the container is created. - "postCreateCommand": "mamba install --yes sage", - // Run commands after the container is started. + // Install Sage from the conda-forge package. + "onCreateCommand": "mamba install --yes sage", // * If the workspace directory looks like a copy of the Sage source tree (SAGE_ROOT): // - it bootstraps and configures the Sage distribution, // - thus, the script ``./sage`` and the symlinks ``prefix``, ``venv`` are set as expected, @@ -13,7 +12,7 @@ // - however, it does not start the build. // * Otherwise, it does nothing. This is so that users can copy this devcontainer.json file as is // into their projects. - "postStartCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ln -sf $CONDA_PREFIX venv; else echo 'Edit .devcontainer/devcontainer.json (postStartCommand) to run project-specific startup commands'; fi", + "updateContentCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ln -sf $CONDA_PREFIX venv; else echo 'Edit .devcontainer/devcontainer.json (updateContentCommand) to run project-specific startup commands'; fi", "extensions": [ "ms-python.python" ] From 1ab9559726239ed4196d26fa0d836ce6fda0799f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 20 Aug 2022 01:02:27 -0700 Subject: [PATCH 89/96] .devcontainer/*/devcontainer.json: Use onCreateCommand, updateContentCommand --- .devcontainer/develop-docker-computop/devcontainer.json | 6 ++---- .devcontainer/downstream-archlinux-latest/devcontainer.json | 1 - .../portability-ubuntu-jammy-standard/devcontainer.json | 6 ++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.devcontainer/develop-docker-computop/devcontainer.json b/.devcontainer/develop-docker-computop/devcontainer.json index 9754febbc22..71424e8843e 100644 --- a/.devcontainer/develop-docker-computop/devcontainer.json +++ b/.devcontainer/develop-docker-computop/devcontainer.json @@ -5,16 +5,14 @@ "containerEnv": { "MAKE": "make -j4" }, - // Run commands after the container is created. // Install build tools, get rid of sourcing /sage/activate in non-login shells. // libgmp.a is broken and leads to a build failure of ecm. - "postCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", - // Run commands after the container is started. + "onCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Do not run configure within a sage-env (see #29485). // The pari package is broken in the computop/sage 9.5 image, need to reinstall. // Also libnauty is broken. - "postStartCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv) && make pari-clean nauty-clean build V=0", + "updateContentCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv) && make pari-clean nauty-clean build V=0", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index c1682662873..5fff1dc7cdc 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -4,7 +4,6 @@ "image": "archlinux:latest", // Create an empty bashrc to avoid the error "No such file or directory" when opening a terminal. "onCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh && touch ~/.bashrc", - // Run commands after the container is started. // There's no SAGE_LOCAL, so remove the symlink 'prefix'. "updateContentCommand": "rm -f prefix && ln -sf /usr venv", "extensions": [ diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index 80fdc0de1b3..358cdf2055a 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -13,10 +13,8 @@ "containerEnv": { "MAKE": "make -j4" }, - // Run commands after the container is created. - "postCreateCommand": ".devcontainer/post_create.sh", - // Run commands after the container is started. - "postStartCommand": ".devcontainer/portability-post_start.sh", + "onCreateCommand": ".devcontainer/post_create.sh", + "updateContentCommand": ".devcontainer/portability-post_start.sh", "extensions": [ "ms-python.python" ] From 3ba737b841647ee112b2f01b5c54e3024baa8c65 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Sat, 20 Aug 2022 18:30:28 +0900 Subject: [PATCH 90/96] Minor edits --- .../develop-docker-computop/devcontainer.json | 1 - .../devcontainer.json | 37 ++++++++++--------- .vscode/settings.json | 8 ++-- src/doc/en/developer/portability_testing.rst | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.devcontainer/develop-docker-computop/devcontainer.json b/.devcontainer/develop-docker-computop/devcontainer.json index 71424e8843e..3dd68a6e0e8 100644 --- a/.devcontainer/develop-docker-computop/devcontainer.json +++ b/.devcontainer/develop-docker-computop/devcontainer.json @@ -11,7 +11,6 @@ // Do not run configure within a sage-env (see #29485). // The pari package is broken in the computop/sage 9.5 image, need to reinstall. // Also libnauty is broken. - "updateContentCommand": "make configure && (export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && unset CFLAGS LDFLAGS CXXFLAGS CPATH LIBRARY_PATH && ./configure --prefix=/sage/local --with-sage-venv) && make pari-clean nauty-clean build V=0", "extensions": [ "ms-python.python" diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index 358cdf2055a..0c4015a8add 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -1,21 +1,22 @@ // See https://aka.ms/devcontainer.json for format details. { - "name": "Ubuntu jammy", - "build": { - "dockerfile": "portability-Dockerfile", - // See tox.ini for definitions - "args": { "SYSTEM_FACTOR": "ubuntu-jammy", - "PACKAGE_FACTOR": "standard", - "DOCKER_TARGET": "with-targets", - "DOCKER_TAG": "dev" - } - }, - "containerEnv": { - "MAKE": "make -j4" - }, - "onCreateCommand": ".devcontainer/post_create.sh", - "updateContentCommand": ".devcontainer/portability-post_start.sh", - "extensions": [ - "ms-python.python" - ] + "name": "Ubuntu jammy", + "build": { + "dockerfile": "portability-Dockerfile", + // See tox.ini for definitions + "args": { + "SYSTEM_FACTOR": "ubuntu-jammy", + "PACKAGE_FACTOR": "standard", + "DOCKER_TARGET": "with-targets", + "DOCKER_TAG": "dev" + } + }, + "containerEnv": { + "MAKE": "make -j4" + }, + "onCreateCommand": ".devcontainer/post_create.sh", + "updateContentCommand": ".devcontainer/portability-post_start.sh", + "extensions": [ + "ms-python.python" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index af2b4536957..234021fa1f2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ "files.exclude": { "**/__pycache__": true, "src/**/*.cpp": true, - "src/**/*.so": true, + "src/**/*.so": true }, "search.exclude": { "build/pkgs/sagemath_categories/src": true, @@ -12,13 +12,13 @@ "pkgs/sage-conf_pypi/sage_root/build": true, "pkgs/sagemath-categories/sage": true, "pkgs/sagemath-objects/sage": true, - "pkgs/sagemath-standard/sage": true, + "pkgs/sagemath-standard/sage": true }, "python.testing.pytestEnabled": true, "python.testing.pytestArgs": [ "--rootdir=src/sage", "-c=src/tox.ini", - "--doctest-modules", + "--doctest-modules" ], "python.testing.unittestEnabled": false, "python.linting.pycodestyleEnabled": true, @@ -28,5 +28,5 @@ "Conda", "sagemath", "Cython" - ], + ] } diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 91ca5a460d4..57ad0d57dcc 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1227,7 +1227,7 @@ in a terminal, `open a new terminal in VS Code (possibly) ``$SAGE_ROOT/logs`` will be symbolic links that work inside the dev container, but not in your local file system; and also the script ``$SAGE_ROOT/sage`` will not work. Hence after working with the dev container, - you will want to remove ``logs`` if it is a symbolic link, and to re-run the + you will want to remove ``logs`` if it is a symbolic link, and rerun the ``configure`` script. You can edit a copy of the configuration file to change to a different platform, another From 30f345364611205d3c8c6b9347a6f569e553d8ea Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Sun, 21 Aug 2022 01:15:09 +0900 Subject: [PATCH 91/96] Small edits --- src/doc/en/developer/portability_testing.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 57ad0d57dcc..f44a1d7cb7c 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1190,7 +1190,7 @@ application, then in the command palette of VS Code, enter "Remote-Containers: Open Folder in Container", and hit :kbd:`Enter`, and choose the directory ``$SAGE_ROOT`` of your local Sage repository. -Once VS Code starts running the dev container, by clicking on "show log", +Once VS Code starts configuring the dev container, by clicking on "show log", you can see what it does: - It pulls the prebuilt image from ghcr.io (via @@ -1216,9 +1216,10 @@ in a terminal, `open a new terminal in VS Code .. NOTE:: - If you want VS Code to use a previously configured dev container, first run - the dev container in Docker and enter "Remote-Containers: Attach to Running - Container" in the command palette of VS Code and choose the dev container. + If you want VS Code to use a previously configured dev container, first + start the dev container in Docker and enter "Remote-Containers: Attach to + Running Container" in the command palette of VS Code and choose the dev + container. .. NOTE:: From f1f38b144836995613caae929a7eaebd2f83ea4d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 20 Aug 2022 14:57:39 -0700 Subject: [PATCH 92/96] .devcontainer/portability-ubuntu-jammy-standard: Add symlink to portability-Dockerfile --- .../portability-ubuntu-jammy-standard/portability-Dockerfile | 1 + 1 file changed, 1 insertion(+) create mode 120000 .devcontainer/portability-ubuntu-jammy-standard/portability-Dockerfile diff --git a/.devcontainer/portability-ubuntu-jammy-standard/portability-Dockerfile b/.devcontainer/portability-ubuntu-jammy-standard/portability-Dockerfile new file mode 120000 index 00000000000..692e2a79d64 --- /dev/null +++ b/.devcontainer/portability-ubuntu-jammy-standard/portability-Dockerfile @@ -0,0 +1 @@ +../portability-Dockerfile \ No newline at end of file From 37eb95dcb3e68c19092c38cb49c9a75c5da35154 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Sun, 21 Aug 2022 07:18:27 +0900 Subject: [PATCH 93/96] Remove the note for starting configured dev container --- src/doc/en/developer/portability_testing.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index f44a1d7cb7c..41fb93e5a6d 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1214,13 +1214,6 @@ in a terminal, `open a new terminal in VS Code `_, type ``./sage`` and hit :kbd:`Enter`. -.. NOTE:: - - If you want VS Code to use a previously configured dev container, first - start the dev container in Docker and enter "Remote-Containers: Attach to - Running Container" in the command palette of VS Code and choose the dev - container. - .. NOTE:: Your Sage at ``$SAGE_ROOT`` was configured and rebuilt inside the dev From d5610b15885f79d8554c1d307759e8431c11bd1c Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 22 Aug 2022 09:38:15 +0900 Subject: [PATCH 94/96] Edit: prefer symlink --- src/doc/en/developer/portability_testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 41fb93e5a6d..205baa67c1d 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1248,7 +1248,7 @@ installation of SageMath in this container by building from the current source t project `_, providing SnapPy, Regina, PHCPack, etc. -If you want to use one of these ``devcontainer.json`` files, copy (or symlink) +If you want to use one of these ``devcontainer.json`` files, symlink (or copy) it and start VS Code as explained above. After VS Code finished configuring the dev container, to use Sage in a terminal, `open a new terminal in VS Code `_, type ``./sage`` and hit @@ -1284,7 +1284,7 @@ work without change) or to adapt them to your needs. project `_, providing SnapPy, Regina, PHCPack, etc. -If you want to use one of these ``devcontainer.json`` files, copy (or symlink) +If you want to use one of these ``devcontainer.json`` files, symlink (or copy) it and start VS Code as explained above. After VS Code finished configuring the dev container, to use Sage in a terminal, `open a new terminal in VS Code `_, type ``sage`` and hit From 179406f61466f123f95ab578dd179ed37ec6b456 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 22 Aug 2022 08:38:29 -0700 Subject: [PATCH 95/96] src/doc/en/developer/portability_testing.rst: Update references to devcontainer ...Command --- src/doc/en/developer/portability_testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 205baa67c1d..54facbfd1ce 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1198,10 +1198,10 @@ you can see what it does: `_); note that these are multi-gigabyte images, so it may take a while. -- As part of the "postCreateCommand", it installs additional system packages to +- As part of the "onCreateCommand", it installs additional system packages to support VS Code and for development. -- Then, as part of the "postStartCommand", it bootstraps and +- Then, as part of the "updateContentCommand", it bootstraps and configures the source tree and starts to build Sage from source, reusing the installation (:envvar:`SAGE_LOCAL`, :envvar:`SAGE_VENV`) from the prebuilt image. From 4affef24a703a5c9f2cd7dfc008637b57e04dade Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 22 Aug 2022 09:08:04 -0700 Subject: [PATCH 96/96] .devcontainer/onCreate.sh, portability-updateContent.sh: Rename from post_create.sh, portability-post_start.sh --- .devcontainer/develop-docker-computop/devcontainer.json | 2 +- .devcontainer/downstream-archlinux-latest/devcontainer.json | 2 +- .devcontainer/downstream-docker-cocalc/devcontainer.json | 2 +- .devcontainer/downstream-docker-computop/devcontainer.json | 2 +- .devcontainer/{post_create.sh => onCreate.sh} | 0 .../portability-ubuntu-jammy-standard/devcontainer.json | 4 ++-- ...portability-post_start.sh => portability-updateContent.sh} | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename .devcontainer/{post_create.sh => onCreate.sh} (100%) rename .devcontainer/{portability-post_start.sh => portability-updateContent.sh} (100%) diff --git a/.devcontainer/develop-docker-computop/devcontainer.json b/.devcontainer/develop-docker-computop/devcontainer.json index 3dd68a6e0e8..a8746244086 100644 --- a/.devcontainer/develop-docker-computop/devcontainer.json +++ b/.devcontainer/develop-docker-computop/devcontainer.json @@ -7,7 +7,7 @@ }, // Install build tools, get rid of sourcing /sage/activate in non-login shells. // libgmp.a is broken and leads to a build failure of ecm. - "onCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", + "onCreateCommand": ".devcontainer/onCreate.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Do not run configure within a sage-env (see #29485). // The pari package is broken in the computop/sage 9.5 image, need to reinstall. // Also libnauty is broken. diff --git a/.devcontainer/downstream-archlinux-latest/devcontainer.json b/.devcontainer/downstream-archlinux-latest/devcontainer.json index 5fff1dc7cdc..f0b79e01ae3 100644 --- a/.devcontainer/downstream-archlinux-latest/devcontainer.json +++ b/.devcontainer/downstream-archlinux-latest/devcontainer.json @@ -3,7 +3,7 @@ "name": "archlinux:latest downstream Sage", "image": "archlinux:latest", // Create an empty bashrc to avoid the error "No such file or directory" when opening a terminal. - "onCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/post_create.sh && touch ~/.bashrc", + "onCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/onCreate.sh && touch ~/.bashrc", // There's no SAGE_LOCAL, so remove the symlink 'prefix'. "updateContentCommand": "rm -f prefix && ln -sf /usr venv", "extensions": [ diff --git a/.devcontainer/downstream-docker-cocalc/devcontainer.json b/.devcontainer/downstream-docker-cocalc/devcontainer.json index fc37d271530..626bdbb9996 100644 --- a/.devcontainer/downstream-docker-cocalc/devcontainer.json +++ b/.devcontainer/downstream-docker-cocalc/devcontainer.json @@ -6,7 +6,7 @@ "MAKE": "make -j4" }, // libgmp.a is broken and leads to a build failure of ecm. - "onCreateCommand": ".devcontainer/post_create.sh && rm -f /usr/local/sage/local/lib/libgmp.a", + "onCreateCommand": ".devcontainer/onCreate.sh && rm -f /usr/local/sage/local/lib/libgmp.a", // * If the workspace directory looks like a copy of the Sage source tree (SAGE_ROOT): // - it bootstraps the Sage distribution, // - sets the symlink ``venv`` as expected, diff --git a/.devcontainer/downstream-docker-computop/devcontainer.json b/.devcontainer/downstream-docker-computop/devcontainer.json index 923a18fdf89..bb2e29e374e 100644 --- a/.devcontainer/downstream-docker-computop/devcontainer.json +++ b/.devcontainer/downstream-docker-computop/devcontainer.json @@ -7,7 +7,7 @@ }, // Install build tools, get rid of sourcing /sage/activate in non-login shells. // libgmp.a is broken and leads to a build failure of ecm. - "onCreateCommand": ".devcontainer/post_create.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", + "onCreateCommand": ".devcontainer/onCreate.sh --sudo && sudo rm -f /sage/local/lib/libgmp.a && sed -i.bak '/sage.*activate/d' ~/.bashrc", // Do not run configure within a sage-env (see #29485). // The pari package is broken in the computop/sage 9.5 image, need to reinstall. // Also libnauty is broken. diff --git a/.devcontainer/post_create.sh b/.devcontainer/onCreate.sh similarity index 100% rename from .devcontainer/post_create.sh rename to .devcontainer/onCreate.sh diff --git a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json index 0c4015a8add..f59a1178179 100644 --- a/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +++ b/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json @@ -14,8 +14,8 @@ "containerEnv": { "MAKE": "make -j4" }, - "onCreateCommand": ".devcontainer/post_create.sh", - "updateContentCommand": ".devcontainer/portability-post_start.sh", + "onCreateCommand": ".devcontainer/onCreate.sh", + "updateContentCommand": ".devcontainer/portability-updateContent.sh", "extensions": [ "ms-python.python" ] diff --git a/.devcontainer/portability-post_start.sh b/.devcontainer/portability-updateContent.sh similarity index 100% rename from .devcontainer/portability-post_start.sh rename to .devcontainer/portability-updateContent.sh