New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make qubes-builder working on Debian host #1907

Closed
marmarek opened this Issue Apr 13, 2016 · 12 comments

Comments

Projects
None yet
3 participants
@marmarek
Member

marmarek commented Apr 13, 2016

Currently qubes-builder works only on Fedora based system. The idea of using chroot for actual package build should make it easy for running it on any distribution.
This is required for adding support for Qubes in Travis-CI, or Debian Reproducible Builds testing rig.

@marmarek marmarek added this to the Release 3.2 milestone Apr 13, 2016

@marmarek marmarek self-assigned this Apr 13, 2016

@akuckartz

This comment has been minimized.

Show comment
Hide comment

👍

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Apr 13, 2016

Member

Marek Marczykowski-Górecki:

Currently qubes-builder works only on Fedora based system. The idea of using chroot for actual package build should make it easy for running it on any distribution.
This is required for adding support for Qubes in Travis-CI, or Debian Reproducible Builds testing rig.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#1907

Working on Debian host may be a good.

However, Travis-CI may be very difficult, since Ubuntu based. I had once
working for Whonix. Too much if Debian else Ubuntu code. Too many
package version differences. Another problem was that Travis-CI did not
support certain system near operations. Since it is already running
inside a VM container it is very limited. In OpenVZ, which makes it even
more limited. Stuff like key generation was very low or even failed,
since there is no entropy. So you need workarounds for that also. I
highly recommend staying away from Ubuntu anything and use a Debian
based CI.

Member

adrelanos commented Apr 13, 2016

Marek Marczykowski-Górecki:

Currently qubes-builder works only on Fedora based system. The idea of using chroot for actual package build should make it easy for running it on any distribution.
This is required for adding support for Qubes in Travis-CI, or Debian Reproducible Builds testing rig.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#1907

Working on Debian host may be a good.

However, Travis-CI may be very difficult, since Ubuntu based. I had once
working for Whonix. Too much if Debian else Ubuntu code. Too many
package version differences. Another problem was that Travis-CI did not
support certain system near operations. Since it is already running
inside a VM container it is very limited. In OpenVZ, which makes it even
more limited. Stuff like key generation was very low or even failed,
since there is no entropy. So you need workarounds for that also. I
highly recommend staying away from Ubuntu anything and use a Debian
based CI.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 13, 2016

Member

However, Travis-CI may be very difficult, since Ubuntu based. I had once working for Whonix. Too much if Debian else Ubuntu code. Too many package version differences.

That shouldn't be a problem, since most of the build is happening inside chroot (with debian/fedora/whatever).

Anyway, that was just an example of use cases.

Member

marmarek commented Apr 13, 2016

However, Travis-CI may be very difficult, since Ubuntu based. I had once working for Whonix. Too much if Debian else Ubuntu code. Too many package version differences.

That shouldn't be a problem, since most of the build is happening inside chroot (with debian/fedora/whatever).

Anyway, that was just an example of use cases.

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 15, 2016

Preliminary support for Debian host
- use bash as shell, for shopt -o pipefail
- check/install dependencies using appropriate tools

TODO:
- handle different package names in DEPENDENCIES on Debian/Fedora

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 15, 2016

Install yum/dnf in chroot as soon as possible
Do not use yum/dnf from the host to install packages inside chroot,
because its version may be incompatible with configuration/options used
inside. This is the case when building on Debian host, where yum is much
older.

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 15, 2016

Workarounds for Debian's rpm configuration
On Debian, rpm is configured to keep rpmdb in ~/.rpmdb, even when
installing some system package with rpm --root=.... This makes it
problematic to hand it over to rpm running inside just installed system.
To solve this, override _dbpath setting. To do that, use bash as a
shell, for arrays.

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 15, 2016

Create base /dev files as soon as possible
Those files are needed to run yum/dnf, so create them before its first
use. MAKEDEV tool is installed through yum, so can't be used that early
(will be used later to populate other entries).

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 15, 2016

Provide local copy of spectool
The rpmdevtools package isn't available on Debian. spectool is the only
tool needed, so simply ship it with builder-fedora.

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 15, 2016

Fold python-sh dependency into a single assignment
This way it is possible to override it from builder.conf

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 15, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 15, 2016

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 16, 2016

Use yumdownloader -c instead of --config
The long option is available only in newer releases.

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 16, 2016

Use yumdownloader -y instead of --assumeyes
As previously, --assumeyes not available in older versions.

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 16, 2016

Don't use yumdownloader --releasever option
It isn't available in older versions...

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 16, 2016

Don't use yumdownloader --releasever option
It isn't available in older versions...

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-debian that referenced this issue Apr 17, 2016

marmarek added a commit to marmarek/qubes-builder-debian that referenced this issue Apr 17, 2016

Don't use pushd/popd
It doesn't work in dash.

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-debian that referenced this issue Apr 17, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 17, 2016

Member

Major progress:

  1. Building a single component (at least core-agent-linux) on Debian host does work
  2. Building a single component (at least core-agent-linux) on Travis-CI does work: https://travis-ci.org/marmarek/qubes-core-agent-linux/builds/123709594

To do:

  • check other components
  • make template build working on Debian host
  • make ISO build working on Debian host
  • consider enabling Travis-CI for all the Qubes OS components, for pull requests and/or all pushes.

The last one may be interesting :) But it is only about building, not full test run, unfortunately.

cc @woju @adrelanos

Member

marmarek commented Apr 17, 2016

Major progress:

  1. Building a single component (at least core-agent-linux) on Debian host does work
  2. Building a single component (at least core-agent-linux) on Travis-CI does work: https://travis-ci.org/marmarek/qubes-core-agent-linux/builds/123709594

To do:

  • check other components
  • make template build working on Debian host
  • make ISO build working on Debian host
  • consider enabling Travis-CI for all the Qubes OS components, for pull requests and/or all pushes.

The last one may be interesting :) But it is only about building, not full test run, unfortunately.

cc @woju @adrelanos

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 20, 2016

marmarek added a commit to marmarek/qubes-linux-template-builder that referenced this issue Apr 20, 2016

Make template builder working on Debian
1. Use bash explicitly where required
2. Don't use bash-isms where not.

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 20, 2016

Prefer using rpm/yum/dnf from inside chroot environment
If available, it will be the right version (regardless of what is
installed on the host).

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 20, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Apr 20, 2016

Member

Cool stuff! Does travis CI support chroot? Do you think it can also do full template builds? Would be interesting to have changes like #1174 build new templates, isos in "all" combinations to see if the change is rock solid breaking nothing.

Member

adrelanos commented Apr 20, 2016

Cool stuff! Does travis CI support chroot? Do you think it can also do full template builds? Would be interesting to have changes like #1174 build new templates, isos in "all" combinations to see if the change is rock solid breaking nothing.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 21, 2016

Member

Regarding chroot - yes, they have images with sudo access, so chroot can be used. Take a look at linked test result - there are two builds: for jessie and fc23. Both done on Ubuntu 14.04 host ;)

Regarding templates and ISO - I'm currently working on it. It should be possible, the only potential problem would be hitting some limit (time, space, etc).

Member

marmarek commented Apr 21, 2016

Regarding chroot - yes, they have images with sudo access, so chroot can be used. Take a look at linked test result - there are two builds: for jessie and fc23. Both done on Ubuntu 14.04 host ;)

Regarding templates and ISO - I'm currently working on it. It should be possible, the only potential problem would be hitting some limit (time, space, etc).

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 21, 2016

travis: fix testing builder plugins itself
'make get-sources' downloads all the builder plugins, so remove the out
of the way when testing one of them

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 21, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 21, 2016

travis: add option to build different component than currently testing
This will allow for example trigger template build on change in builder
plugin

QubesOS/qubes-issues#1907

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 21, 2016

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Apr 21, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 21, 2016

Don't rely on ONESHELL make feature in template build
It requires make >=3.82, but Travis-CI env (Ubuntu trusty) have 3.81.

QubesOS/qubes-issues#1907
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 21, 2016

Member

Ok, for template build it looks we're hitting time limit:
https://travis-ci.org/marmarek/qubes-builder-fedora/builds/124719727

While theoretically time limit is 10 min of no output, build is interrupted exactly after 5 minutes...

Member

marmarek commented Apr 21, 2016

Ok, for template build it looks we're hitting time limit:
https://travis-ci.org/marmarek/qubes-builder-fedora/builds/124719727

While theoretically time limit is 10 min of no output, build is interrupted exactly after 5 minutes...

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 21, 2016

Member

Haven't tried yet. But in theory it will not change anything, as the build produce a lot of output. For example here it build running now: https://travis-ci.org/marmarek/qubes-builder-fedora/builds/124785753

Member

marmarek commented Apr 21, 2016

Haven't tried yet. But in theory it will not change anything, as the build produce a lot of output. For example here it build running now: https://travis-ci.org/marmarek/qubes-builder-fedora/builds/124785753

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 21, 2016

Member

Interesting - setting language: generic (which force usage of "minimal" trusty image) helps somehow. The build linked above is still running, for over 20 minutes. Hopefully will finish shortly.

There is another problem - build output (log) is too long. This is a minor problem, as it only affects interactive web log view, but it is possible to download full raw log. But we may consider lowering verbosity. @adrelanos what do you think?

Member

marmarek commented Apr 21, 2016

Interesting - setting language: generic (which force usage of "minimal" trusty image) helps somehow. The build linked above is still running, for over 20 minutes. Hopefully will finish shortly.

There is another problem - build output (log) is too long. This is a minor problem, as it only affects interactive web log view, but it is possible to download full raw log. But we may consider lowering verbosity. @adrelanos what do you think?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 21, 2016

Member

This went offtopic. Qubes builder on Debian is done. Travis CI support is a separate task - #1926

Member

marmarek commented Apr 21, 2016

This went offtopic. Qubes builder on Debian is done. Travis CI support is a separate task - #1926

@marmarek marmarek closed this Apr 21, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Apr 21, 2016

Member
Member

adrelanos commented Apr 21, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Apr 21, 2016

Don't rely on ONESHELL make feature in template build
It requires make >=3.82, but Travis-CI env (Ubuntu trusty) have 3.81.

QubesOS/qubes-issues#1907
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment