bacalhau-project / bacalhau

Compute over Data framework for public, transparent, and optionally verifiable computation
https://docs.bacalhau.org
Apache License 2.0
643 stars 85 forks source link

Figure out the right behaviour for update checker #3980

Open wdbaruni opened 2 months ago

wdbaruni commented 2 months ago

Related to https://github.com/bacalhau-project/bacalhau/pull/3775, we need to understand the purpose of the update checker better. Is it to tell that the client is outdated compared to the orchestrator's version? or outdated compared to latest releases from bacalhau?

As a user, I might expect the following:

  1. If I am running a compute node, I would like the cli to compare my version with the orchestrator's version. I don't want the cli to ask me to update to a version that is beyond the orchestrator's
  2. If I am running client commands, such as bacalhau job run, I would like the cli to also compare my version with the orchestrator's
  3. If I a m running an orchestrator node, then I would like the cli to compare my version with the latest release from bacalhau

@frrist also has a valid point of view:

I'd propose we reduce the responsibility of the UpdateChecker to only retrieve the latest version of bacalhau from the update server. This will remove the dependency on a bacalhau client - and thus authentication - from the UpdateChecker service - which will fix this bug.

The UpdateChecker may then persist the value it retrieves from the update server to some "system configuration field" (will be very easy to do when #3959 lands). From there we can make the following changes:

  1. Clients and Compute nodes can compare their version, the orchestrator's version, and the latest version notifying accordingly in stderr or log messages.
  2. Orchestrator nodes can compare their version with the latest version notifying accordingly in log messages.

Alternatively, and this would be my preference:

  1. Only Servers (Compute and Requester Nodes) use the update checker (as we already do now) to retrieve the latest version. If they are behind it they produce a log message stating so.
  2. Clients are only notified when the server they are communicating with is on a version different than theirs. Clients commands do not run the UpdateChecked. In this flow, clients are only notified they need to update when their server operator updates.

This requires feedback from product @aronchick @MichaelHoepler