summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-06-17 11:23:10 +0100
committerJürg Billeter <j@bitron.ch>2019-07-11 17:52:34 +0200
commitd05710f79e129660a5383f5a8854960eac9a2d28 (patch)
tree59b275d3ac6239ed94ce8560f8e868244805fb80
parent2a26d8a7020644fe95929aa5fc142ca2977cee03 (diff)
downloadbuildstream-d05710f79e129660a5383f5a8854960eac9a2d28.tar.gz
Add pull-artifact-files configuration option for remote execution
This decides whether to fetch the file blobs of remote execution built artifacts. Part of #1043
-rw-r--r--src/buildstream/_context.py16
-rw-r--r--src/buildstream/_stream.py8
2 files changed, 21 insertions, 3 deletions
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index 52e4c3db9..2bdf5b0b4 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -129,6 +129,9 @@ class Context():
# Whether or not to attempt to pull build trees globally
self.pull_buildtrees = None
+ # Whether to pull the files of an artifact when doing remote execution
+ self.pull_artifact_files = None
+
# Whether or not to cache build trees on artifact creation
self.cache_buildtrees = None
@@ -258,6 +261,19 @@ class Context():
# Load source cache config
self.source_cache_specs = SourceCache.specs_from_config_node(defaults)
+ # Load remote execution config getting pull-artifact-files from it
+ remote_execution = _yaml.node_get(defaults, dict, 'remote-execution', default_value=None)
+ if remote_execution:
+ self.pull_artifact_files = _yaml.node_get(
+ remote_execution, bool, 'pull-artifact-files', default_value=True)
+ # This stops it being used in the remote service set up
+ _yaml.node_del(remote_execution, 'pull-artifact-files', safe=True)
+ # Don't pass the remote execution settings if that was the only option
+ if _yaml.node_keys(remote_execution) == []:
+ _yaml.node_del(defaults, 'remote-execution')
+ else:
+ self.pull_artifact_files = True
+
self.remote_execution_specs = SandboxRemote.specs_from_config_node(defaults)
# Load pull build trees configuration
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 9a400933c..705e0a5d3 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -273,9 +273,11 @@ class Stream():
# Require artifact files only for target elements and their runtime dependencies.
self._context.set_artifact_files_optional()
- scope = Scope.ALL if build_all else Scope.RUN
- for element in self.targets:
- element._set_artifact_files_required(scope=scope)
+ # fetch blobs of targets if options set
+ if self._context.pull_artifact_files:
+ scope = Scope.ALL if build_all else Scope.RUN
+ for element in self.targets:
+ element._set_artifact_files_required(scope=scope)
# Now construct the queues
#