openshift / backplane-tools

Manages the tools needed to interact with clusters
Apache License 2.0
4 stars 28 forks source link

backplane-tools install all command fails on arm64 architectures because of gcloud #68

Open iamkirkbater opened 5 months ago

iamkirkbater commented 5 months ago

The gcloud tool does not seem to have a Darwin arm64 binary available, causing backplane-tools install all to fail.

Ideally I would like to have behavior that allows me to "best-effort" install all tools for my platform - so that any tools without upstream binaries for a given platform would continue to be installed, and the "errors" turn into warnings. Whether this functionality is behind a flag or the default I don't really have any strong opinions on and can see arguments for both directions.

User flow for the "behind a flag" functionality would look like this:

$ backplane-tools install all --best-effort
Installing the following tools:
- oc 4.15.8
- ocm-addons v0.7.17
- butane v0.20.0
- gcloud - ERROR - no suitable binary found for architecture: Darwin/arm64
- ocm 1.21.2
...
- serviceLogger 0.1.1
Warning: failed to locate latest archive matching system spec for 'gcloud': unexpected number of assets found matching system spec: expected at least 1, got 0

$ echo $?
0

Without the flag would emit this:

$ backplane-tools install all --best-effort
Installing the following tools:
- oc 4.15.8
- ocm-addons v0.7.17
- butane v0.20.0
Warning: failed to locate latest archive matching system spec for 'gcloud': unexpected number of assets found matching system spec: expected at least 1, got 0

$ echo $?
1 // or whatever other error status we want here doesn't matter as long as it's non-zero

If only emitting a warning and exiting with a success code becomes the default functionality, I'd like to see a flag that negates the effect so that we'd still have the ability to have deterministic builds if this is used somewhere that would explicitly fail it. So that flow would look like this for success:

$ backplane-tools install all
Installing the following tools:
- oc 4.15.8
- ocm-addons v0.7.17
- butane v0.20.0
- gcloud - ERROR - no suitable binary found for architecture: Darwin/arm64
- ocm 1.21.2
...
- serviceLogger 0.1.1
Warning: failed to locate latest archive matching system spec for 'gcloud': unexpected number of assets found matching system spec: expected at least 1, got 0

$ echo $?
0

And with the flag to explicitly fail the install it would look like this:

$ backplane-tools install all --ensure-all
Installing the following tools:
- oc 4.15.8
- ocm-addons v0.7.17
- butane v0.20.0
Warning: failed to locate latest archive matching system spec for 'gcloud': unexpected number of assets found matching system spec: expected at least 1, got 0

$ echo $?
1 // or whatever other error status we want here doesn't matter as long as it's non-zero

One important caveat is that I believe this functionality to warn should ONLY apply to binaries that can't be found for a specific architecture - if we can't do some of the auxiliary tasks around building the binary like downloading it (if it's found) or creating a new folder for it to live in then that should error out.

a7vicky commented 4 months ago

Address this issue #71

openshift-bot commented 1 month ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 1 week ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale