Gentoo Archives: gentoo-alt

From: Fabian Groffen <grobian@g.o>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] 'Continuous Integration' for Gentoo Prefix?
Date: Mon, 26 Nov 2018 08:11:43
Message-Id: 20181126081133.GD28829@gentoo.org
In Reply to: [gentoo-alt] 'Continuous Integration' for Gentoo Prefix? by Sam Pfeiffer
1 Hi Sam,
2
3 On 26-11-2018 15:02:26 +1100, Sam Pfeiffer wrote:
4 > Hello,
5 >
6 > First, let me apologise if I have any wrong preexisting ideas/guesses about
7 > Gentoo Prefix and how it is developed. Secondly, sorry if this email is a bit
8 > too long.
9 >
10 > I'll present myself, explain my use-case and my troubles and tricks, and then
11 > ask for feedback.
12 >
13 > Hello, I'm Sammy Pfeiffer. I am a PhD student at University of Technology
14 > Sydney. I'm a (software) robotics engineer pursuing my PhD in a lab with a bunch
15 > of different robots and machine learning setups. I'm using Gentoo Prefix for
16 > deploying a big bunch of software into robots where the OS is old and frozen
17 > (and also to deploy in computation farms experiments... once again with no
18 > option to touch the OS). (The bunch of software is ROS, the 'Robotics Operating
19 > System' which has a ton of dependencies, and there is an existing overlay which
20 > I'm helping on maintaining and improving
21 > ([1]https://github.com/ros/ros-overlay)).
22 >
23 > I'd like to share the trick I found to overcome a few annoying bits of my
24 > platforms:
25 >
26 > * I have no root access in the machines I need to deploy.
27 >
28 > * The machines don't have Docker installed (too old kernel anyways).
29 >
30 > * I have 32 bit and 64 bit machines (the OS running in them is).
31 >
32 > * I have a different username (and home folder) on each machine.
33 >
34 > * Each machine has a different disk(s)/partition(s) structure (main issue here
35 > is that I may need to use a different disk to store my data, cause of size
36 > constrains).
37 >
38 > The trick to be able to use Gentoo Prefix with all these constraints
39 > bootstrapping it only once is to set the EPREFIX to /tmp/gentoo.
40
41 That will work best, I presume.
42
43 > Then you can deploy the full bootstrapped system in any folder/disk and just do
44 > a softlink to /tmp/gentoo. This works nicely (I was scared of the softlink
45 > breaking stuff somewhere, but it was alright).
46 >
47 > The other trick is to bootstrap a 32bit Gentoo Prefix, which can be run in any
48 > 32b or 64b box (it's not ideal but simplifies my deployment currently).
49 >
50 > Also, having all these machines use the same Gentoo Prefix in the same place,
51 > with the same 32bit compilation, I can setup a binary package server, which all
52 > the deployments can point to and just get all the packages skipping the long
53 > compilation times (specially in very old and low powered machines).
54
55 Prefix branch knows a trick which can "relocate" packages. The
56 constrains is that it can only "shorten" a prefix. Thus, if you'd build
57 for /a/very/very/very/long/prefix you could install those binary
58 packages to /a/shorter/prefix. I think this will also addresses your
59 userid problems (if any).
60
61 > The final trick I'm experimenting with is to use a set of Docker images (and
62 > soon in a continuous integration environment) to bootstrap all the system. With
63 > that I can save snapshot of successfully built systems & packages to serve as an
64 > easy deployment (and easy installation of extra packages thru the binary package
65 > server).
66
67 Neat!
68
69 > Given my particular annoyance of the 32bit system (and noting that my hosts are
70 > 64bits, as is the standard nowadays) I found that I can use either:
71 >
72 > * [2]https://github.com/docker-32bit/ubuntu a 32bit Ubuntu Docker image
73 >
74 > * [3]https://github.com/gentoo/gentoo-docker-images stage3-x86 32bit Gentoo
75 > Docker image
76 >
77 > And then execute the build step of Docker with:
78 >
79 > setarch i686 docker build -t my_bootstrapping_gentoo_prefix_32b_image .
80 >
81 > Which will trick any program trying to do uname -m to assume 32bit machine.
82 > (Previously I used the variable CHOST=i686-pc-linux-gnu for bootstrapping, but I
83 > found some problems, which didn't appear with this method).
84
85 Hmmm.
86
87 > Once I have all this setup working nicely, I'd like to trigger rebuilds every X
88 > time, and on changes on main players (or all dependencies actually) of my setup,
89 > like the bootstrapping of Gentoo Prefix (Ideally, on every change of a part of
90 > the system just trigger a rebuild from that point on, Docker layers make this
91 > possible).
92
93 This may be a bit too much, but you could start from every day
94 (LATEST_TREE_YES), or we can see to building a tar more frequently from
95 rsync0.
96
97 > With Azure announcing unlimited minutes on CI/CD for open source projects: 
98 >
99 > [4]https://azure.microsoft.com/en-us/blog/announcing-azure-pipelines-with-unlimited-ci-cd-minutes-for-open-source/
100 >
101 > Even bootstrapping Gentoo prefix, with pieces of software like gcc taking very
102 > long to compile, is possible.
103
104 I'm still missing the infra to administer this, but I have a wrapper
105 script to bootstrap-prefix.sh (I'm sure others (haubi?) have too) to do
106 an unattended bootstrap. I want this to run automatically on some boxes
107 I have, but some of them will take several days to complete.
108 Another thing is for a bootstrapped prefix to periodically emerge --sync
109 and emerge -Dua world. Add on top of that detecting which packages have
110 keywords for said prefix and installing them, and we should be able to
111 be notice breakage rather sooner than later.
112
113 > The point is: I have been trying to build Gentoo Prefix during the last days
114 > after a few months of break since the last time I touched the system. And it's
115 > failing. I haven't managed yet to bootstrap it completely. I feel there is no
116 > CI/CD setup to catch these issues and be able to offer a working version of
117 > Gentoo Prefix at any time.
118
119 Sorry about that. I need to make another pass over it.
120
121 > I was going to build it for myself (cause I need it), but instead, I'd like to
122 > offer my help to build it for the community. At least offer as an option
123 > ready-to-use /tmp/gentoo EPREFIX'ed built Gentoo Prefix from a Docker image,
124 > just copy the full folder structure, do the softlink, and you are ready to play
125 > with Gentoo. If you mess up anything, just re-deploy.
126 >
127 > To do this I'd need a bit of help as I'm quite new to Gentoo and I tend to get
128 > blocked on little issues that take a while to google or debug (specially with
129 > the long compilation times of the bootstrap and some big packages).
130 >
131 > I've posted a short issue in the Docker repo of Gentoo images about this
132 > ([5]https://github.com/gentoo/gentoo-docker-images/issues/62) but I think the
133 > maintainers probably don't usually work with Gentoo Prefix.
134
135 I'm not very familiar myself with Docker (mostly hiding under a rock
136 here), but I suspect the gentoo-docker-images project responds better to
137 email to their list (as in Contributing from their README). I may be
138 wrong though.
139
140 > Thank you very much for your time, and for your open source efforts.
141
142 Thanks for your efforts sofar. I hope we can pull something together.
143 At least in the coming period I hope to be able to fix the bootstrapping
144 issues for Solaris/OpenIndiana/Darwin.
145
146 Thanks,
147 Fabian
148
149 --
150 Fabian Groffen
151 Gentoo on a different level

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-alt] 'Continuous Integration' for Gentoo Prefix? "M. J. Everitt" <m.j.everitt@×××.org>
[gentoo-alt] Re: 'Continuous Integration' for Gentoo Prefix? Michael Haubenwallner <haubi@g.o>
[gentoo-alt] Re: 'Continuous Integration' for Gentoo Prefix? Michael Haubenwallner <haubi@g.o>