summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* sandbox.py: Remove unused _set_virtual_directory() methodJürg Billeter2019-12-051-6/+0
|
* _sandboxreapi.py: Use CasBasedDirectory._reset()Jürg Billeter2019-12-051-3/+2
| | | | | | Calling _reset() instead of completely replacing the object fixes element plugins that use a virtual directory object across Sandbox.run() calls such as the compose plugin with integration commands.
* _casbaseddirectory.py: Add _reset() methodJürg Billeter2019-12-051-1/+6
| | | | This reinitializes a CASBasedDirectory object from a directory digest.
* testing/runcli.py: Remove unused configure parameter from run() methodsJürg Billeter2019-12-051-34/+5
|
* tests: source_determinism.py: Do not use too restrictive test umasksjuerg/casd-separate-userJürg Billeter2019-12-031-2/+7
| | | | | | | | To protect the local cache of buildbox-casd from corruption without the use of FUSE, buildbox-casd has to run as a different user. Use less restrictive umasks in the source determinism tests to allow buildbox-casd to function when it is running as a separate user.
* testing/_utils/site.py: Add CASD_SEPARATE_USER variableJürg Billeter2019-12-031-0/+5
| | | | | This is set to True if buildbox-casd is installed with the set-uid bit and thus, indicates whether buildbox-casd is running as a separate user.
* utils.py: safe_link(): Copy if hardlink creation is not permittedJürg Billeter2019-12-031-1/+1
| | | | | | | | | | | By default, Linux doesn't allow creating hardlinks to read-only files of other users since Linux 3.6 (see /proc/sys/fs/protected_hardlinks). This fixes staging when buildbox-casd is running as a separate user and the traditional bubblewrap sandboxing backend is used. This combination is not recommended, however, it's triggered in CI by docker images that run buildbox-casd as a separate user and a few test cases that override BST_FORCE_SANDBOX.
* 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.
* _*cache.py: Standardize cache basedirsTristan Maat2019-12-033-20/+21
|
* Remove newly unused API surfaces in CASCacheTristan Maat2019-12-034-168/+37
| | | | | | 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-033-245/+219
|
* casserver.py: Add loggingTristan Maat2019-12-031-5/+72
|
* Update all python dependenciesBenjamin Schubert2019-12-021-1/+1
| | | | | | | | This updates all dependencies on the project, which is mainly needed by python3.8 but can be done independentely. This also disables multiple false positive lint errors and disable a new check that we don't need.
* lint: remove all unecessary elif/else after break/continueBenjamin Schubert2019-12-028-21/+21
| | | | | Newer pylint versions detect and complain about unnecessary elif/else after a continue/break/return clause. Let's remove them
* lint: Remove unnecessary list comprehensionsBenjamin Schubert2019-12-024-4/+4
| | | | | Newer version of pylint detect when a comprehension would not be needed. Let's remove all the ones that are indeed extraneous
* _sandboxreapi.py: Ensure /dev, /proc and /tmp exist in sandboxJürg Billeter2019-11-271-0/+4
|
* _sandboxreapi.py: Check that command existsJürg Billeter2019-11-271-0/+5
|
* _sandboxreapi.py: Fix Command.working_directoryJürg Billeter2019-11-271-1/+1
| | | | | The working directory must be specified relative to the input root, i.e., the leading slash must be dropped.
* sandbox.py: Assert that the working directory is an absolute pathJürg Billeter2019-11-271-1/+3
| | | | Sandbox implementations rely on this.
* tests: Allow strict contents in assert_containsDarius Makovsky2019-11-271-3/+17
|
* Clear last_successful for soft-reset of WorkspaceDarius Makovsky2019-11-271-0/+1
|
* Do not load the workspace.last_successful as the workspace plugin refDarius Makovsky2019-11-272-3/+5
| | | | | | Set the workspace plugin `__last_successful` attribute. loader: Use empty string as default when last_successful is missing
* element: always prepare sandboxesDarius Makovsky2019-11-271-13/+2
|
* compose: Allow compose elements to run integration commandsValentin David2019-11-261-3/+0
|
* _stream.py: Remove dead code and comments about trackingBenjamin Schubert2019-11-254-66/+22
| | | | | We don't have many of the `--track` options anymore, so we can remove handling for them in parts of the code that don't need it.
* testing/integration.py: Respect umask for the integration cacheTristan Maat2019-11-251-0/+4
|
* tar.py: Respect umaskJürg Billeter2019-11-251-5/+6
| | | | This allows access by buildbox-casd running as different user.
* tar.py: Make directories with incorrect permissions traversableTristan Maat2019-11-251-2/+6
|
* element.py: Make build directory a proper utils._tempdirTristan Maat2019-11-251-15/+6
|
* utils.py: Respect umask in _tempdir()Jürg Billeter2019-11-251-1/+18
| | | | | | | This allows access by buildbox-casd running as different user with a suitable umask. As this is not generally safe in global temp directories such as /tmp, make the `dir` parameter mandatory and add a note to the documentation.
* utils.py: Respect umask in save_file_atomic()Jürg Billeter2019-11-251-0/+2
| | | | This allows access by buildbox-casd running as different user.
* utils.py: Add get_umask() methodJürg Billeter2019-11-251-0/+16
|
* 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.
* Extract casd_channel logic to CASDChannelAngelos Evripiotis2019-11-223-71/+113
| | | | | | | | | | | | Encapsulate the management of a connection to CASD, so we can hide the details of how it happens. This will make it easier to port to Windows, as we will have to take a different approach there. Remove the _LimitedCASDProcessManagerProxy, as CASDChannel does everything the child jobs will need. Also make get_local_cas() public, since it is already used outside of the CASCache class. Make get_cas() public to match.
* CASDProcessManager: 'release_resources' conventionAngelos Evripiotis2019-11-222-16/+12
| | | | | | | Elsewhere in cascache, cleaning up is called 'release_resources', so follow that convention for consistency. Also fix a case where self.process was not set to None in terminate().
* cascache: extract CASDProcess in new moduleAngelos Evripiotis2019-11-224-141/+202
| | | | | | | | | | Make it easier to specialize handling of the buildbox-casd process on Windows, by splitting it into it's own class. This allows us to encapsulate some decisions, and decreases the complexity of the CASCache class. Take some of the complexity out of this file by splitting the responsibility of managing the process out to another file.
* _stream.py: Refactor `Stream._load()` a littleTristan Maat2019-11-221-32/+72
| | | | | | There was some duplicated functionality between `Stream._load()` and `Stream._load_tracking()`, this is factored out and hopefully makes the cognitive complexity a bit lower.
* Remove `Element._schedule_tracking()`Tristan Maat2019-11-223-42/+8
|
* Fix stacktraces during element loadingTristan Maat2019-11-221-2/+15
| | | | | | | | | | These were caused by unhandled errors from plugins when calling `Source.get_consistency()`. This doesn't really solve the problem, since that interface is still used un-wrapped elsewhere, but it enables removing `Element.__schedule_tracking()` and fixes a bug. Ultimately we'd like to remove `Source.get_consistency()`, so this isn't too long-term of a problem.
* Remove early skipping of already-fetched sourcesTristan Maat2019-11-221-5/+1
|
* Simplify queue managementTristan Maat2019-11-222-15/+4
|
* Schedule elements instead of "requiring" themTristan Maat2019-11-224-70/+11
|
* Remove all `--track` optionsTristan Maat2019-11-222-173/+86
|
* Improve help message for workspace soft-resetDarius Makovsky2019-11-192-2/+6
|
* element.py: Refactor __update_ready_for_runtime()Tristan Maat2019-11-181-19/+30
| | | | | | Just as with the previous commit, inspired by our code quality linter. Poor practice from the previous function probably snuck in here too.
* element.py: Refactor __update_strict_cache_key_of_rdeps()Tristan Maat2019-11-181-14/+26
| | | | | This is on suggestion of our code quality linter - it should make understanding the pre-requisites of the function simpler.
* element.py: Reduce calls to __update_cache_key_non_strictTristan Maat2019-11-182-3/+24
|
* element.py: Make ex-_update_state() components privateTristan Maat2019-11-181-17/+19
|