Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/orchestrator/orchestrator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ message SandboxPauseRequest {
}

message SchedulingMetadata {
// base_build_id is the root layer (shared across the template's sandboxes);
// build_id is the final/current layer. Both also appear in the lists below.
string base_build_id = 1;
// memfile_base_build_id / rootfs_base_build_id are each artifact's root layer
// (shared across the template's sandboxes); they can differ. build_id is the
// final/current layer. All also appear in the lists below.
string memfile_base_build_id = 1;
Comment thread
ValentaTomas marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep tag 1 as base_build_id

Changing field 1 from base_build_id to memfile_base_build_id makes SchedulingMetadata incompatible for clients that use proto JSON/text names or generated APIs during a rolling upgrade: older consumers still expect base_build_id, while regenerated consumers lose GetBaseBuildId entirely. Since this is a response type shared across services, preserve the existing tag/name as a deprecated compatibility field and add the artifact-specific base IDs on new tags instead of reusing tag 1 with a new semantic name.

Useful? React with 👍 / 👎.

string build_id = 2;
// Deduplicated build IDs whose data each artifact references (all ancestor
// layers plus the build itself). Sorted; order is not significant. When a
Expand All @@ -144,6 +145,7 @@ message SchedulingMetadata {
// new memfile layer's bytes are a pre-dedup, block-granular upper bound.
repeated uint64 memfile_build_bytes = 7;
repeated uint64 rootfs_build_bytes = 8;
string rootfs_base_build_id = 9;
}

message SandboxPauseResponse {
Expand Down
13 changes: 6 additions & 7 deletions packages/orchestrator/pkg/scheduling/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ func FromHeaders(buildID uuid.UUID, memfileHeader, rootfsHeader *header.Header,
return nil
}

base := memfileHeader.Metadata.BaseBuildId
if base == uuid.Nil {
base = rootfsHeader.Metadata.BaseBuildId
}
memfileBase := memfileHeader.Metadata.BaseBuildId
rootfsBase := rootfsHeader.Metadata.BaseBuildId

memIDs, memBytes, memDropped := artifactBuilds(memfileHeader, base, buildID, newMemfileBytes)
rootIDs, rootBytes, rootDropped := artifactBuilds(rootfsHeader, base, buildID, 0)
memIDs, memBytes, memDropped := artifactBuilds(memfileHeader, memfileBase, buildID, newMemfileBytes)
rootIDs, rootBytes, rootDropped := artifactBuilds(rootfsHeader, rootfsBase, buildID, 0)

return &orchestrator.SchedulingMetadata{
BaseBuildId: base.String(),
MemfileBaseBuildId: memfileBase.String(),
RootfsBaseBuildId: rootfsBase.String(),
BuildId: buildID.String(),
MemfileBuildIds: memIDs,
RootfsBuildIds: rootIDs,
Comment thread
ValentaTomas marked this conversation as resolved.
Expand Down
73 changes: 43 additions & 30 deletions packages/shared/pkg/grpc/orchestrator/orchestrator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading