Add support for copying yum repos from separate git repo#3036
Add support for copying yum repos from separate git repo#3036jlebon merged 4 commits intocoreos:mainfrom
Conversation
3daa435 to
ffe6314
Compare
|
Hmm. I'm OK with this, but IMO it also cuts against the "elegance" of the current architecture. For example, suddenly pull requests don't quite work because there are two git repositories involved. We're also today injecting metadata about the config git repository into the base container image. But that loses some meaning with two git repositories. Related to that topic, this PR isn't injecting any metadata from (e.g. exact git rev) the "extconfig" git repo into the cosa metadata. |
The use case for this is RHCOS, which sadly already suffers from this issue. The idea with this PR is essentially upstreaming and formalizing the
👍 Yeah we should add that (and is actually another benefit of formalizing it in cosa directly). |
|
Note: if we have lockfiles, then this extconfig repo degrades basically to a mirrorlist. |
ffe6314 to
ba3084b
Compare
ba3084b to
b36171f
Compare
e0c4e8b to
ad651aa
Compare
|
Updated this now but still testing it locally! |
|
CI failure looks legit |
699515c to
536974d
Compare
|
Rebased and now tested locally! |
Make the `tarball` argument last. Prep for making it optional.
For the upcoming yumrepos, we don't want to publish a tarball of it. We still want the git rev information though. Make the tarball argument optional.
Add a new option `--yumrepos` option to `cosa init` to allow import of yum repo files and content sets located outside of the source git. Motivation: RHCOS needs yum repo definitions hidden behind a firewall. Let's add a clean way to import them. Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
|
I think we should coordinate the changes in this one with those from #2934 |
| # each included dir. | ||
| # https://github.com/projectatomic/rpm-ostree/issues/1628 | ||
| cp "${workdir}"/src/config/*.repo "${tmp_overridesdir}"/ | ||
| find "${configdir}" -name '*.repo' -exec cp -t "${tmp_overridesdir}" {} + |
There was a problem hiding this comment.
This is great. That will make things easier for SCOS!
|
The only concern I could find was about the additional repo becoming stale on developer systems. This will not be an issue in CI as we clone from scratch every time. |
|
One option to work around that is to include the minor RHEL version in the repo names thus the build would fail when the repos are missing. |
Done in #3045. |
|
This likely broke RHCOS CI: openshift/os#959. Investigating: |
|
And I've realized late that this will also not work when we have two minor RHEL minor versions at the same time in the repo (9.0 & 9.2) as the repo names will be the same but not the URLs. We thus have to make repo names minor version specific (this should also work for content sets) or rework this one. |
|
We also need to be able to specify a branch for the |
|
Related docs update in openshift/os#958 |
I'm in favor of this. |
| if [ -d "${workdir}/src/yumrepos" ]; then | ||
| find "${workdir}/src/yumrepos" -name '*.repo' -exec cp -t "${tmp_overridesdir}" {} + | ||
| fi | ||
| if ! ls "${tmp_overridesdir}"/*.repo; then |
There was a problem hiding this comment.
I think the issue is here as this assumes that there is an overridesdir when there may not be
There was a problem hiding this comment.
Where this code is, we always create an overrides dir. ISTM like the issue OpenShift CI is hitting is the same that FCOS was hitting and should be fixed by 24ffe87 (#3045). Let's see what the CI rerun in openshift/os#959 says. :)
Yes, if the repo contents are different, we shouldn't be using the same repo ID. Otherwise we'll be claiming we're using the wrong content set for one of them. This is what this comment is about. And this jogs my memory now. I said higher up:
This is not true. I was thinking instead I think of the fact we have to match the repo names of the mirrored versions in OpenShift CI, which I think we have some control over. |
|
Yes, we have control over the names in Prow CI. I'll make the PRs to change everything. |
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4) (cherry picked from commit a82d230)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4) (cherry picked from commit a82d230) (cherry picked from commit dd45d41)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4) (cherry picked from commit a82d230) (cherry picked from commit dd45d41)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4) (cherry picked from commit a82d230) (cherry picked from commit dd45d41)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4) (cherry picked from commit a82d230) (cherry picked from commit dd45d41)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4) (cherry picked from commit a82d230) (cherry picked from commit dd45d41)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4) (cherry picked from commit a82d230) (cherry picked from commit dd45d41)
Copy repo config files from config dir & yumrepos git repo. Fixes: coreos#3074 Fixes: coreos#3036 Fixes: coreos#3045 (cherry picked from commit 5c708b4)
Add a new option
--yumreposoption tocosa initto allow import ofyum repo files and content sets located outside of the source git.
Motivation: RHCOS needs yum repo definitions hidden behind a firewall.
Let's add a clean way to import them.
Co-authored-by: Jonathan Lebon jonathan@jlebon.com