1 |
Hello, |
2 |
|
3 |
First, let me apologise if I have any wrong preexisting ideas/guesses about |
4 |
Gentoo Prefix and how it is developed. Secondly, sorry if this email is a |
5 |
bit too long. |
6 |
|
7 |
I'll present myself, explain my use-case and my troubles and tricks, and |
8 |
then ask for feedback. |
9 |
|
10 |
Hello, I'm Sammy Pfeiffer. I am a PhD student at University of Technology |
11 |
Sydney. I'm a (software) robotics engineer pursuing my PhD in a lab with a |
12 |
bunch of different robots and machine learning setups. I'm using Gentoo |
13 |
Prefix for deploying a big bunch of software into robots where the OS is |
14 |
old and frozen (and also to deploy in computation farms experiments... once |
15 |
again with no option to touch the OS). (The bunch of software is ROS, the |
16 |
'Robotics Operating System' which has a ton of dependencies, and there is |
17 |
an existing overlay which I'm helping on maintaining and improving ( |
18 |
https://github.com/ros/ros-overlay)). |
19 |
|
20 |
I'd like to share the trick I found to overcome a few annoying bits of my |
21 |
platforms: |
22 |
* I have no root access in the machines I need to deploy. |
23 |
* The machines don't have Docker installed (too old kernel anyways). |
24 |
* I have 32 bit and 64 bit machines (the OS running in them is). |
25 |
* I have a different username (and home folder) on each machine. |
26 |
* Each machine has a different disk(s)/partition(s) structure (main issue |
27 |
here is that I may need to use a different disk to store my data, cause of |
28 |
size constrains). |
29 |
|
30 |
The trick to be able to use Gentoo Prefix with all these constraints |
31 |
bootstrapping it only once is to set the EPREFIX to /tmp/gentoo. |
32 |
Then you can deploy the full bootstrapped system in any folder/disk and |
33 |
just do a softlink to /tmp/gentoo. This works nicely (I was scared of the |
34 |
softlink breaking stuff somewhere, but it was alright). |
35 |
The other trick is to bootstrap a 32bit Gentoo Prefix, which can be run in |
36 |
any 32b or 64b box (it's not ideal but simplifies my deployment currently). |
37 |
|
38 |
Also, having all these machines use the same Gentoo Prefix in the same |
39 |
place, with the same 32bit compilation, I can setup a binary package |
40 |
server, which all the deployments can point to and just get all the |
41 |
packages skipping the long compilation times (specially in very old and low |
42 |
powered machines). |
43 |
|
44 |
The final trick I'm experimenting with is to use a set of Docker images |
45 |
(and soon in a continuous integration environment) to bootstrap all the |
46 |
system. With that I can save snapshot of successfully built systems & |
47 |
packages to serve as an easy deployment (and easy installation of extra |
48 |
packages thru the binary package server). |
49 |
|
50 |
Given my particular annoyance of the 32bit system (and noting that my hosts |
51 |
are 64bits, as is the standard nowadays) I found that I can use either: |
52 |
* https://github.com/docker-32bit/ubuntu a 32bit Ubuntu Docker image |
53 |
* https://github.com/gentoo/gentoo-docker-images stage3-x86 32bit Gentoo |
54 |
Docker image |
55 |
|
56 |
And then execute the build step of Docker with: |
57 |
|
58 |
setarch i686 docker build -t my_bootstrapping_gentoo_prefix_32b_image . |
59 |
|
60 |
Which will trick any program trying to do uname -m to assume 32bit machine. |
61 |
(Previously I used the variable CHOST=i686-pc-linux-gnu for bootstrapping, |
62 |
but I found some problems, which didn't appear with this method). |
63 |
|
64 |
Once I have all this setup working nicely, I'd like to trigger rebuilds |
65 |
every X time, and on changes on main players (or all dependencies actually) |
66 |
of my setup, like the bootstrapping of Gentoo Prefix (Ideally, on every |
67 |
change of a part of the system just trigger a rebuild from that point on, |
68 |
Docker layers make this possible). |
69 |
|
70 |
With Azure announcing unlimited minutes on CI/CD for open source projects: |
71 |
https://azure.microsoft.com/en-us/blog/announcing-azure-pipelines-with-unlimited-ci-cd-minutes-for-open-source/ |
72 |
|
73 |
Even bootstrapping Gentoo prefix, with pieces of software like gcc taking |
74 |
very long to compile, is possible. |
75 |
|
76 |
The point is: I have been trying to build Gentoo Prefix during the last |
77 |
days after a few months of break since the last time I touched the system. |
78 |
And it's failing. I haven't managed yet to bootstrap it completely. I feel |
79 |
there is no CI/CD setup to catch these issues and be able to offer a |
80 |
working version of Gentoo Prefix at any time. |
81 |
|
82 |
I was going to build it for myself (cause I need it), but instead, I'd like |
83 |
to offer my help to build it for the community. At least offer as an option |
84 |
ready-to-use /tmp/gentoo EPREFIX'ed built Gentoo Prefix from a Docker |
85 |
image, just copy the full folder structure, do the softlink, and you are |
86 |
ready to play with Gentoo. If you mess up anything, just re-deploy. |
87 |
|
88 |
To do this I'd need a bit of help as I'm quite new to Gentoo and I tend to |
89 |
get blocked on little issues that take a while to google or debug |
90 |
(specially with the long compilation times of the bootstrap and some big |
91 |
packages). |
92 |
|
93 |
I've posted a short issue in the Docker repo of Gentoo images about this ( |
94 |
https://github.com/gentoo/gentoo-docker-images/issues/62) but I think the |
95 |
maintainers probably don't usually work with Gentoo Prefix. |
96 |
|
97 |
Thank you very much for your time, and for your open source efforts. |
98 |
|
99 |
-- |
100 |
|
101 |
*Sammy Pfeiffer* |
102 |
PhD Candidate at The Magic Lab within UTS. |