Skip to content

Commit e468aea

Browse files
abderrahimjuergbi
authored andcommitted
_sandboxremote.py: Upload blobs for subsandbox roots
The subsandboxes can be used to extract a CAS digest that could be used for nested remote execution, and thus need to be available in the remote execution CAS.
1 parent a291951 commit e468aea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/buildstream/sandbox/_sandboxremote.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,17 @@ def _execute_action(self, action, flags):
174174
"Uploading input root", element_name=self._get_element_name()
175175
):
176176
# Determine blobs missing on remote
177+
root_digests = [action.input_root_digest]
178+
179+
# Add virtual directories for subsandboxes
180+
for subsandbox in self._get_subsandboxes():
181+
vdir = subsandbox.get_virtual_directory()
182+
root_digests.append(vdir._get_digest())
183+
184+
missing_blobs = []
177185
try:
178-
input_root_digest = action.input_root_digest
179-
missing_blobs = list(cascache.missing_blobs_for_directory(input_root_digest, remote=casremote))
186+
for root_digest in root_digests:
187+
missing_blobs.extend(cascache.missing_blobs_for_directory(root_digest, remote=casremote))
180188
except grpc.RpcError as e:
181189
raise SandboxError("Failed to determine missing blobs: {}".format(e)) from e
182190

0 commit comments

Comments
 (0)