[Notes] [Git][BuildStream/buildstream][jmac/remote_execution_client] 5 commits: Configuration: Add default remote-execution and allow it in elements



Title: GitLab

Jim MacArthur pushed to branch jmac/remote_execution_client at BuildStream / buildstream

Commits:

4 changed files:

Changes:

  • buildstream/_loader/loadelement.py
    ... ... @@ -70,7 +70,7 @@ class LoadElement():
    70 70
             _yaml.node_validate(self.node, [
    
    71 71
                 'kind', 'depends', 'sources', 'sandbox',
    
    72 72
                 'variables', 'environment', 'environment-nocache',
    
    73
    -            'config', 'public', 'description',
    
    73
    +            'config', 'public', 'description', 'remote-execution'
    
    74 74
             ])
    
    75 75
     
    
    76 76
             # Extract the Dependencies
    

  • buildstream/data/projectconfig.yaml
    ... ... @@ -208,3 +208,6 @@ shell:
    208 208
       # Command to run when `bst shell` does not provide a command
    
    209 209
       #
    
    210 210
       command: [ 'sh', '-i' ]
    
    211
    +
    
    212
    +remote-execution:
    
    213
    +  url: ""
    \ No newline at end of file

  • buildstream/element.py
    ... ... @@ -2126,7 +2126,7 @@ class Element(Plugin):
    2126 2126
             project = self._get_project()
    
    2127 2127
             platform = Platform.get_platform()
    
    2128 2128
     
    
    2129
    -        if self.__remote_execution_url is not None and self.BST_VIRTUAL_DIRECTORY:
    
    2129
    +        if self.__remote_execution_url and self.BST_VIRTUAL_DIRECTORY:
    
    2130 2130
                 if not self.__artifacts.has_push_remotes(element=self):
    
    2131 2131
                     # Give an early warning if remote execution will not work
    
    2132 2132
                     raise ElementError("Artifact {} is configured to use remote execution but has no push remotes. "
    

  • buildstream/sandbox/_sandboxremote.py
    ... ... @@ -54,7 +54,7 @@ class SandboxRemote(Sandbox):
    54 54
             if m is None:
    
    55 55
                 raise SandboxError("Configured remote URL '{}' does not match the expected layout. " +
    
    56 56
                                    "It should be of the form <protocol>://<domain name>:<port>."
    
    57
    -                               .format(server_url))
    
    57
    +                               .format(self.server_url))
    
    58 58
     
    
    59 59
     
    
    60 60
         def _get_cascache(self):
    
    ... ... @@ -107,13 +107,15 @@ class SandboxRemote(Sandbox):
    107 107
                                                           action_digest=action_digest,
    
    108 108
                                                           skip_cache_lookup=True)
    
    109 109
     
    
    110
    +
    
    110 111
             operation_iterator = stub.Execute(request)
    
    111
    -        if operation_iterator.code() != grpc.StatusCode.OK:
    
    112
    -            raise SandboxError("GRPC Execute failed; is the remote system connected?")
    
    113
    -        for operation in operation_iterator:
    
    114
    -            if operation.done:
    
    115
    -                break
    
    116
    -            # TODO: Do we need a sleep here?
    
    112
    +        with self._get_context().timed_activity("Waiting for the remote build to complete"):
    
    113
    +            # It is advantageous to check operation_iterator.code() is grpc.StatusCode.OK here,
    
    114
    +            # which will check the server is actually contactable. However, calling it when the
    
    115
    +            # server is available seems to cause .code() to hang forever.
    
    116
    +            for operation in operation_iterator:
    
    117
    +                if operation.done:
    
    118
    +                    break
    
    117 119
             return operation
    
    118 120
     
    
    119 121
         def process_job_output(self, output_directories, output_files):
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]