Jim MacArthur pushed to branch jmac/remote_exec_checkout_fix at BuildStream / buildstream
Commits:
2 changed files:
Changes:
| ... | ... | @@ -348,19 +348,29 @@ class CASCache(ArtifactCache): |
| 348 | 348 |
return pushed
|
| 349 | 349 |
|
| 350 | 350 |
def push_directory(self, project, directory):
|
| 351 |
+ """ Push the given virtual directory to all remotes.
|
|
| 352 |
+ |
|
| 353 |
+ Args:
|
|
| 354 |
+ project (Project): The current project
|
|
| 355 |
+ directory (Directory): A virtual directory object to push.
|
|
| 356 |
+ |
|
| 357 |
+ Raises: ArtifactError if no push remotes are configured.
|
|
| 358 |
+ """
|
|
| 351 | 359 |
|
| 352 | 360 |
push_remotes = [r for r in self._remotes[project] if r.spec.push]
|
| 353 | 361 |
|
| 362 |
+ if not push_remotes:
|
|
| 363 |
+ raise ArtifactError("CASCache: push_directory was called, but no remote artifact "+
|
|
| 364 |
+ "servers are configured as push remotes.")
|
|
| 365 |
+ |
|
| 354 | 366 |
if directory.ref is None:
|
| 355 |
- return None
|
|
| 367 |
+ return
|
|
| 356 | 368 |
|
| 357 | 369 |
for remote in push_remotes:
|
| 358 | 370 |
remote.init()
|
| 359 | 371 |
|
| 360 | 372 |
self._send_directory(remote, directory.ref)
|
| 361 | 373 |
|
| 362 |
- return directory.ref
|
|
| 363 |
- |
|
| 364 | 374 |
def push_message(self, project, message):
|
| 365 | 375 |
|
| 366 | 376 |
push_remotes = [r for r in self._remotes[project] if r.spec.push]
|
| ... | ... | @@ -173,8 +173,8 @@ class SandboxRemote(Sandbox): |
| 173 | 173 |
platform = Platform.get_platform()
|
| 174 | 174 |
cascache = platform.artifactcache
|
| 175 | 175 |
# Now, push that key (without necessarily needing a ref) to the remote.
|
| 176 |
- vdir_digest = cascache.push_directory(self._get_project(), upload_vdir)
|
|
| 177 |
- if not vdir_digest or not cascache.verify_digest_pushed(self._get_project(), vdir_digest):
|
|
| 176 |
+ cascache.push_directory(self._get_project(), upload_vdir)
|
|
| 177 |
+ if not cascache.verify_digest_pushed(self._get_project(), upload_vdir.ref):
|
|
| 178 | 178 |
raise SandboxError("Failed to verify that source has been pushed to the remote artifact cache.")
|
| 179 | 179 |
|
| 180 | 180 |
# Set up environment and working directory
|
