Skip to content

Conversation

dimpase
Copy link
Member

@dimpase dimpase commented Aug 28, 2025

This is a follow-up to #40460

Docker images need to get _prereqs installed, as noticed in #40460 (comment)

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@tobiasdiez
Copy link
Contributor

Codewise looks good to me.

If you have the time, could you please apply the following patch, then those changes are automatically tested on github:

--- a/.github/workflows/push_to_docker_hub.yml
+++ b/.github/workflows/push_to_docker_hub.yml
@@ -1,10 +1,12 @@
 name: Build Docker images and push to DockerHub
 
 on:
+  pull_request:
+    paths:
+      - '.github/workflows/push_to_docker_hub.yml'
+      - 'docker/Dockerfile'
   workflow_dispatch:
     # Allow to run manually
-    branches:
-      - 'develop'
   push:
     tags:
       # Match all release tags including beta, rc

@dimpase
Copy link
Member Author

dimpase commented Aug 28, 2025

@tobiasdiez - you can just push to the PR branch in my repo

@soehms
Copy link
Member

soehms commented Aug 28, 2025

I already started a run in my Repo: https://github.com/soehms/sage/actions/runs/17286731555. It gave:

#29 50.05 error: Sage source tree is unconfigured. Please run "./configure" first.
#29 50.05 note:  Type "./configure --help" to see the available configuration options.

Copy link

github-actions bot commented Aug 28, 2025

Documentation preview for this PR (built with commit f752004; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@soehms
Copy link
Member

soehms commented Aug 29, 2025

In the current log-file I see the same error-message that I've obeserved in this sage-devel thread. This has been fixed for a while and now shows up again.

BTW: This can also be seen in the log-file posted in #40708 (comment).

apparently we need to clean the line break
$ ./build/bin/sage-get-system-packages debian _bootstrap _prereq
autoconf automake libtool
binutils make m4 perl flex python3 tar bc gcc libbz2-dev bzip2 g++ ca-certificates patch pkg-config libz-dev
@dimpase
Copy link
Member Author

dimpase commented Aug 29, 2025

In the current log-file I see the same error-message that I've obeserved in this sage-devel thread. This has been fixed for a while and now shows up again.

BTW: This can also be seen in the log-file posted in #40708 (comment).

sorry, it must be shell silliness (I don't have docker on a real machine to try out, so I need to see what CI says, just as in my undergrad years with punchcards jobs submitted to (a Soviet ripoff of) IBM-370 😄 )
Maybe I should try with podman.

@dimpase
Copy link
Member Author

dimpase commented Aug 29, 2025

in the podman output, running podman build -f docker/Dockerfile --target sagemath-dev . I see

...
Setting up gfortran-11 (11.4.0-1ubuntu1~22.04.2) ...
Setting up g++ (4:11.2.0-1ubuntu1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/c++.1.gz because associated file /usr/share/man/man1/g++.1.gz (of link group c++) doesn't exist
Setting up gfortran (4:11.2.0-1ubuntu1) ...
update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/f95.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f95) doesn't exist
update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/f77.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f77) doesn't exist
Processing triggers for libc-bin (2.35-0ubuntu3.10) ...
/bin/sh: 1: build/bin/sage-get-system-packages: not found

And this is because this apt-get is run on an empty image, without Sage files present. Duh...
This is sub-optimal. This means that every time _prereq and _bootstrap are changed, this has to change as well.

@dimpase
Copy link
Member Author

dimpase commented Aug 29, 2025

I'll see if I can use docker's COPY to avoid needless git clone

@dimpase
Copy link
Member Author

dimpase commented Aug 29, 2025

I'll see if I can use docker's COPY to avoid needless git clone

after wasting hours trying to figure out Docker's COPY, ADD, and RUN, I gave up and added missing deps directly.

Copy link
Contributor

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

Docker CI still fails, but I think that's because the last beta didn't built an image.

@soehms
Copy link
Member

soehms commented Aug 30, 2025

Docker CI still fails, but I think that's because the last beta didn't built an image.

Thank you for your effort. Perhaps we should try replacing the sagemath/sagemath-dev tags with our CI Docker images like sage-ubuntu-jammy-standard-with-targets to get rid of these targets in docker/Dockerfile. This would reduce maintenance overhead. I'll think about it after my vacation (i.e. after next two weeks).

@soehms
Copy link
Member

soehms commented Aug 30, 2025

Docker CI still fails, but I think that's because the last beta didn't built an image.

I suspect it's because Dima's repository doesn't have a suitable token for logging into DockerHub. The first job couldn't push the image needed by the second job.

I started another run from my repository, which should allow the login.

@dimpase
Copy link
Member Author

dimpase commented Aug 30, 2025

Docker CI still fails, but I think that's because the last beta didn't built an image.

I suspect it's because Dima's repository doesn't have a suitable token for logging into DockerHub. The first job couldn't push the image needed by the second job.

I started another run from my repository, which should allow the login.

it's very confusing - why does one need to do here anything with sage's repo forks (e.g. mine of @soehms )?

@soehms
Copy link
Member

soehms commented Aug 30, 2025

Docker CI still fails, but I think that's because the last beta didn't built an image.

I suspect it's because Dima's repository doesn't have a suitable token for logging into DockerHub. The first job couldn't push the image needed by the second job.
I started another run from my repository, which should allow the login.

it's very confusing - why does one need to do here anything with sage's repo forks (e.g. mine of @soehms )?

I think this is because the workflow is inheriting credentials from the fork, since that's where the branch is located. However, we now have the Docker image on DockerHub:

https://hub.docker.com/layers/sagemath/sagemath/10.8.beta1/images/sha256-582c0d1dda26919a43208fad0ff3f0e8b995d0748671abd9ef4716e79593500a

@vbraun vbraun merged commit 1cfd52c into sagemath:develop Sep 7, 2025
24 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants