Closed mkoeppe closed 4 years ago
Creating a dockerfile for setting up sage prerequisites on a Gentoo "prefix" was previously discussed in #28905.
An attempt (incomplete) is at https://github.com/sagemath/sage-prod/files/10659346/Dockerfile-sage_gentoo.gz and would need help from Gentoo experts.
Description changed:
---
+++
@@ -1,6 +1,6 @@
As a followup to #29053, in analogy to the work done for debian/fedora/arch/conda, we
- add files `build/pkgs/SPKG/distros/gentoo.txt` to keep track of equivalent distribution packages
-- extend `build/bin/write-dockerfile` to generate a Dockerfile for a gentoo "prefix" build.
+- extend `build/bin/write-dockerfile` to generate a Dockerfile for a gentoo "prefix" build - for rigorous multi-platform testing.
This is a part of:
- #29060: Meta-ticket: Add Dockerfiles and CI scripts for integration testing of source and binary distributions and of downstream packages
compiler can't create executables
in a configure phase of gcc typically means the compiler can't find libgmp and al. Do you have a log for me to review? Prefix on ubuntu is definitely supported. The only thing I can think of is that the bootstrap usually object being run as root.
Thanks, yes, turns out this was not specific to the gentoo prefix installer. I had to add some more packages. Let me see how far I get with this.
Attachment: gentoo-log-2.txt
Attachment: Dockerfile-sage_gentoo.gz
OK... this is where I got now. The ./bootstrap-prefix.sh
script was claiming to bootstrap some packages - such as xz and patch - and succeeded with that; but then it was missing "xz" to unpack the Python sources. I think something is wrong there, but I added xz&patch in ubuntu. This is attached Dockerfile-sage_gentoo and log from 'docker build' with that.
As you can see in the log, now it's complaining about a module missing in the Python that it just built:
File "/gentoo/var/tmp/python-3.6.10/Python-3.6.10/Lib/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ModuleNotFoundError: No module named 'pyexpat'
make: *** [install] Error 1
Makefile:1102: recipe for target 'install' failed
??? Python failed to install *sigh* continuing anyway
* Python bootstrapped
http://distfiles.gentoo.org/snapshots
and then dies with:
* Compiling prefix-portage
./configure --host=x86_64-pc-linux-gnu --prefix=/gentoo/tmp/usr --mandir=/gentoo/tmp/usr/share/man --infodir=/gentoo/tmp/usr/share/info --datadir=/gentoo/tmp/usr/share --sysconfdir=/gentoo/tmp/etc --localstatedir=/gentoo/tmp/var/lib --build=x86_64-pc-linux-gnu --with-offset-prefix=/gentoo/tmp --with-portage-user=root --with-portage-group=root --with-extra-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
....
checking whether /usr/bin/id is good enough... yes
checking for python... no
configure: error: no python found in your path
xz
is rearing up its head again. Yes it should be an early one. Because many more sources are in .xz I am not shocked that it should be a pre-requisite along with patch. The pyexpat stuff is weird. I'll do some experimenting later. I haven't really touched prefix since ppc64 was retired (because I didn't want or could maintain it long term).
Description changed:
---
+++
@@ -1,6 +1,18 @@
As a followup to #29053, in analogy to the work done for debian/fedora/arch/conda, we
- add files `build/pkgs/SPKG/distros/gentoo.txt` to keep track of equivalent distribution packages
-- extend `build/bin/write-dockerfile` to generate a Dockerfile for a gentoo "prefix" build - for rigorous multi-platform testing.
+- extend `build/bin/write-dockerfile` to
+ - generate a Dockerfile using https://hub.docker.com/r/gentoo/stage3-amd64/tags
+ - generate a Dockerfile for a gentoo "prefix" build on top of some Linux distribution
+ for rigorous multi-platform testing.
This is a part of:
- #29060: Meta-ticket: Add Dockerfiles and CI scripts for integration testing of source and binary distributions and of downstream packages
+
+---
+
+Resources:
+- https://forums.gentoo.org/viewtopic-t-969278-start-0.html
+- cschwan/sage-on-gentoo: (Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds: https://github.com/cschwan/sage-on-gentoo
+- Project:Overlays/Old User Guide - Gentoo Wiki: https://wiki.gentoo.org/wiki/Project:Overlays/Old_User_Guide
+- Layman - Gentoo Wiki: https://wiki.gentoo.org/wiki/Layman
+
Description changed:
---
+++
@@ -1,6 +1,7 @@
-As a followup to #29053, in analogy to the work done for debian/fedora/arch/conda, we
-- add files `build/pkgs/SPKG/distros/gentoo.txt` to keep track of equivalent distribution packages
-- extend `build/bin/write-dockerfile` to
+As a followup to #29053, in analogy to the work done for debian/fedora/arch/conda, we are adding files `build/pkgs/SPKG/distros/gentoo.txt` to keep track of equivalent distribution packages in #29273.
+
+In this ticket,
+- we extend `build/bin/write-dockerfile` to
- generate a Dockerfile using https://hub.docker.com/r/gentoo/stage3-amd64/tags
- generate a Dockerfile for a gentoo "prefix" build on top of some Linux distribution
for rigorous multi-platform testing.
Dependencies: #29273
This tickets needs help from someone who actually uses Gentoo. I found the instructions for installing stuff inadequate.
I use Gentoo, but neither prefix, not docker.
I need to make time for this. I cannot give you a time frame.
Replying to @dimpase:
I use Gentoo, but [...] not docker.
After installing a docker client, it only takes
docker run -it gentoo/stage3-amd64
This gives you root prompt. I would need instructions on what to do next to install relevant gentoo packages here.
If I understand well you have a minimal gentoo image running now. What do you want to install? Do you have a list somewhere?
Replying to @kiwifb:
If I understand well you have a minimal gentoo image running now. What do you want to install? Do you have a list somewhere?
The equivalent of the lists in build/pkgs/debian-bootstrap.txt and build/pkgs/debian.txt (minimal requirements for bootstrapping and building) -- which would be added in #29273 as well since gentoo packages are being added there.
Replying to @mkoeppe:
Replying to @dimpase:
I use Gentoo, but [...] not docker.
After installing a docker client, it only takes
docker run -it gentoo/stage3-amd64
This gives you root prompt. I would need instructions on what to do next to install relevant gentoo packages here.
I can try either this or Gentoo in lxc container, if such a thing exists somewhere.
Docker please because that's what my tox.ini infrastructure uses. If we want to do the same with lxc instead of docker, why not, but perhaps one step at a time?
I have created ticket #29283 for the goal of lxc containers for testing, in case someone wants to work on that.
Starting points for people who want to help with this:
When I run tox -e docker-gentoo
I get half-baked sage/.tox/docker-gentoo/Dockerfile
, I need a way to shove the hand-crafted Dockerfile
instead (for debugging purposes). What is the best way to do it?
Does your handcrafted Dockerfile work with docker build
already?
You could insert a line before # From https://hub.docker.com/r/multiarch/ubuntu-core/
that says
docker-gentoo: bash -c 'whatever command to create a handcrafted {envdir}/Dockerfile'
So right after
docker: bash -c 'build/bin/write-dockerfile.sh ... > {envdir}/Dockerfile'
Thank you!
Attachment: docker-gentoo-installed.txt
docker-gentoo-installed.txt
The work is still in progress. I managed to install 555 packages.
Nice
real 14m14.888s
user 98m59.353s
sys 3m4.286s
SAGE_CHECK=warn, so scanning the log files. This may take a few seconds.
Sage build/upgrade complete!
make[1]: Leaving directory '/sage'
Removing intermediate container e0e5bbfb22ea
---> 14316b24894b
[Warning] One or more build-args [TARGETS_OPTIONAL] were not consumed
Successfully built 14316b24894b
Successfully tagged sage-docker-gentoo-standard-with-targets:9.2.beta1-dirty
_________________________ summary __________________________
docker-gentoo-standard: commands succeeded
congratulations :)
1) run docker build -t fbissey/sage-on-gentoo-stage4:20.6 -t fbissey/sage-on-gentoo-stage4:latest -f Dockerfile_gentoo-20.06-gcc9-py37 .
2) patch tox.ini
and write-dockerfile.sh
Attachment: tox.ini.patch.gz
Attachment: write-dockerfile.sh.patch.gz
Attachment: Dockerfile_gentoo-20.06-gcc9-py37.gz
https://hub.docker.com/r/fbissey/sage-on-gentoo-stage/tags ... this does not seem to exist yet?
Replying to @mkoeppe:
https://hub.docker.com/r/fbissey/sage-on-gentoo-stage/tags ... this does not seem to exist yet?
It does not exist. Someone have to decide where to store an image. I have no idea, my docker-fu is weak.
Why not create an account on docker hub? Next step: https://docs.docker.com/docker-hub/builds/
I am working on Dockerfile_gentoo-20.06-gcc9-py37
to make image size much much smaller :(
docker pull sheerluck/sage-on-gentoo-stage4:latest
$ docker run -it sheerluck/sage-on-gentoo-stage4 /bin/bash
cf6f39e01c4a / # ipython --no-banner
In [1]: from os import walk
...: pth, ext = "/var/db/pkg", ".ebuild"
...: lex, res = len(ext), []
...: for _, _, u in walk(pth):
...: res += [x[:-lex] for x in u if x.endswith(ext)]
...: for pkg in sorted(res): print(pkg)
Alnuth-3.1.1
App-pwhich-1.150.0
Authen-SASL-2.160.0-r1
...
zn_poly-0.9.2
zope-interface-4.7.1
zstd-1.4.4-r4
zziplib-0.13.69-r1
Awesome!
Could you put the changes to the sage scripts on a git branch please?
$ git push trac HEAD:u/gh-sheerluck/gentoo
...
To trac.sagemath.org:sage.git
* [new branch] HEAD -> u/gh-sheerluck/gentoo
Branch: u/gh-sheerluck/gentoo
sed: ./build/pkgs/gentoo.txt: No such file or directory
sed: ./build/pkgs/gentoo-bootstrap.txt: No such file or directory
Also, at the end of configure
, I see:
configure: notice: the following SPKGs did not find equivalent system packages: cbc eclib gp2c isl lcalc libsemigroups pandoc pari pari_elldata pari_galdata pari_galpol pari_nftables pari_seadata pari_seadata_small perl_cpan_polymake_prereq perl_term_readline_gnu r yasm
checking for the package system in use... gentoo
configure: hint: installing the following system packages is recommended and may avoid building some of the above SPKGs from source:
configure: # install the following packages: sci-mathematics/eclib[flint] sci-mathematics/gp2c dev-libs/isl app-text/pandoc sci-mathematics/pari sci-mathematics/pari-data XML-Writer XML-LibXML XML-LibXSLT File-Slurp dev-perl/Term-ReadLine-Gnu JSON SVG dev-perl/MongoDB dev-perl/Term-ReadLine-Gnu dev-lang/R
Could you update build/bin/sage-print-system-package-command
so that an actual installation command is displayed?
I added gentoo.txt
and gentoo-bootstrap.txt
and updated sage-print-system-package-command
and I am going to refresh sheerluck/sage-on-gentoo-stage4:latest
with additional packages (except pandoc
) and after testing I will push in u/gh-sheerluck/gentoo
branch
Branch pushed to git repo; I updated commit sha1. New commits:
c55cfa9 | sage-print-system-package-command updated |
Now configure
says "configure: $ sudo emerge sci-mathematics/eclib[flint] sci-mathematics/gp2c app-text/pandoc sci-mathematics/pari sci-mathematics/pari-data XML-Writer XML-LibXML XML-LibXSLT File-Slurp dev-perl/Term-ReadLine-Gnu JSON SVG dev-perl/MongoDB dev-lang/R" although everything is installed in sheerluck/sage-on-gentoo-stage4:latest
(except pandoc
)
For sci-mathematics/eclib[flint]
, please check whether this syntax does whatever was intended there. See previous discussion in #29273.
config.log
should give information on why a particular package was rejected by configure
.
Reading config.log
is fascinating.
For example, "cbc >= 2.9.4" might refer to sci-libs/coinor-cbc-2.10.5
(https://github.com/coin-or/Cbc)
WIP
As a followup to #29053 and #29273, we
build/bin/write-dockerfile.sh
to generate a Dockerfile using https://hub.docker.com/r/sheerluck/sage-on-gentoo-stage4build/pkgs/gentoo*.txt
bin/sage-print-system-package-command
to handle gentooTo test:
tox -e docker-gentoo-standard
This is a part of:
29060: Meta-ticket: Add Dockerfiles and CI scripts for integration testing of source and binary distributions and of downstream packages
Resources:
Depends on #29273
CC: @orlitzky @kiwifb @dimpase @sheerluck
Component: porting
Author: Andrey Belgorodski
Branch:
9959ee9
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/29105