-
Notifications
You must be signed in to change notification settings - Fork 185
qemuvariants: fix regression in GCP tarball format #1088
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
Conversation
|
First let's try to get to a common style here. The general style here before was to have the "topic prefix" not necessarily be the full file path. In this case it actually touches two files. Maybe just Style is also to avoid having a period This style is pretty much the same as the Linux kernel. IOW, something like: ? |
cgwalters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you've tested this I'm OK with it but some optional bits.
src/cosalib/qemuvariants.py
Outdated
| BASEARCH = get_basearch() | ||
|
|
||
| # Default flags for the creation of tarfiles | ||
| DEFAULT_TAR_FLAGS = '-Schgh' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expanding the comment with why we are picking these flags would be useful.
We always want -c, so it seems better to provide that automatically in the
Minor: h is there twice.
src/cosalib/qemuvariants.py
Outdated
| tar.add(te, arcname=te_name) | ||
| # Python does not create sparse Tarfiles, so we have do it via | ||
| # the CLI here. | ||
| log.info(f"Preparing tarball {final_img} with flags '{self.tar_flags}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log seems unnecessary since we print the tar command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the level of logging that we already have, the extra logging seen innocuous.
Removed.
src/cosalib/qemuvariants.py
Outdated
| base_name = self.tar_members.pop(0) | ||
| tarlist = [base_name] | ||
| if base_name != os.path.basename(work_img): | ||
| copy_sparse(work_img, os.path.join(self._tmpdir, base_name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the circumstances in which this condition fires. Is it something like enforcing a naming scheme for the file inside the tarball? Wouldn't it be a lot cheaper to just make a symlink in that case, since we're passing h to the tar invocation?
Actually at a higher level, it seems like it'd be a lot simpler to me if the builder implementations that used tar_files just each directly called tar as they need to.
Today only gcp and vmware use this AFAICS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR fixes the issue today. I can look at refactoring this out later. The original reason why I put the Tarball functionality here was because of the distaste for OOO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the latest push includes a comment about when the condition would happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't think we need cp --sparse=always anymore with #1097. The output of qemu-img convert is already sparse. Seems like here we just want os.link() if it's to have the filenames match up? That makes for less IO too. :)
|
Could you amend the commit message to include the BZ, too? |
| # Default flags for the creation of tarfiles | ||
| # The default flags were selected because: | ||
| # -S: always create a sparse file | ||
| # -c: create a new tarball | ||
| # -h: derefence symlinks | ||
| # -g: handle incremental backups. | ||
| # These flags were selected from prior commits for | ||
| # tarball creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
cgwalters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message still has a trailing . (also why is "Tarball" capitalized?)
|
Hmm, from looking at the Jenkins logs, it seems like |
```
Colin Walters (3):
network: Honor MANTLE_SSH_DIR
kola: Note qemu-unpriv now has networking
kola: Drop torcx tests
Jakub Čajka (1):
kola: initial ppc64le support
Stephen Lowrie (15):
vendor: add aliyun related dependencies
network/*ssh: Add HostKeyCallback to ClientConfig
auth: add aliyun auth provider
platform/api/aliyun: add the aliyun platform
cmd/ore/aliyun: add image creation related aliyun calls
docs: add Aliyun platform documentation
Merge pull request coreos#1066 from arithx/aliyun
Merge pull request coreos#1081 from cgwalters/ssh-agent-tmpdir
Merge pull request coreos#1086 from cgwalters/platform-qemu-unpriv-net
README: update qemu-unpriv notes
Merge pull request coreos#1087 from cgwalters/kola-prune-cl
kola/tests: disable additional clustered tests on qemu-unpriv
Merge pull request coreos#1090 from arithx/disable_tests_on_unpriv
Merge pull request coreos#1088 from arithx/unpriv_readme
Merge pull request coreos#1067 from jcajka/ppc64le
Stephen Milner (1):
Merge pull request coreos#1070 from ashcrow/kola-crio-restart-test
Steve Milner (1):
kola/tests/crio/crio: Add pods and service restart test
```
Fixes BZ #1796632. GCP is picky about the tarball contents. They must: - be in a tarball with gzip compression - use the Old GNU format - be sized correctly - members must be sized right With the new method of generating qemu variant images, CLI tar commands were replaced with pythonic methods; this produces invalid tarballs from GCP's perspective. To support GCP, the method of tarball creation is reverted to using the CLI.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, darkmuggle The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This bump brings in the change to the default kernel cmdline to use `ip=dhcp,dhcp6`, which is required for proper bootstrapping of RHCOS in an IPv6 environment. (See BZ#1793591) This also brings in the RHEL 8.1.1 content and a fix for properly generating GCP images (coreos/coreos-assembler#1088). [0] https://bugzilla.redhat.com/show_bug.cgi?id=1793591 Signed-off-by: Micah Abbott <[email protected]>
README: update qemu-unpriv notes
GCP is picky about the tarball contents. They must:
With the new method of generating qemu variant images, CLI tar commands
were replaced with pythonic methods; this produces invalid tarballs from
GCP's perspective. To support GCP, the method of tarball creation is
reverted to using the CLI.