summaryrefslogtreecommitdiff
path: root/src/buildstream/_cas
Commit message (Collapse)AuthorAgeFilesLines
* _cas/casdprocessmanager.py: Use Messenger convinence functions.Tristan van Berkom2020-12-221-16/+5
| | | | | | This also adjusts the very strange tests in tests/internals/cascache.py which use unittest's MagicMock interface to inspect what happened on specific python methods instead of doing proper end-to-end testing.
* Use CASCache.open()juerg/casJürg Billeter2020-12-091-2/+1
|
* cascache.py: Add open() methodJürg Billeter2020-12-091-0/+16
|
* cascache.py: Generalize remote_missing_blobs() into missing_blobs()Jürg Billeter2020-12-091-31/+12
| | | | | The implementation can be reused to replace `local_missing_blobs()` and simplify `contains_files()`.
* cascache.py: Optimize _fetch_tree() using add_objects()Jürg Billeter2020-12-091-5/+6
|
* cascache.py: Add add_objects() methodJürg Billeter2020-12-091-16/+48
| | | | | This allows adding multiple objects in a single batch, avoiding extra gRPC round trips to buildbox-casd.
* cascache.py: Remove unused parameters from add_object()Jürg Billeter2020-12-091-8/+2
|
* cascache.py: Remove _ensure_blob() methodJürg Billeter2020-12-091-24/+2
| | | | | It's only used by `_fetch_tree()` and can be replaced by a single additional line.
* cascache.py: Also fetch file blobs in _fetch_directory()Jürg Billeter2020-12-091-2/+4
| | | | | This eliminates code duplication in `ArtifactCache`, `SourceCache` and `ElementSourcesCache`.
* cascache.py: Reimplement _fetch_directory() with FetchTree()Jürg Billeter2020-12-091-55/+17
| | | | This simplifies the code, delegating the logic to buildbox-casd.
* Move _reachable_refs_dir() method from cascache.py to testutilsJürg Billeter2020-12-091-32/+0
| | | | It's not used outside testutils.
* scheduler.py: Use threads instead of processes for jobsBenjamin Schubert2020-12-042-79/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* _signals.py: allow calling signal handler from non-main threadsBenjamin Schubert2020-12-011-1/+6
| | | | | | | | | | | | | | | | | | * This modifies the signal terminator so that it can be called from any thread. This checks that either: - The signal handler is already in place - Or the caller is in the main thread, allowing to set the signal handler. This also removes the exact callback that was added instead of removing the last one, and fixes the `suspend_handler` to do the same. This is required, as we don't know which interleaving of calls will be done, and we can't guarantee that the last one is the right one to remove
* casremote.py: Migrate to GetInstanceNameForRemotes()Jürg Billeter2020-08-131-7/+17
| | | | GetInstanceNameForRemote() has been deprecated.
* casserver.py: Drop BuildStream Artifact and Source servicesJürg Billeter2020-08-131-218/+0
| | | | Replaced by Remote Asset API Fetch and Push services.
* casserver.py: Add proxy for Remote Asset APIJürg Billeter2020-08-131-0/+50
|
* casdprocessmanager.py: Add stubs for the Remote Asset APIJürg Billeter2020-08-131-0/+25
|
* casserver.py: Fix error handling for requests forwarded to casdJürg Billeter2020-06-251-5/+20
|
* casdprocessmanager.py: Set `_bytestream` to `None` when closing channelJürg Billeter2020-06-251-0/+1
|
* Completely abolish job pickling.tristan/nuke-pickle-jobberTristan van Berkom2020-06-151-26/+0
|
* cascache.py: Fix file modes in checkout()Jürg Billeter2020-06-101-11/+10
| | | | | Do not copy file mode from casd object file. Do not change non-executable mode bits if file is executable.
* casdprocessmanager.py: make sure --protect-session-blobs is always passedabderrahim/protect-blobsAbderrahim Kitouni2020-06-081-2/+2
| | | | | | an indentation error meant it was only passed when quota was defined Fixes #1268
* cascache.py: Drop unnecessary FindMissingBlobs from _send_directory()juerg/cas-send-directoryJürg Billeter2020-05-281-3/+5
| | | | | | buildbox-casd `UploadMissingBlobs` will call `FindMissingBlobs` before the actual upload. Having BuildStream call `FindMissingBlobs` as well adds unnecessary overhead.
* Update node property support to match proto changesJürg Billeter2020-05-271-9/+10
|
* casdprocessmanager.py: Check that buildbox-casd process is not a zombiectolentino/check-casd-processctolentino82020-05-151-0/+3
|
* Update all packages requirementsBenjamin Schubert2020-05-111-1/+1
| | | | Also fix linting errors coming with new version of pylint
* casdprocessmanager.py: Check if buildbox-casd process is alive while waiting ↵ctolentino/casd-timeoutctolentino82020-05-051-2/+12
| | | | for connection
* casdprocessmanager.py: Relax timeout for establishing buildbox-casd connectionctolentino82020-05-051-2/+3
|
* _cas/cascache.py: Drop unused contains_file()Jürg Billeter2020-04-201-12/+0
|
* _cas/cascache.py: Add contains_files() methodJürg Billeter2020-04-201-5/+17
| | | | Like `contains_file()` but checks multiple files in a single request.
* cascache.py: Add allow_partial parameter to fetch_blobs()Jürg Billeter2020-04-201-3/+6
| | | | This fixes handling of missing blobs in `ArtifactCache.pull()`.
* cascache.py: use buildbox-casd when checking whether a file is cachedabderrahim/public-dataAbderrahim Kitouni2020-04-081-1/+7
| | | | this lets buildbox-casd know it is needed and not delete it when pruning
* cascache.py: remove creation of the 'cas/objects' directorybschubert/stricter-cas-socbschubert152020-03-241-1/+0
| | | | | | buildbox-casd should handle the creation of its own directories. This is especially needed when buildbox-casd and buildstream don't run under the same user.
* cascache.py: Create cas logs in the buildstream cache directorybschubert152020-03-241-2/+11
| | | | | | This moves the cas logs outside of the cas directory. Since BuildStream is responsible for creating and handling the logs, it should not be in the cas directory.
* cascache.py: Don't trip up on empty digests in fetch_blobs()Jürg Billeter2020-02-201-1/+2
|
* cascache.py: Remove unused diff_trees() methodJürg Billeter2020-02-111-68/+0
|
* cascache.py: Remove unused _get_subdir() methodjuerg/remove-unusedJürg Billeter2020-02-101-16/+0
|
* cascache.py: Parse timestamp and update mtimes in checkoutDarius Makovsky2020-02-051-1/+9
| | | | | | If checking out files from a CasBasedDirectory which holds node_properties in the index files are explicitly copied instead of being hardlinked and the mtime is updated to the stored value.
* cascache.py: Add properties to CaptureTree requestsDarius Makovsky2020-02-051-2/+9
|
* remote_execution: Update protoDarius Makovsky2020-02-051-2/+2
|
* casserver: remove _digest_from_*_resource_name()Darius Makovsky2019-12-091-45/+0
|
* casserver: remove ArtifactStatus()Darius Makovsky2019-12-091-4/+0
|
* cascache: remove update_tree_mtime()Darius Makovsky2019-12-091-4/+0
|
* casdprocessmanager.py: Set up socket path via a symlinkTristan Maat2019-12-031-4/+57
| | | | | | | | | | | This is necessary to allow using buildbox-run with userchroot in the near future, since currently only the owner of the BuildStream process can access the CASD socket, but the buildbox-casd binary will need to be setuid' to another user. This gets around this limitation by allowing the group to access a symlink, which in turn should point to a directory owned by the CASD user.
* Remove newly unused API surfaces in CASCacheTristan Maat2019-12-031-164/+1
| | | | | | This also involves a number of changes to tests and other parts of the codebase since they were hacking about wit API that shouldn't have existed.
* casserver.py: Proxy CAS requests to buildbox-casdTristan Maat2019-12-032-245/+181
|
* casserver.py: Add loggingTristan Maat2019-12-031-5/+72
|
* CASDChannel: don't need to call GetCapabilitiesAngelos Evripiotis2019-11-221-5/+1
| | | | | It doesn't seem like we need to call GetCapabilities here, as we're not querying anything. Remove the call to save some time.
* CASCache: comment on need for __getstate__Angelos Evripiotis2019-11-221-0/+5
|
* cascache: _CASCacheUsageMonitor has channelAngelos Evripiotis2019-11-222-14/+6
| | | | | | Change _CASCacheUsageMonitor to hold a CASDChannel instead of it's parent CASCache. This means that when in spawn mode, we don't need to pickle the CASCache, only the CASDChannel.