Skip to content
Snippets Groups Projects
Commit a770759e authored by Jim MacArthur's avatar Jim MacArthur
Browse files

Add "remote-execution" project configuration option.

This just adds one option, "remote-execution/url". Affects multiple files.
parent a41224b2
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,7 @@ class Project():
self.artifact_cache_specs = None
self._sandbox = None
self._remote_execution = None
self._splits = None
self._context.add_project(self)
......@@ -460,7 +461,7 @@ class Project():
'aliases', 'name',
'artifacts', 'options',
'fail-on-overlap', 'shell', 'fatal-warnings',
'ref-storage', 'sandbox', 'mirrors'
'ref-storage', 'sandbox', 'mirrors', 'remote-execution'
])
#
......@@ -478,6 +479,9 @@ class Project():
# Load sandbox configuration
self._sandbox = _yaml.node_get(config, Mapping, 'sandbox')
# Load remote execution configuration
self._remote_execution = _yaml.node_get(config, Mapping, 'remote-execution')
# Load project split rules
self._splits = _yaml.node_get(config, Mapping, 'split-rules')
......
......@@ -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
......@@ -250,6 +250,9 @@ class Element(Plugin):
# Extract Sandbox config
self.__sandbox_config = self.__extract_sandbox_config(meta)
# Extract remote execution URL
self.__remote_execution_url = self.__extract_remote_execution_config(meta)
def __lt__(self, other):
return self.name < other.name
......@@ -2289,6 +2292,18 @@ class Element(Plugin):
return SandboxConfig(self.node_get_member(sandbox_config, int, 'build-uid'),
self.node_get_member(sandbox_config, int, 'build-gid'))
def __extract_remote_execution_config(self, meta):
if self.__is_junction:
return ''
else:
project = self._get_project()
project.ensure_fully_loaded()
if project._remote_execution:
rexec_config = _yaml.node_chain_copy(project._remote_execution)
return self.node_get_member(rexec_config, str, 'url')
else:
return ''
# This makes a special exception for the split rules, which
# elements may extend but whos defaults are defined in the project.
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment