summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-08-17 10:06:37 +0100
committerMartin Blanchard <martin.blanchard@codethink.co.uk>2018-09-07 13:57:29 +0100
commit7306a9545c3800109ac8dfcf510d2b3f0224d280 (patch)
treef5a6800c51bc0a490284c19012a7d928cc66099b
parente7659c298ee0a251cacb3689cd7fd951ecbea219 (diff)
downloadbuildstream-7306a9545c3800109ac8dfcf510d2b3f0224d280.tar.gz
Add "remote-execution" project configuration option
This just adds one option, "remote-execution/url". Affects multiple files. https://gitlab.com/BuildStream/buildstream/issues/454
-rw-r--r--buildstream/_project.py8
-rw-r--r--buildstream/data/projectconfig.yaml3
-rw-r--r--buildstream/element.py6
3 files changed, 16 insertions, 1 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index 2f8ae69fb..f0ca3d71b 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -128,6 +128,7 @@ class Project():
self._shell_host_files = [] # A list of HostMount objects
self.artifact_cache_specs = None
+ self.remote_execution_url = None
self._sandbox = None
self._splits = None
@@ -471,7 +472,7 @@ class Project():
'aliases', 'name',
'artifacts', 'options',
'fail-on-overlap', 'shell', 'fatal-warnings',
- 'ref-storage', 'sandbox', 'mirrors'
+ 'ref-storage', 'sandbox', 'mirrors', 'remote-execution'
])
#
@@ -482,6 +483,11 @@ class Project():
# Load artifacts pull/push configuration for this project
self.artifact_cache_specs = ArtifactCache.specs_from_config_node(config, self.directory)
+ # Load remote-execution configuration for this project
+ remote_execution = _yaml.node_get(config, Mapping, 'remote-execution')
+ _yaml.node_validate(remote_execution, ['url'])
+ self.remote_execution_url = _yaml.node_get(remote_execution, str, 'url')
+
# Load sandbox environment variables
self.base_environment = _yaml.node_get(config, Mapping, 'environment')
self.base_env_nocache = _yaml.node_get(config, list, 'environment-nocache')
diff --git a/buildstream/data/projectconfig.yaml b/buildstream/data/projectconfig.yaml
index c1ad2d147..1da67a530 100644
--- a/buildstream/data/projectconfig.yaml
+++ b/buildstream/data/projectconfig.yaml
@@ -204,3 +204,6 @@ shell:
# Command to run when `bst shell` does not provide a command
#
command: [ 'sh', '-i' ]
+
+remote-execution:
+ url: "" \ No newline at end of file
diff --git a/buildstream/element.py b/buildstream/element.py
index ae8e10144..9bdfaaabf 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -250,6 +250,12 @@ class Element(Plugin):
# Extract Sandbox config
self.__sandbox_config = self.__extract_sandbox_config(meta)
+ # Extract remote execution URL
+ if not self.__is_junction:
+ self.__remote_execution_url = project.remote_execution_url
+ else:
+ self.__remote_execution_url = None
+
def __lt__(self, other):
return self.name < other.name