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

Fix checksum for SAS3IRCU resources to use 64 bits #383

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

gabrielcocenza
Copy link
Member

@gabrielcocenza gabrielcocenza commented Jan 8, 2025

  • resources were using the checksum for 32 bits

How to test it:

Fix: #324

- resources were using the checksum for 32 bits

Fix: canonical#324
Copy link
Contributor

@chanchiwai-ray chanchiwai-ray left a comment

Choose a reason for hiding this comment

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

Need to double check P11

Copy link

@Vultaire Vultaire left a comment

Choose a reason for hiding this comment

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

Some bits of feedback are for lines outside of the diff, i.e. additional changes which are needed, so I'll provide my overall advice here:

  1. While the changes to the sas3ircu version info data seem likely correct (I haven't actually checked checksums myself; I'm assuming this), I do have a concern over whether deployed hardware observer units with attached sas3ircu resources will continue working (without rechecking the resource), or whether upgrading the charm might break them. The data structures are for Architecture.X86_64 so clearly they should be pointing at the 64-bit binaries, so that correction is the right thing to do - but, we should be careful to avoid breaking existing deployments unless absolutely necessary.
  2. While I think the bug I rose was for sas3ircu, I think the same applies to sas2ircu. Those are also broadcom binaries and I think they also have x86 and x86-64 versions. We should also correct those, so that if someone pulls the 64-bit binaries and tries to attach them, they should be accepted by the charm.

Marking as "request changes" because the bug also appears to apply to sas2ircu, and I'd like to see that fixed as well.

@jneo8
Copy link
Contributor

jneo8 commented Jan 15, 2025

Some bits of feedback are for lines outside of the diff, i.e. additional changes which are needed, so I'll provide my overall advice here:

  1. While the changes to the sas3ircu version info data seem likely correct (I haven't actually checked checksums myself; I'm assuming this), I do have a concern over whether deployed hardware observer units with attached sas3ircu resources will continue working (without rechecking the resource), or whether upgrading the charm might break them. The data structures are for Architecture.X86_64 so clearly they should be pointing at the 64-bit binaries, so that correction is the right thing to do - but, we should be careful to avoid breaking existing deployments unless absolutely necessary.
  2. While I think the bug I rose was for sas3ircu, I think the same applies to sas2ircu. Those are also broadcom binaries and I think they also have x86 and x86-64 versions. We should also correct those, so that if someone pulls the 64-bit binaries and tries to attach them, they should be accepted by the charm.

Marking as "request changes" because the bug also appears to apply to sas2ircu, and I'd like to see that fixed as well.

Hi Paul,

Thank you for sharing your thoughtful insights on the proposed change. I’d like to provide some feedback as well.

For Point 1:
In the hw-observer's lifecycle, the checksum only runs when the HWToolHelper.install method is executed. This is triggered during Juju's install or upgrade events (reference).

As a result, if any hw-observer unit is deployed with an incorrect resource, it will enter a blocked status once the Juju application revision, including this patch, is applyed. On the other hand, if the resource is correct, it will pass the check as expected.

The blocked status error message will be: Fail strategy checks: sas3ircu.

For Point 2:
I agree with your perspective. However, I also believe it would be beneficial to make the PR changes more atomic. Splitting the changes into separate PRs and issues would likely be a more effective approach.

@jneo8
Copy link
Contributor

jneo8 commented Jan 16, 2025

Based on information from @Pjack, this checksum 7fa299a36254c582cf579d197463d6e59ffa9270b7241d98d0e477f05235be26 works for both architectures, which explains why we didn’t initially notice the mismatch.

Hi @Vultaire,

I understand your approach to supporting backward compatibility, and we could achieve this in a somewhat tricky way. Specifically, by adding another ToolVersionInfo entry for SAS3IRCU with the checksum 7fa299a36254c582cf579d197463d6e59ffa9270b7241d98d0e477f05235be26, and defining it to support both x86 and x64.

However, I personally prefer asking users to attach the correct version of the tool as specified by the official documentation, if backward compatibility will not cause critical issue on production. This approach seems cleaner and aligns better with the intended usage.

@Pjack
Copy link

Pjack commented Jan 16, 2025

@gabrielcocenza Could you also handle the sas2 case? I am okay to patch it within the same PR or different PR. It's a small change. Thanks!

@gabrielcocenza
Copy link
Member Author

@Pjack @Vultaire I took a look at sas2 from version 20 to 16 and on all cases we have just two linux folders:

  • sas2ircu_linux_ppc64_rel
  • sas2ircu_linux_x86_rel

image

So there is no arm64 and the amd version apparently is for both 32 and 64 bits, so there is no need to change the checksum 👍

Copy link

@Vultaire Vultaire left a comment

Choose a reason for hiding this comment

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

Thanks for your feedback and investigating the sas2ircu issue as well.

I downloaded and did a quick check of the sas3ircu binaries' sha256sums; I believe this is correct. And based upon the description of what happens for existing deployments, I'm +1. Approved.

@gabrielcocenza gabrielcocenza merged commit 7980092 into canonical:main Jan 21, 2025
10 checks passed
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.

Checksums: no 64-bit x86 checksum for the P16 version, 32-bit checksum inserted by mistake
5 participants