Skip to content

Commit 3a85af8

Browse files
feat(updates): bridge Fleet API to host updater
1 parent 31fee22 commit 3a85af8

14 files changed

Lines changed: 1294 additions & 72 deletions

File tree

client/src/protoFleet/api/generated/instance/v1/updates_pb.ts

Lines changed: 221 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/instance/v1/updates.proto

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ service InstanceUpdateService {
1414
// SetReleaseChannel switches the instance between Stable and Stable + RC.
1515
// Gated by instance:update.
1616
rpc SetReleaseChannel(SetReleaseChannelRequest) returns (SetReleaseChannelResponse);
17+
18+
// TriggerUpgrade asks the host updater to install the exact release that
19+
// GetUpdateStatus currently offers. Gated by instance:update.
20+
rpc TriggerUpgrade(TriggerUpgradeRequest) returns (TriggerUpgradeResponse);
21+
22+
// GetUpgradeStatus reports durable host-side progress across fleetd
23+
// restarts. Gated by instance:update.
24+
rpc GetUpgradeStatus(GetUpgradeStatusRequest) returns (GetUpgradeStatusResponse) {
25+
option idempotency_level = NO_SIDE_EFFECTS;
26+
}
1727
}
1828

1929
enum ReleaseChannel {
@@ -22,6 +32,18 @@ enum ReleaseChannel {
2232
RELEASE_CHANNEL_STABLE_AND_RC = 2;
2333
}
2434

35+
enum UpgradePhase {
36+
UPGRADE_PHASE_UNSPECIFIED = 0;
37+
UPGRADE_PHASE_QUEUED = 1;
38+
UPGRADE_PHASE_DOWNLOADING = 2;
39+
UPGRADE_PHASE_VERIFYING = 3;
40+
UPGRADE_PHASE_STAGING = 4;
41+
UPGRADE_PHASE_PREFLIGHT = 5;
42+
UPGRADE_PHASE_ACTIVATING = 6;
43+
UPGRADE_PHASE_SUCCEEDED = 7;
44+
UPGRADE_PHASE_FAILED = 8;
45+
}
46+
2547
message ReleaseInfo {
2648
string version = 1;
2749
string release_notes_url = 2;
@@ -40,6 +62,9 @@ message GetUpdateStatusResponse {
4062
// Full copy-paste installer invocation for latest_eligible; empty when
4163
// update_available is false.
4264
string install_command = 5;
65+
// True only when the independently installed host executor is reachable.
66+
// False keeps the copy-command fallback visible.
67+
bool one_click_available = 6;
4368
// False until release discovery succeeds and after its latest list fetch
4469
// fails. Callers must not interpret update_available=false as up to date
4570
// while status is unavailable.
@@ -51,3 +76,31 @@ message SetReleaseChannelRequest {
5176
}
5277

5378
message SetReleaseChannelResponse {}
79+
80+
message UpgradeOperation {
81+
string id = 1;
82+
string target_version = 2;
83+
UpgradePhase phase = 3;
84+
string message = 4;
85+
google.protobuf.Timestamp started_at = 5;
86+
google.protobuf.Timestamp updated_at = 6;
87+
google.protobuf.Timestamp completed_at = 7;
88+
string error = 8;
89+
string recovery_command = 9;
90+
string host_log_path = 10;
91+
}
92+
93+
message TriggerUpgradeRequest {
94+
string target_version = 1;
95+
}
96+
97+
message TriggerUpgradeResponse {
98+
UpgradeOperation operation = 1;
99+
}
100+
101+
message GetUpgradeStatusRequest {}
102+
103+
message GetUpgradeStatusResponse {
104+
bool executor_available = 1;
105+
UpgradeOperation operation = 2;
106+
}

server/cmd/fleetd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ func start(config *Config) error {
613613
// answers version/status calls, reading the zero snapshot as "no offer".
614614
releaseChecker := updatesDomain.NewChecker(config.Updates, version)
615615
updatesSvc := updatesDomain.NewService(config.Updates, version, releaseChecker,
616-
db.NewFailoverResettingQuerier(db.NewRetryDB(conn)))
616+
db.NewFailoverResettingQuerier(db.NewRetryDB(conn)), activitySvc)
617617

618618
middlewares := []server.Middleware{
619619
middleware.NewCORSMiddleware(config.HTTP.SuppressCors),

0 commit comments

Comments
 (0)