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

Mac PM test: Require pre-installed rosetta #22773

Merged

Conversation

cevich
Copy link
Member

@cevich cevich commented May 21, 2024

Previously, the mac podman-machine tests installed rosetta before
executing any tests. As a best-practice (and because the Macs in CI are
shared) tests should never permanently modify the system. As of this
commit, the system setup script used for the CI Macs does the rosetta
installation. Remove the test setup code that installed rosetta and
add a CI-level confirmation that it's been pre-installed.

Ref:

TODO:

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none labels May 21, 2024
Comment on lines 73 to 78
if testProvider.VMType() == define.AppleHvVirt {
cmd := exec.Command("softwareupdate", "--install-rosetta", "--agree-to-license")
cmd := exec.Command("arch", "-arch", "x86_64", "/usr/bin/uname", "-m")
err := cmd.Run()
if err != nil {
Fail(fmt.Sprintf("Command failed with error: %q", err))
Fail(fmt.Sprintf("Rosetta doesn't appear to be installed or functional, 'uname' test command failed with error: %q", err))
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we should move this into the cirrus setup scripts and not the test suite itself

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm concerned if somebody ever wants to run the tests locally, outside of CI, then they'll simply fail. These failures may be very obscure (I have yet to test this) as the actual binary could be executing inside a VM or inside a container inside a VM (I'm really not sure how these tests work).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not opposed to adding the check in both places, since failing slightly earlier has a chance of speeding development activities.

Copy link
Member

Choose a reason for hiding this comment

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

This check only makes sense for the rosetta tests, I don't think it should fail all other tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please correct me if I'm wrong, but don't the rosetta and non-rosetta tests all run as one ginkgo "batch"?

Either way, I'm really not a golang or code base expert, so don't feel comfortable making more precise/targeted changes. Maybe this part could be done as a followup PR?

Copy link
Member

Choose a reason for hiding this comment

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

Just like any sane test framework you can run tests individually which I do locally.

I really don't see the point of such check, it is not like the tests validate other dependencies either and if rosetta test fails it is likely easy enough to figure

Copy link
Member Author

@cevich cevich May 22, 2024

Choose a reason for hiding this comment

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

Okay, point taken. I'll make a half-hearted attempt to remove the install code, but no guarantees. It may need to be done as a followup.

Edit: By my read, it seems like I can simply remove the installation code from the test.

@cevich cevich force-pushed the use_preinstalled_rosetta branch 3 times, most recently from c557d42 to 29cccf0 Compare May 21, 2024 20:41
@cevich cevich changed the title [CI:MACHINE] Mac PM test: Fail when rosetta missing [CI:MACHINE] Mac PM test: Require pre-installed rosetta May 22, 2024
@cevich cevich force-pushed the use_preinstalled_rosetta branch 2 times, most recently from 679bd13 to 670e93a Compare May 22, 2024 15:05
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

changes LGTM
I assume we need to wait until the change is propagated to all worker machines?

@cevich
Copy link
Member Author

cevich commented May 22, 2024

I assume we need to wait until the change is propagated to all worker machines?

You've spotted it exactly, I was just about to add a comment why this PR is still marked as draft 😀

Edit/note to me: All workers should have been recycled w/ necessary (new) setup by 2024-05-23T11:00:00 UTC

@cevich cevich changed the title [CI:MACHINE] Mac PM test: Require pre-installed rosetta Mac PM test: Require pre-installed rosetta May 22, 2024
Previously, the mac podman-machine tests installed rosetta before
executing any tests.  As a best-practice (and because the Macs in CI are
shared) tests should never permanently modify the system.  As of this
commit, the system setup script used for the CI Macs does the rosetta
installation.  Remove the test setup code that installed rosetta and
add a CI-level confirmation that it's been pre-installed.

Signed-off-by: Chris Evich <[email protected]>
@cevich cevich force-pushed the use_preinstalled_rosetta branch from 670e93a to 74e8f98 Compare May 23, 2024 14:23
@cevich cevich marked this pull request as ready for review May 23, 2024 14:23
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 23, 2024
@cevich
Copy link
Member Author

cevich commented May 28, 2024

@mheon @edsantiago PTAL when you get a chance, this should be ready to go.

@mheon
Copy link
Member

mheon commented May 28, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 28, 2024
@cevich
Copy link
Member Author

cevich commented May 28, 2024

Looks like this needs an approval also.

@Luap99
Copy link
Member

Luap99 commented May 28, 2024

/approval

@Luap99
Copy link
Member

Luap99 commented May 28, 2024

/approve

Copy link
Contributor

openshift-ci bot commented May 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 28, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 3fb70d3 into containers:main May 28, 2024
89 checks passed
@cevich
Copy link
Member Author

cevich commented Jun 3, 2024

/cherrypick v5.1

@openshift-cherrypick-robot
Copy link
Collaborator

@cevich: new pull request created: #22889

In response to this:

/cherrypick v5.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 2, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants