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

OCPBUGS-38450: Fix copy artifacts for all CPU architectures #1855

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rwsu
Copy link
Contributor

@rwsu rwsu commented Aug 27, 2024

The "oc adm node-image create" command currently expects the filename to be node.x86_64.iso which doesn't work for non x86_64 architectures. Updated RsyncOptions to copy any iso file to include files for any CPU architecture.

Authored by @andfasano

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 27, 2024
@openshift-ci-robot
Copy link

@rwsu: This pull request references Jira Issue OCPBUGS-38450, which is invalid:

  • expected the bug to target the "4.18.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

The "adm node-image create" command should read the correct node ISO file generated by node-joiner. The filename depends the CPU archtecture set in nodes-config.yaml. Currently it expects the filename to be node.x86_64.iso irrespective of the architecture.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2024
pkg/cli/admin/nodeimage/create.go Outdated Show resolved Hide resolved
pkg/cli/admin/nodeimage/create.go Outdated Show resolved Hide resolved
pkg/cli/admin/nodeimage/create.go Show resolved Hide resolved
@rwsu rwsu changed the title OCPBUGS-38450: Use correct filename depending on CPU architecture OCPBUGS-38450: Fix copy artifacts for all CPU architectures Aug 31, 2024
@rwsu
Copy link
Contributor Author

rwsu commented Sep 3, 2024

/retest-required

@pawanpinjarkar
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2024
@rwsu
Copy link
Contributor Author

rwsu commented Sep 5, 2024

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 5, 2024
@openshift-ci-robot
Copy link

@rwsu: This pull request references Jira Issue OCPBUGS-38450, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.18.0) matches configured target version for branch (4.18.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @mhanss

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from mhanss September 5, 2024 16:18
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b904f99 and 2 for PR HEAD 654d87c in total

@rwsu
Copy link
Contributor Author

rwsu commented Sep 5, 2024

/retest-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 75c6f19 and 1 for PR HEAD 654d87c in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 4ff8602 and 0 for PR HEAD 654d87c in total

@openshift-ci-robot
Copy link

/hold

Revision 654d87c was retested 3 times: holding

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed lgtm Indicates that a PR is ready to be merged. labels Sep 6, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 10, 2024
Currently it expects the filename to be node.x86_64.iso
which doesn't work for non X86 architectures. Updated
RsyncOptions to copy any iso file to include files for
any CPU architecture.

Authored by Andrea Fasano <afasano@redhat.com>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 10, 2024
@rwsu
Copy link
Contributor Author

rwsu commented Sep 11, 2024

/retest-required

@rwsu
Copy link
Contributor Author

rwsu commented Sep 11, 2024

/test e2e-aws-ovn-serial

if o.OutputName == "" {
return nil
}
// AssetDir doesn't exist in unit test fake filesystem
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// AssetDir doesn't exist in unit test fake filesystem
// AssetDir doesn't exist in unit test fake filesystem

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see a difference here.

Copy link
Contributor

Choose a reason for hiding this comment

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

My suggestion was to remove the comment, given that it's related to a test

newPath := filepath.Join(filepath.Dir(path), o.OutputName)

// Check if another file has the same name
if _, err := os.Stat(newPath); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since newPath is invariant, couldn't be moved out this check before starting looking in the folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would assume the ISO isn't written to a subdirectory under o.AssetDir. Which is the case now. But by not assuming it is invariant, makes it less coupled to the node-joiner implementation.

pkg/cli/admin/nodeimage/create.go Show resolved Hide resolved
}
}

err = filepath.Walk(o.AssetsDir, func(path string, info os.FileInfo, err error) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if in this case using os.ReadDir could lead to a simpler implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried os.ReadDir. It is pretty much the same.

Updated unit-test to change the assertion on output filename to
assertion on the destination path.

Previously the filename was asserted against the RSyncOptions's
Destination field which contained the target filename and path.

Now the Destination field is a directory path. Because fs.FS
doesn't support write operations we cannot fake writing or renaming
the output file, which also blocks asserting the final output name
and path.
@rwsu
Copy link
Contributor Author

rwsu commented Sep 13, 2024

/retest-required

1 similar comment
@rwsu
Copy link
Contributor Author

rwsu commented Sep 16, 2024

/retest-required

Copy link
Contributor

openshift-ci bot commented Sep 17, 2024

@rwsu: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

if err != nil {
if os.IsNotExist(err) {
return nil
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

For code readability, I'd prefer to use more happy path here

@andfasano
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2024
Copy link
Contributor

openshift-ci bot commented Sep 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andfasano, pawanpinjarkar, rwsu

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

@rwsu
Copy link
Contributor Author

rwsu commented Sep 18, 2024

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants