summaryrefslogtreecommitdiff
path: root/src/buildstream/_remote.py
Commit message (Collapse)AuthorAgeFilesLines
* scheduler.py: Use threads instead of processes for jobsBenjamin Schubert2020-12-041-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes how the scheduler works and adapts all the code that needs adapting in order to be able to run in threads instead of in subprocesses, which helps with Windows support, and will allow some simplifications in the main pipeline. This addresses the following issues: * Fix #810: All CAS calls are now made in the master process, and thus share the same connection to the cas server * Fix #93: We don't start as many child processes anymore, so the risk of starving the machine are way less * Fix #911: We now use `forkserver` for starting processes. We also don't use subprocesses for jobs so we should be starting less subprocesses And the following highlevel changes where made: * cascache.py: Run the CasCacheUsageMonitor in a thread instead of a subprocess. * casdprocessmanager.py: Ensure start and stop of the process are thread safe. * job.py: Run the child in a thread instead of a process, adapt how we stop a thread, since we ca't use signals anymore. * _multiprocessing.py: Not needed anymore, we are not using `fork()`. * scheduler.py: Run the scheduler with a threadpool, to run the child jobs in. Also adapt how our signal handling is done, since we are not receiving signals from our children anymore, and can't kill them the same way. * sandbox: Stop using blocking signals to wait on the process, and use timeouts all the time. * messenger.py: Use a thread-local context for the handler, to allow for multiple parameters in the same process. * _remote.py: Ensure the start of the connection is thread safe * _signal.py: Allow blocking entering in the signal's context managers by setting an event. This is to ensure no thread runs long-running code while we asked the scheduler to pause. This also ensures all the signal handlers is thread safe. * source.py: Change check around saving the source's ref. We are now running in the same process, and thus the ref will already have been changed.
* Return names of grpc errorstraveltissues/grpccodesDarius Makovsky2020-05-111-1/+1
|
* exceptions: Expose ErrorDomain, ErrorLoadReasonThomas Coldrick2020-01-231-1/+2
| | | | | | | Plugin tests are already accessing this API, but using imports from private modules. For motivation for this to be exposed publicly, note that ErrorDomain is an argument for most things in runcli.py, and LoadErrorReason may be another.
* _remote: ignore unused argsDarius Makovsky2019-12-091-1/+1
|
* Reformat code using BlackChandan Singh2019-11-141-32/+34
| | | | | | | As discussed over the mailing list, reformat code using Black. This is a one-off change to reformat all our codebase. Moving forward, we shouldn't expect such blanket reformats. Rather, we expect each change to already comply with the Black formatting style.
* _remote: Ensure checks done in the subclasses are propagatedBenjamin Schubert2019-11-121-3/+3
| | | | | | | | | | | Currently, the `BaseRemote` would call `_check()` on the children, which states that errors should be sent back as a string. However, `BaseRemote` doesn't check the return of `_check()`. This changes the contract so that subclasses throw `RemoteError` themselves. This also fixes the `ArtifactShare` and add a test.
* _remote.py: Expand user in certificates pathsBenjamin Schubert2019-11-111-2/+6
| | | | This ensures we correctly expand "~" in paths to certificates
* _remote.py: Do not use subprocess to check remoteJürg Billeter2019-10-151-37/+6
| | | | This is no longer required as gRPC connections are closed before fork.
* _remote.py: Reset _initialized in close()Jürg Billeter2019-10-151-0/+2
|
* _remote.py: Remove unused bytestreamJürg Billeter2019-09-191-5/+0
|
* Allow splitting artifact cachesTristan Maat2019-09-061-35/+86
| | | | | | | This is now split into storage/index remotes, where the former is expected to be a CASRemote and the latter a BuildStream-specific remote with the extensions required to store BuildStream artifact protos.
* Remove cache-specifc spec classesTristan Maat2019-09-061-2/+4
| | | | This was almost entirely just historical code duplication.
* Create BaseRemote base classTristan Maat2019-09-061-0/+241