summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* _artifactcache: There shalt be only one cache sizetristan/fix-cache-exclusivityTristan Van Berkom2018-09-108-86/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does a lot of house cleaning, finally bringing cache cleanup logic to a level of comprehensibility. Changes in this commit include: o _artifactcache/artifactcache.py: _cache_size, _cache_quota and _cache_lower_threshold are now all private variables. get_approximate_cache_size() is now get_cache_size() Added get_quota_exceeded() for the purpose of safely checking if we have exceeded the quota. set_cache_size() now asserts that the passed size is not None, it is not acceptable to set a None size cache anymore. o _artifactcache/cascache.py: No longer set the ArtifactCache 'cache_size' variable violently in the commit() method. Also the calculate_cache_size() method now unconditionally calculates the cache size, that is what it's for. o _scheduler/jobs/cachesizejob.py & _scheduler/jobs/cleanupjob.py: Now check the success status. Don't try to set the cache size in the case that the job was terminated. o _scheduler/jobs/elementjob.py & _scheduler/queues/queue.py: No longer passing around the cache size from child tasks, this happens only explicitly, not implicitly for all tasks. o _scheduler/queues/buildqueue.py & _scheduler/scheduler.py: Use get_quota_exceeded() accessor This is a part of #623
* element.py: Remove _get_artifact_cache() accessor.Tristan Van Berkom2018-09-104-16/+16
| | | | | | | | | | | | The artifact cache is anyway a singleton, the Element itself has an internal handle on the artifact cache because it is needed very frequently; but an artifact cache is not element specific and should not be looked up by surrounding code on a per element basis. Updated _scheduler/queues/queue.py, _scheduler/queues/buildqueue.py and _scheduler/jobs/elementjob.py to get the artifact cache directly from the Platform
* _scheduler/jobs/cleanupjob.py: Use Platform.get_platform() public accessorTristan Van Berkom2018-09-101-3/+5
| | | | | | | | This was previously poking directly at the Platform._instance. Also, use the name 'artifacts' to hold the artifact cache to be consistent with other parts of the codebase, instead of calling it 'cache'.
* _scheduler/jobs/cachesizejob.py: Use Platform.get_platform() public accessorTristan Van Berkom2018-09-101-3/+5
| | | | | | | | This was previously poking directly at the Platform._instance. Also, use the name 'artifacts' to hold the artifact cache to be consistent with other parts of the codebase, instead of calling it 'cache'.
* element.py: Remove _get_artifact_size()Tristan Van Berkom2018-09-103-36/+22
| | | | | | | | There is no justification to hold onto this state here. Instead, just make `Element._assemble()` return the size of the artifact it cached, and localize handling of that return value in the BuildQueue implementation where the value is observed.
* _artifactcache/artifactcache.py: Sealing away some the estimated sizeTristan Van Berkom2018-09-104-28/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, the API contract was to expose the estimated_size variable on the ArtifactCache instance for all to see, however it is only relevant to the ArtifactCache abstract class code. Subclasses were informed to update the estimated_size variable in their calculate_cache_size() implementation. To untangle this and hide away the estimated size, this commit does the following: o Introduces ArtifactCache.compute_cache_size() API for external callers o ArtifactCache.compute_cache_size() calls the abstract method for the CasCache subclass to implement o ArtifactCache.compute_cache_size() updates the private estimated_size variable o All direct callers to ArtifactCache.calculate_cache_size(), have been updated to use the ArtifactCache.compute_cache_size() method instead, which takes care of updating anything local to the ArtifactCache abstract class code (the estimated_size)
* _artifactcache/artifactcache.py: Removing unused variable.Tristan Van Berkom2018-09-101-1/+0
| | | | | | | | | The ArtifactCache._local variable used to exist in order to use a special hack to allow absolute paths to a remote artifact cache, this was all for the purpose of testing. This has all gone away with the introduction of CAS, leaving behind a stale variable.
* _scheduler: API fixes; _check_cache_size_real() -> check_cache_size()Tristan Van Berkom2018-09-103-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | Here we have a very private looking _check_cache_size_real() function which no-one would ever want to call from outside of the _scheduler, especially given it's `_real()` prefix we should look for another outward facing API to use. However this is not private to the scheduler, and is intended to be called by the `Queue` implementations. o Renamed this to check_cache_size() o Moved it to the public API section of the Scheduler object o Added the missing API documenting comment o Also added the missing API documenting comment to the private `_run_cleanup()` callback which runs in response to completion of the cache size calculation job. o Also place the cleanup job logs into a cleanup subdirectory, for better symmetry with the cache_size jobs which now have their own subdirectory
* _artifactcache: Making public methods publicTristan Van Berkom2018-09-104-32/+35
| | | | | | | | | | | The artifact cache provides the following public methods for external callers, but was hiding them away as if they are private. o ArtifactCache.add_artifact_size() o ArtifactCache.set_cache_size() Mark these properly public
* element.py: Adding missing API documenting commentTristan Van Berkom2018-09-101-0/+7
|
* _scheduler/scheduler.py: Make CacheSizeJob() not require the CACHE exclusivelyTristan Van Berkom2018-09-101-1/+0
| | | | | | | | | | | This runs after every pull, and does not need the cache exclusively, only the cleanup job requires the cache exclusively. Without this, every time a cache_size job is queued, all pull and build jobs need to complete before cache_size job can run exclusively, which is not good. This is a part of #623
* _scheduler/resources.py: Set CACHE max resources to 0Tristan Van Berkom2018-09-101-1/+1
| | | | | | | | | | | This means there is no cap for shared resource requests. Together with the previous commit, this causes the cleanup job and the pull/build jobs to all require unlimited shared access to the CACHE resource; while only the cleanup job requires exclusive access to the resource. This is a part of #623
* _scheduler/queues: Mark build and pull queue as requiring shared access to ↵Tristan Van Berkom2018-09-102-2/+2
| | | | | | | | | | | the CACHE This is what the whole resource.py thing was created for, the cleanup job must have exclusive access to the cache, while the pull and build jobs which result in adding new artifacts, must only require shared access. This is a part of #623
* tests/artifactcache/expiry.py: Fix test case expectations.Tristan Van Berkom2018-09-101-0/+19
|
* Merge branch 'danielsilverstone-ct/maybe-reduce-fd-leaks' into 'master'Tristan Maat2018-09-041-1/+6
|\ | | | | | | | | jobs.py: Reduce FD leaks from queues and process objects See merge request BuildStream/buildstream!778
| * jobs.py: Reduce FD leaks from queues and process objectsdanielsilverstone-ct/maybe-reduce-fd-leaksDaniel Silverstone2018-09-041-1/+6
|/ | | | | | | | | | | | The garbage collector can take too long to get around to cleaning up the Queue and Process instances in completed Job instances. As such, FDs tend to leak and in very large projects this can result in running out of FDs before a build, fetch, track, or other process can complete. This patch reduces the chance of that by only creating the queue when it's needed, and forcing the queue and process instances to be deleted when the parent is finished with them. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* Merge branch 'benbrewer/install-artifacts-doc-improvements' into 'master'Javier Jardón2018-09-041-5/+8
|\ | | | | | | | | Improve documentation for artifact cache installation See merge request BuildStream/buildstream!777
| * Improve documentation for artifact cache installationBen Brewer2018-09-041-5/+8
|/ | | | | | | Remove ambiguity about systemd service files being separate. Add URL for more information about systemd service files. Add note about public keys being mandatory for self-signed certs. Make cert/key file naming consistent throughout document.
* Merge branch 'tpollard/483' into 'master'Tom Pollard2018-09-032-4/+109
|\ | | | | | | | | plugins/git.py: Warn if ref is not in given track See merge request BuildStream/buildstream!564
| * tests/sources/git.py: Add tests for REF_NOT_IN_TRACKtpollard/483Tom Pollard2018-09-031-0/+68
| | | | | | | | | | Add tests that cover assert_ref_in_track & the configurable CoreWarnings REF_NOT_IN_TRACK warnings token.
| * plugins/git.py: Warn if ref is not in given trackTom Pollard2018-09-031-4/+41
|/ | | | | | | | | | | Add a helper function assert_ref_in_track to git.py GitMirror() which is used when staging & initing the source workspace. It checks the element's ref exists in the track (branch/tag) if it has been specified, raising a warning if necessary. The warning makes use of the warning token 'REF_NOT_IN_TRACK' from the configurable CoreWarnings. If the element has been tracked with bst, it is assumed that the value of ref exists in the track as it was generated from it & as such is not asserted.
* Merge branch 'tristan/source-fetcher-changes' into 'master'Tristan Van Berkom2018-09-035-32/+149
|\ | | | | | | | | Source fetcher changes See merge request BuildStream/buildstream!772
| * source.py: Track marked URLs and assert they are marked during ↵tristan/source-fetcher-changesTristan Van Berkom2018-09-021-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Plugin.configure() This cannot test for unaliased URLs, as those can be discovered later on outside of user provided element configuration; at least we assert that if an alias was used, we have seen it at load time. This will cause a BUG to occur for a plugin which marks an aliased URL (or attempts to translate one) outside of `Plugin.configure()`, if that URL was not previously seen. This is a part of #620
| * source.py: Added `primary` argument to URL marking APIsTristan Van Berkom2018-09-023-19/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | The Source must now mention whether the marked or translated URL is "primary" or not. Even when a Source may have multiple URLs, the auxilliary URLs are derived from the primary one, not only is this true for git, but it is mandated by our tracking API which assumes there is a primary URL. This adjusts the `git` source and the test `fetch_source.py` source to behave properly and advertize it's primary URL properly. This is a part of #620
| * plugin.py: Added _configure() and _get_configuring() private APIsTristan Van Berkom2018-09-023-2/+29
| | | | | | | | | | | | | | | | | | Keeps track of whether the plugin is currently being configured. Adjusted Element and Source classes to call _configure() in place of calling configure() directly. This is a part of #620
| * source.py: Documenting that marking download URLs is mandatoryTristan Van Berkom2018-09-021-6/+34
| | | | | | | | | | | | | | A download URL must be interpreted by the core at `Plugin.configure()` time, even if only employed later on. This is a part of #620
| * source.py: Fixing docs link formatting to be consistent.Tristan Van Berkom2018-09-021-8/+10
| |
| * source.py: Document Source.get_source_fetchers() to return an iterableTristan Van Berkom2018-09-021-2/+9
|/ | | | | | | | Also highlight the fact that the plugin can rely on the fetcher's fetch() method getting called before consuming the next item in the list, which is the magick behavior that the git plugin relies on. This is a part of #620
* Merge branch 'Qinusty/cache-size-directory' into 'master'Tristan Van Berkom2018-09-011-1/+1
|\ | | | | | | | | Move cache_size.pid.log files into a subdirectory of logs See merge request BuildStream/buildstream!769
| * scheduler.py: Move cache_size logs into folderQinusty/cache-size-directoryJosh Smith2018-08-311-1/+1
|/ | | | | This prevents the cache_size.pid.log files from cluttering the root log directory.
* Merge branch 'Qinusty/retries-should-fail' into 'master'Tristan Van Berkom2018-08-314-10/+6
|\ | | | | | | | | Retries log as failures See merge request BuildStream/buildstream!766
| * tests: Modify tests to ensure retry FAILUREJosh Smith2018-08-313-3/+3
| |
| * job.py: Modify retry messages to be FAILJosh Smith2018-08-311-7/+3
|/ | | | | | | | This adjusts the message handler for the child processes to no longer override the message type. This also removes the ability for unhandled non BstError exceptions to retry.
* _project.py: Adding FIXME comment to address #591 properlyTristan Van Berkom2018-08-311-1/+7
|
* Merge branch 'tpollard/591' into 'master'Tiago Gomes2018-08-301-0/+5
|\ | | | | | | | | buildstream/_project.py: Report if project.conf is missing name See merge request BuildStream/buildstream!680
| * buildstream/_project.py: Report if project.conf is missing nameTom Pollard2018-08-301-0/+5
|/ | | | | | | Explicitly check that project.conf contains a name. This resolves the issue of the provenance check from _yaml.py incorrectly reporting the offending file as the default_config_node projectconfig.yaml when no name key exists in the pre_config_node dict.
* Merge branch 'bzr_fix' into 'master'Phillip Smyth2018-08-301-5/+7
|\ | | | | | | | | Replacing string 'bzr' with value from host tools See merge request BuildStream/buildstream!764
| * Replacing string 'bzr' with value from host toolsbzr_fixknownexus2018-08-301-5/+7
|/
* Merge branch 'tristan/atomic-cache-size-file' into 'master'Tristan Van Berkom2018-08-301-1/+1
|\ | | | | | | | | _artifactcache/artifactcache.py: Write the cache_size file atomically See merge request BuildStream/buildstream!762
| * _artifactcache/artifactcache.py: Write the cache_size file atomicallytristan/atomic-cache-size-fileTristan Van Berkom2018-08-301-1/+1
|/ | | | | | | | This is causing issues while the size file is being read and written simultaneously. The proper fix will be to read/add/save the file atomically and that will require locking, but this fix is a good stop gap to existing crashes.
* Merge branch 'valentindavid/post_tracking_errors' into 'master'Tristan Van Berkom2018-08-302-12/+37
|\ | | | | | | | | | | | | Report processing errors from tracking Closes #533 See merge request BuildStream/buildstream!747
| * Report processing errors from trackingValentin David2018-08-302-12/+37
|/ | | | | | Failures to write files when tracking were not reported. Fixes #533.
* Merge branch 'tristan/source-mirroring-changes' into 'master'Tristan Van Berkom2018-08-302-17/+31
|\ | | | | | | | | Minor code changes revolving around source mirroring See merge request BuildStream/buildstream!758
| * plugins/source/git.py: Fix formatting of url in trackingTristan Van Berkom2018-08-301-1/+3
| | | | | | | | | | This was displaying the aliased URL which is pretty useless, use the translated URL for the timed activity.
| * source.py: Move Source.mark_download_url() to the public methods.Tristan Van Berkom2018-08-301-13/+13
| | | | | | | | | | | | This was sitting in the section for abstract methods, but this is most definitely not an abstract method to be implemented by Sources.
| * source.py: Stylistic changes in Source.__do_fetch()Tristan Van Berkom2018-08-301-3/+15
|/ | | | | | Added some comments to make the flow easier to follow, and removed an annoying 'success' variabled in favor of a for / else loop statement.
* Merge branch 'tristan/538-reenable-ostree-test' into 'master'Tristan Van Berkom2018-08-301-4/+0
|\ | | | | | | | | tests/frontend/mirror.py: Reenable test_mirror_fetch_upstream_absent[ostree] See merge request BuildStream/buildstream!755
| * tests/frontend/mirror.py: Reenable test_mirror_fetch_upstream_absent[ostree]tristan/538-reenable-ostree-testTristan Van Berkom2018-08-301-4/+0
|/ | | | | This test was skipped because of issue #538, but #538 was fixed and the test was still not reenabled.
* Merge branch 'tristan/reduce-filter-tests' into 'master'Tristan Van Berkom2018-08-301-15/+10
|\ | | | | | | | | tests/plugins/filter.py: Don't run redundant tests See merge request BuildStream/buildstream!753
| * tests/plugins/filter.py: Don't run redundant testsTristan Van Berkom2018-08-301-15/+10
|/ | | | | | | | | There is no reason that the filter element codepaths can behave differently depending on the Source implementation used in the test, as the Source implementation does not have any filter specific virtual methods. Removing the redundant tests and just performing these tests with the git source.