Skip to content
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

[ RFC ] merge portage-stable, coreos-overlay submodules to paths in scripts/ #699

Closed
wants to merge 10,000 commits into from

Conversation

t-lo
Copy link
Member

@t-lo t-lo commented Mar 30, 2023

PR is superseded by

The objective and discussion below remains valid and is referenced by above PRs.

This change is a Request for Comment / Proof of Concept to merge both ebuild git submodules into paths while retaining the entire history of both submodules.

The vast majority of commits in this PR is the entire history of https://github.com/flatcar/coreos-overlay and https://github.com/flatcar/portage-stable, merged following the how-to at https://x3ro.de/integrating-a-submodule-into-the-parent-repository/.

To aid reviewing, there is only a single commit on top of the submodules migration. This commit is amended with necessary changes to make the PR work. Please review that one commit only - otherwise Github's web interface will blow up :)

Automation

The whole process of merging submodules as paths into the scripts repo is automated in a script: https://gist.github.com/t-lo/f403f2f1df5368a46a1454fe08e064f9 .
This script:

  1. clones all necessary repos with the version (branch) provided
  2. rewrites paths in coreos-overlay and portage-stable
  3. removes submodules in scripts
  4. imports the re-written history from 2.
  5. clones a pristine version of scripts with submodules
  6. runs a diff between pristine and merged scripts
  7. cherry-picks the commit ref above to import build automation changes
  8. commits everything

The script only creates local changes and creates a new branch for these changes. After the script ran (and succeeded) the resulting branch may be pushed to create a PR.

Motivation

Having a single repo simplifies clones, checkouts, and builds. It reduces complexity of existing and future automation. And it immediately enables github action CI builds and tests for PRs against former submodules (which would now be filed against the scripts repo).

Timeline

