Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Comments

fix GCP OEM functionality#1813

Merged
jepio merged 4 commits intomainfrom
jepio/fix-gcp-oem
Apr 20, 2022
Merged

fix GCP OEM functionality#1813
jepio merged 4 commits intomainfrom
jepio/fix-gcp-oem

Conversation

@jepio
Copy link
Contributor

@jepio jepio commented Apr 12, 2022

fix GCP OEM functionality

Since we dropped python2 from our tree, the GCP OEM container image has been broken. This is because we explicitly removed/masked all python3 packages in the oem-aci profile. After restoring python in the container image, it turns out more dependencies were missing and we need to update the compute-engine-packages to work with python 3.9.

Requires: flatcar-archive/portage-stable#321
Related: flatcar/Flatcar#714

How to use

./build_packages
./build_image
./image_to_vm.sh --format=gce

Testing done

Testing this together with some semi-related commits here: http://jenkins.infra.kinvolk.io:8080/job/os/job/manifest/5373/cldsv/.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)

jepio added 3 commits April 12, 2022 15:32
The oem-aci profile previously removed python3 from the produced oem
images by having an entry saying dev-lang/python-3.X is provided and
removing all python3 files. This only worked as long as python2 was
available and installed instead, but since python2 was removed from the
tree these entries in the profile resulted in oem-aci having no python
at all. This prevents the oem-gce service from working, since a lot of
what it does is python.

Remove the INSTALL_MASK and package.provided entries for python3 to
allow python3 into oem-aci images.
and add missing dependencies on dev-python/distro and sys-apps/coreutils. We
need to bump the version to 20190124 because:

* 20180611 is not compatible with python 3.9 because of missing distro module and
  trying to access os.errno (instead of importing the errno module). Also why we
  need the dependency on dev-python/distro

* 20190124 is the last version before the repo was split and reorganized which
  would require more work to the ebuilds

The coreutils dependency is necessary because the scripts call basename/nproc/cat
but previously coreutils was pulled in by the following dependency chain:

(dependency required by "app-admin/eselect-1.4.16::portage-stable" [binary])
(dependency required by "app-eselect/eselect-python-20160516::portage-stable" [binary])
(dependency required by "dev-lang/python-2.7.15::portage-stable" [binary])
(dependency required by "dev-python/boto-2.48.0::portage-stable" [binary])
(dependency required by "app-emulation/google-compute-engine-20180611::coreos" [binary])
(dependency required by "coreos-base/coreos-oem-gce-0.0.1-r5::coreos" [binary])
(dependency required by "coreos-base/coreos-oem-gce" [argument])

This chain seems to not hold any longer and we should be explicit about
dependencies.
The container performs multi-queue optimizations for ssd and network devices
which requires touching /proc and /sys/ mounts which systemd-nspawn usually
mounts readonly. Allow the container to modify those by setting the appropriate
environment variable (found via https://systemd.io/ENVIRONMENT/).
@pothos
Copy link
Contributor

pothos commented Apr 13, 2022

Thanks, looks good. I really think this is the kind of functionality that should be tested by kola because it's something not developed by an upstream project but custom to Flatcar.

@jepio
Copy link
Contributor Author

jepio commented Apr 13, 2022

Agree - looking into adding a test for this.

@jepio
Copy link
Contributor Author

jepio commented Apr 20, 2022

This is now covered by tests, could you have a second look @pothos ?

Copy link
Contributor

@pothos pothos left a comment

Choose a reason for hiding this comment

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

Thanks, looks good, just some suggestions above

@jepio jepio force-pushed the jepio/fix-gcp-oem branch from d7eca7c to 8b44e89 Compare April 20, 2022 10:14
@jepio
Copy link
Contributor Author

jepio commented Apr 20, 2022

Fixed up the changelog, now going in for the cherry-pick.

@jepio jepio merged commit cbfc6e3 into main Apr 20, 2022
@jepio jepio deleted the jepio/fix-gcp-oem branch April 20, 2022 10:16
jepio added a commit that referenced this pull request Apr 20, 2022
jepio added a commit that referenced this pull request Apr 20, 2022
jepio added a commit that referenced this pull request Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants