summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cascache.py: Modify messaging API callsQinusty/skipped-rework-backport-1.2Josh Smith2018-09-191-5/+2
| | | | | | | Both pulling and pushing INFO messages are now status messages. Calls to the messaging API through `self.context.message()` have now been switched to `element.info`.
* cascache.py: Move push/pull messaging to cascacheJosh Smith2018-09-193-9/+7
| | | | | | | | Pulled/Pushed messages will no longer be produced from within element.py, instead they will be produced during CasCache push() and pull() appropriately. Message consistency has also been improved.
* element.py: Remove redundant timed_activityJosh Smith2018-09-191-9/+8
| | | | | This removes the timed_activity for an element _push action. This is unnecessary as the job is already being timed elsewhere.
* tests.py: Test skip on pushJosh Smith2018-09-191-0/+23
| | | | | Adds a test to ensure that BuildStream alerts the user of a skipped push when the remote already has the artifact cached.
* Rework Skipped usageJosh Smith2018-09-1910-45/+49
| | | | | | | | | | The SKIPPED message type is now used to indicate the end of a task which was successful without having to perform the given task. This overhauls the use of `Queue.done()` and therefore queues do not need to provide a processed/skipped return value from `done()`. Instead this is replaced with the action of raising a `SkipJob` exception from within `Queue.process()`.
* Merge branch 'tristan/remove-blessings-1.2' into 'bst-1.2'Tristan Van Berkom2018-09-193-8/+77
|\ | | | | | | | | _frontend/status.py: Completely remove the blessings dependency from BuildStream See merge request BuildStream/buildstream!809
| * _frontend/status.py: Completely remove the blessings dependency from BuildStreamTristan Van Berkom2018-09-193-8/+77
|/ | | | | | | | | | | | | | | | | | | | | | | This actually improves reliability of the status bar because we now disable it completely in the case that not all of the terminal escape sequences are supported on the given terminal. This replaces the few functions we were using, to move the cursor up one line, move it to the beginning of the line, and to clear a line, with low level functions provided by the curses module in the standard library. This change makes it easier for downstream distro package maintainers to package BuildStream, particularly on Fedora. Asides from changing _frontend/status.py, this commit includes the following changes: * _frontend/app.py: Use python isatty() function to determine if we are connected to a tty, instead of relying on blessings. * setup.py: Remove the dependency on blessings.
* Merge branch 'tristan/fix-artifact-config-crash-1.2' into 'bst-1.2'Tristan Van Berkom2018-09-185-1/+46
|\ | | | | | | | | Fix artifact config crash (1.2) See merge request BuildStream/buildstream!805
| * tests/artifactcache/config.py: Added test for invalid push remote configurationTristan Van Berkom2018-09-184-0/+35
| | | | | | | | | | Test that we get the expected error when configuring a client-cert without client-key, or the inverse.
| * _artifactcache/artifactcache.py: Error out gracefully when push remote is ↵Tristan Van Berkom2018-09-181-1/+11
|/ | | | | | | | | | mal-specified When configuring a push remote and specifying either the client-cert or the client-key, then both must be specified. This ensures we get an informative error instead of a stack trace and BUG. Fixes issue #625
* Merge branch 'tristan/fix-override-options-1.2' into 'bst-1.2'Tristan Van Berkom2018-09-184-0/+52
|\ | | | | | | | | Fix override options 1.2 See merge request BuildStream/buildstream!803
| * tests/format/optionoverrides.py: Added test for options in element overridesTristan Van Berkom2018-09-183-0/+49
| | | | | | | | This is a regression test for issue #658
| * _project.py: Fix option resolution in element & source overridesTristan Van Berkom2018-09-181-0/+3
|/ | | | | | | | | This ensures that option expressions are resolved in the project level overrides before attempting to composite them on the instantiated elements. Seems this is a regression from introducing the include directive. This fixes issue #658
* buildstream/_frontend/complete.py: Added missing click license complianceTristan Van Berkom2018-09-161-2/+17
| | | | | | Somehow I missed this when originally forking the file from the click library, now noticing that we should have followed what was written in: https://github.com/pallets/click/blob/master/LICENSE
* Merge branch 'tiagogomes/issue-287-backport' into 'bst-1.2'Tiago Gomes2018-09-148-27/+140
|\ | | | | | | | | Backport of !678 (Add validation of configuration variables) to 1.2 branch. See merge request BuildStream/buildstream!789
| * Add tests for validating configuration variablesTiago Gomes2018-09-143-0/+101
| |
| * element: validate configuration variablesTiago Gomes2018-09-142-1/+12
| | | | | | | | Ensure that protected variables are not being redefined by the user.
| * docs: document protected variablesTiago Gomes2018-09-142-15/+22
| | | | | | | | | | And remove then from the defaults as they are dynamically set by BuildStream.
| * tests: avoid setting max-jobsTiago Gomes2018-09-141-11/+5
|/ | | | Setting "max-jobs" won't be allowed anymore in a following commit.
* Merge branch 'tristan/fix-required-artifacts-1.2' into 'bst-1.2'Tristan Van Berkom2018-09-147-89/+218
|\ | | | | | | | | Don't delete required artifacts when tracking is enabled See merge request BuildStream/buildstream!794
| * tests/artifactcache/expiry.py: Added test_never_delete_required_track()Tristan Van Berkom2018-09-141-1/+57
| | | | | | | | | | | | Same test as test_never_delete_required(), except that this test ensures that we never delete required artifacts when their cache keys are discovered dynamically during the build.
| * testutils/element_generators.py: Changing sized element functionsTristan Van Berkom2018-09-142-18/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | * create_element_size() Now uses a git Repo object instead of a local source, and returns the repo. * update_element_size() Added this function which can now resize the expected output of an element generated with create_element_size(), useful to allow testing sized elements with the tracking feature.
| * testutils/repo/git.py: Added modify_file() methodTristan Van Berkom2018-09-141-0/+7
| | | | | | | | | | This allows one to modify a file in an existing git repo, as opposed to adding a new one.
| * tests/artifactcache/expiry.py: Assert the expected errorsTristan Van Berkom2018-09-141-0/+2
| | | | | | | | | | | | | | These tests were not checking that we fail for the expected reasons. Added `res.assert_task_error(ErrorDomain.ARTIFACT, 'cache-too-full')` where we expect to fail because the cache is too full.
| * tests/artifactcache/expiry.py: Cleanup of test for required artifactsTristan Van Berkom2018-09-141-39/+23
| | | | | | | | | | | | | | This commit renames test_never_delete_dependencies() to test_never_delete_required(), renders the test more readable by renaming some elements and reordering some statements and makes the comments more straight forward and accurate.
| * _artifactcache/artifactcache.py: Changes to mark_required_elements()Tristan Van Berkom2018-09-143-32/+53
|/ | | | | | | | | This was previously append_required_artifacts(), which presumed that we knew at startup time what the cache keys of all elements in the loaded pipeline would be. This fixes unexpected deletions of required artifacts when dynamic tracking is enabled with `bst build --track-all target.bst`
* Merge branch 'tristan/fix-cache-exclusivity-1.2' into 'bst-1.2'Tristan Van Berkom2018-09-1012-146/+198
|\ | | | | | | | | Tristan/fix cache exclusivity 1.2 See merge request BuildStream/buildstream!779
| * _artifactcache: There shalt be only one cache sizetristan/fix-cache-exclusivity-1.2Tristan 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
|/
* NEWS: Updating for the 1.2.0 release1.2.0Tristan Van Berkom2018-09-031-0/+8
|
* Merge branch 'tristan/update-docs' into 'bst-1.2'Tristan Van Berkom2018-09-0315-337/+303
|\ | | | | | | | | Updating docs session files before the release See merge request BuildStream/buildstream!774
| * docs: Updating static session files for the 1.2.0 releaseTristan Van Berkom2018-09-0314-336/+302
| | | | | | | | | | | | | | We regenerate these with releases so that packagers dont need to rebuild them, because rebuilding these sessions requires external resources and we expect packagers to build the package in restricted environments without internet access.
| * doc/examples/first-project/project.conf: Updating format versionTristan Van Berkom2018-09-031-1/+1
|/ | | | | This is a workaround for a bug that this regenerated file causes changes to the git repository while building documentation
* Merge branch 'tristan/source-fetcher-changes-1.2' into 'bst-1.2'Tristan Van Berkom2018-09-035-32/+149
|\ | | | | | | | | Source fetcher changes 1.2 See merge request BuildStream/buildstream!773
| * source.py: Track marked URLs and assert they are marked during ↵tristan/source-fetcher-changes-1.2Tristan Van Berkom2018-09-031-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-033-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-033-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-031-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