In a maintainers call on 2023-04-05 we aligned on the following timeline:

  1. After the next releases (Release Flatcar Container Linux Alpha 3572.0.0, Beta 3549.1.0, Stable 3510.2.0, LTS 3033.3.11 Flatcar#996 - week of April 10th) we enact a merge-freeze for coreos-overlay and portage-stable.
  2. This submodule merge PRs are re-done with the latest "frozen" state of coreos-overlay and portage-stable. This is straightforward as only the tip commit contains any business logic. This includes:
    a. This here PR (main and then-alpha)
    b. Related PRs to flatcar-3510 (then-stable), flatcar-3549 (then-beta), flatcar-3033 (LTS)
  3. the PRs are merged.
  4. scripts repo is re-tagged so release tags point to the unified scripts. This will make upcoming release notes for successive releases straightforward to generate.
  5. related PRs for github actions, release scripts, and jenkins automation are merged.

Follow-up work

  • Fall-out in the nightly builds / release builds need to be taken care of.
  • Existing automation from the submodule repos - particularly automated PRs - need to be ported to scripts.
  • Update developer documentation and remove references to submodules and the need to use checkout script

Flatcar Buildbot and others added 30 commits March 2, 2023 17:39
It's from Gentoo commit 07d598347c2a311c91eacd4303e0517cf0a127c3.
It's from Gentoo commit 27bd73e1860c85f68ba5353eec6b88bafbe615a2.
It's from Gentoo commit 7ff3874a1a6ea59ad3ea195b66921b7e332f2f4d.
It's from Gentoo commit db2110a4dcd7e99e00afd41429b94f4fe67e36fb.
It's from Gentoo commit 708a5eb5bbffb026c0e6097a20987797122aa07d.
It's from Gentoo commit 7d94f84a03f472a3ea8513c105c743f4bc64f4bc.
It's from Gentoo commit 383d8ccf52fefc0f320882e73424a61cc6ceca6e.
It's from Gentoo commit 49d659b4c11e9d3955f13d8c98b4ef8544e4117d.
It's from Gentoo commit e590be61f6ea99840e520c931d1b7158548087ef.
It's from Gentoo commit 9c70ade482350595ea273b4b00545a7a23d3e42d.
It's from Gentoo commit 91d9ac680f3c80df288a607f31c6bd188d501a2c.
It's from Gentoo commit 2056068fe7a93194be30b4504b0dd4960225b033.
It's from Gentoo commit c17701cef3dafad58a8a1a978ff5d585974abf0a.
It's from Gentoo commit 03677f912ed3fd5e02cbbbb2c9f37940d87d6c97.
It's from Gentoo commit 4af109f34b5bf97f25e6cdec6c292ab2599b6c65.
It's from Gentoo commit 9c0432bbae303f86f8142cf42b17334aff77140e.
Used to be a dependency of dev-python/setuptools before it was
updated.
It's from Gentoo commit aa8c011f5376ea3b6cef77580bd630b4bcfc0548.
Add or remove some packages we have updated or dropped with the weekly
updates.

Also drop sys-power/iasl, we don't have it any more.
It's from Gentoo commit b072cfaeb12a28b977754564d1817463cfc8ffae.

Moved from coreos-overlay.
It's from Gentoo commit 991727070a928a03481303ed5b0a571534853445.
- install curl before baselayout

  Now that Github rejects access to an unauthenticated URL with
  `git://`, we have to make git and libcurl work with
  `https://`. However, during the SDK stage2, curl is not explicitly
  installed, but just inherited from the stage1. As a result, curl is
  built without the `ssl` USE flag.  So installation of baselayout
  fails with:

```
git fetch https://github.com/flatcar-linux/baselayout.git --prune +HEAD:refs/git-r3/HEAD
fatal: unable to access 'https://github.com/flatcar-linux/baselayout.git/':
Protocol "https" not supported or disabled in libcurl
```

  To resolve the issue, we need to install curl with `BOOTSTRAP_USE=ssl`
  before trying to install baselayout.

- update openssl before stage3

  Right now our bootstrap flow is different then gentoo's - we don't
  update the seed when building stage1 and use a different ebuilds
  snapshot for stage1 compared to stage2 and stage3. This is causing
  us trouble now, because we introduced openssl-3, but seed/stage1
  still contains openssl-1.1. During `emerge -e @system` in stage3,
  some packages that depend on openssl may build against the stage1
  version, which results in an error during depcleaning (they would
  need to be rebuilt instead).  Stage3 is not extensible, so instead,
  explicitly update openssl in stage2. This workaround can be removed
  as soon as we release a seed with openssl-3.

Co-authored-by: Dongsu Park <dpark@linux.microsoft.com>
Co-authored-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
This pulls in
flatcar/bootengine#56
to ensure that even with a rerun from the initrd or with a deletion of
/etc/passwd we are able to boot.
sys-kernel/bootengine: Make initrd-setup-root more resilient
selinux: label `/etc` and enable `selinux` for find
Upgrade Containerd in main from 1.6.18 to 1.6.19
This pulls in
flatcar/baselayout#28 to fix a regression in
flatcar/baselayout#24 due to how
systemd-tmpfiles' Z rule seems to cause unnecessary changes in files.
@pothos
Copy link
Member

pothos commented Apr 3, 2023

The release tagging is here:
https://github.com/flatcar/flatcar-build-scripts/blob/master/tag-release
Changelog generation is here: https://github.com/flatcar/flatcar-build-scripts/blob/master/show-changes
The new Alpha branches get created with this script: https://github.com/flatcar/flatcar-build-scripts/blob/master/mirror-repos-branch (Optimization to do is dropping the creation of branches in unused repos)
The rest should be ok 🤞

@t-lo t-lo force-pushed the t-lo/merge-submodules-to-paths branch from 439f118 to ca7dde0 Compare April 4, 2023 16:54
@t-lo
Copy link
Member Author

t-lo commented Apr 5, 2023

All tests are green on Jenkins CI: (internal infra link): http://jenkins.infra.kinvolk.io:8080/job/container/job/sdk/748/cldsv/

Remove submodule references from build scripts, devcontainer,
.github workflows

The change includes a transient change to emerge-gitclone-9999.ebuild
for handling the new unified scripts/ repo.

Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
@pothos
Copy link
Member

pothos commented Apr 5, 2023

The release tagging is here: https://github.com/flatcar/flatcar-build-scripts/blob/master/tag-release Changelog generation is here: https://github.com/flatcar/flatcar-build-scripts/blob/master/show-changes The new Alpha branches get created with this script: https://github.com/flatcar/flatcar-build-scripts/blob/master/mirror-repos-branch (Optimization to do is dropping the creation of branches in unused repos) The rest should be ok crossed_fingers

Prepared in flatcar/flatcar-build-scripts#141

@t-lo
Copy link
Member Author

t-lo commented Apr 17, 2023

Closing; all relevant PRs have been merged (see summary).

@t-lo t-lo closed this Apr 17, 2023
@t-lo t-lo deleted the t-lo/merge-submodules-to-paths branch April 17, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants