summaryrefslogtreecommitdiff
path: root/buildstream/_pipeline.py
Commit message (Collapse)AuthorAgeFilesLines
* Move source from 'buildstream' to 'src/buildstream'Chandan Singh2019-05-211-516/+0
| | | | | | This was discussed in #1008. Fixes #1009.
* Rework profiler to act as a context managerBenjamin Schubert2019-03-291-15/+12
|
* Rework Element.dependencies to be more efficientBenjamin Schubert2019-03-221-1/+3
|
* Integrate source cache with rest of buildstreamRaoul Hidalgo Charman2019-03-141-2/+3
| | | | | | | | | | | | | | This involve introducing new Consistency states `STAGED` and `BOTH` that represent when the source is just in the local CAS and in both the local CAS and unstaged in the source directory. Sources are staged for each element into the local CAS during the fetch stage. If the sources are in the local consistency state `STAGED` when wanting to open a workspace, the original sources are fetched. Relavant tests this affects have been changed. Part of #440
* Fixup refs to 'bst fetch'Angelos Evripiotis2019-01-281-1/+1
| | | | | Now that 'bst fetch' is obsolete, change guidance to refer to the replacement 'bst source fetch' instead.
* Fixup refs to 'bst track'Angelos Evripiotis2019-01-281-1/+1
| | | | | Now that 'bst track' is obsolete, change guidance to refer to the replacement 'bst source track' instead.
* _pipeline.py: Fix the planner to retain the original order when depth sortingTristan Van Berkom2019-01-101-1/+2
| | | | | | | | | | | The algorithm adds elements to a dictionary and then sorts the dictionary by the discovered depths while recursing - using an OrderedDict is enough to ensure a stable order. This fixes `bst show --deps plan ...` reporting different results on each invocation. This fixes an aspect of #824
* Add `bst source-checkout` commandChandan Singh2018-11-191-0/+27
| | | | | | | | | | | | As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `bst source-checkout` command. This will allow users to checkout sources for a given target. * _frontend/cli.py: Add source-checkout command * _pipeline.py: Add assert_sources_cached() method * _stream.py: Add source_checkout method, abstract out __check_location_writable() method that used to part of checkout()
* buildstream/_pipeline.py: Simplify error message for assert_consistent()Chandan Singh2018-11-191-1/+1
| | | | | | | | | | | | | | | Currently, `Pipeline.assert_consistent()` prints an error message like the one below when certain elements have inconsistent sources: ``` ... Element: hello.bst is inconsistent Source tar source at hello.bst [line 16 column 2] is missing ref ... ``` Drop the word "Source" from the beginning of the message as "Source <source-kind> source ..." is kind of awkward to read.
* _project.py: Remove unused artifacts parameter from load_elements()Jürg Billeter2018-11-051-1/+1
|
* Improve error message for deleted open workspacesValentin David2018-08-231-1/+12
| | | | Fixes #576.
* Pipeline: Skip except_elements logic if no elements to exceptJonathan Maw2018-08-211-0/+3
|
* Improve error message for build if there are refs missingwillsalmon/APIFixWilliam Salmon2018-08-171-14/+5
|
* Add warning to git track if track and ref are not presentWilliam Salmon2018-08-071-3/+17
| | | | | This is to address https://gitlab.com/BuildStream/buildstream/issues/471 that documented unhelpfull behavour when tracking git sources.
* Make Project owner of Loader.Valentin David2018-08-021-38/+3
|
* Pass targets to Loader.load() instead of its constructor.Valentin David2018-08-021-2/+2
| | | | | This is required to be able to build a Loader before the list of targets is known.
* Convert call-sites of Element._cached() that assume successRichard Maw2018-07-311-2/+2
| | | | When we later add cached failures it needs to not treat them as successes.
* Only redirect elements for workspace and track operationsPRE_CAS_MERGE_JULY_2018Jonathan Maw2018-07-161-0/+5
| | | | It was redirecting for checkout operations
* Remove shebangs from python filesGökçen Nurlu2018-06-191-1/+0
| | | | Fixes #424
* Allow tracking dependencies within sub-projects.Valentin David2018-06-081-7/+9
| | | | | | | --track-cross-junctions now concerns crossing junctions rather than forbidding elements in sub-project to be tracked. Part of #359.
* Redirect elements when performing tracking and workspace commandsJonathan Maw2018-05-171-2/+10
| | | | i.e. when an element is specified, it may be replaced with its source element.
* element.py: Do not query remote artifact caches ahead of pull/pushJürg Billeter2018-05-111-1/+1
|
* _pipeline.py: Allow pulling strict artifacts in non-strict modeJürg Billeter2018-05-111-3/+7
| | | | | | | | | | | Remotely cached artifacts matching the strict cache key take precedence over locally cached artifacts matching only the weak cache key. However, locally cached artifacts were excluded from the build plan, which means that BuildStream never even checked whether the strict artifact is available in the remote artifact cache. This changes planning to keep cached elements in the build plan in non-strict mode if a remote artifact cache is used.
* _pipeline.py: Remove unused ignore_cache parameter from _PlannerJürg Billeter2018-05-111-7/+7
|
* _stream.py, _pipeline.py: Refactoring of the pipeline itselfTristan Van Berkom2018-05-081-188/+181
| | | | | | | | | | | | | | | | | | | Here the pipeline becomes essentially stateless, some dangling state remains to be factored out because of frontend accesses which will be changed in a later commit. Essentially, the Pipeline.load() method no longer has any knowledge of the specific purposes of the loaded targets, and now takes a list of target groups and returns a corresponding list of element groups. The Stream() business logic methods now use other pipeline helper methods to create and filter lists from the loaded target elements. The Stream() also finally absorbs the Scheduler frontend facing APIs. However Queues are still exposed on the Stream object for logging purposes and through callbacks such that the frontend can retry elements.
* _artifactcache: Added ArtifactCache.setup_remotes()Tristan Van Berkom2018-05-081-32/+0
| | | | | | | This removes some additional initialization code from Pipeline(). Some symbols have changed here, the initialization is now called from Stream(), and a test case was also adjusted for this.
* Moving 'fetch_subprojects' configuration to stream <--> loaderTristan Van Berkom2018-05-081-5/+7
| | | | | | | | | This was previously decided in CLI, but knowledge of what to initialize has been moved to Stream(). Now there is no more point to store this configuration in the Context, we just have the Stream() decide it when asking the Pipeline() to invoke the Loader().
* _stream.py, _frontend: Call Stream() APIs with CLI arguments directly.Tristan Van Berkom2018-05-081-7/+2
| | | | | | This shifts the whole responsibility of interpreting command line targets etc to the Stream() object itself. With this commit, the Pipeline() truly becomes slaved to the Stream().
* _stream.py: New Stream object, main calling interface for BuildStream coreTristan Van Berkom2018-05-081-358/+2
| | | | | | This is the first part of the pipeline refactor, at this stage all calling interfaces remain the same, except that invocation of the scheduler has been moved from Pipline to Stream.
* _pipeline.py: Declare tracking related members in the constructorTristan Van Berkom2018-04-201-1/+2
|
* _pipeline.py, _frontend/app.py: Added track_selection initialization argumentTristan Van Berkom2018-04-191-11/+23
| | | | | This informs the pipeline what PipelineSelection mode to use for constructing the list of elements to track.
* _pipeline.py: Added PipelineSelectionTristan Van Berkom2018-04-191-8/+35
| | | | | | | | Part of a slow, ongoing refactor to unmangle the pipeline into something which just creates pipelines of elements for a centerpiece to process. This also renames Pipeline.deps_elements() -> Pipeline.get_selection()
* _scheduler/queue.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-181-10/+10
| | | | | | | | And change the API contract a bit more, now the Queue object takes the scheduler in the constructor and the Queue.attach() method is removed. This is a part of issue #285
* _pipeline.py: Stop printing warning when a build plan does not use some ↵Tristan Van Berkom2018-04-161-17/+0
| | | | | | existing workspaces Fixes issue #360
* element.py, _pipeline.py: Moved instantiation codepath to Element class methods.Tristan Van Berkom2018-04-161-41/+12
| | | | | This will allow the instantiation codepath to be shared by the Loader which also needs to instantiate elements for junctions.
* Clean up element/source instantiation code paths.Tristan Van Berkom2018-04-161-4/+2
| | | | | | This removes the extra `kind` parameter from all of the related codepaths, it is redundant since the `kind` attribute is already stored on the MetaElement and MetaSource objects.
* source.py, element.py, _pipeline.py: Streamling preflighting.Tristan Van Berkom2018-04-161-11/+2
| | | | | | | | | | | Instead of having the pipeline preflight all sources separately from elements, have the element preflight it's sources. This is in order to simplify the shared code path for the pipeline and the loader to use for instantiating elements. Also updated tests to expect the new ElementError and SourceError instead of the PipelineError which was raised for preflighting before.
* Fix disaster while making cross junction tracking optional.Tristan Van Berkom2018-04-131-76/+70
| | | | | | | | | | | | | | | | | This disaster was introduced in fece8cc81e8d8412e32c6667682a33e7d2f9dafe When doing `bst build --track`, we were: o first scheduling every element to be tracked o later filtering out the cross junction elements o finally asserting consistency state, which would trigger an error because we previously scheduled for tracking. Fixed this by moving all code which resolves elements to track into Pipeline.initialize(), and removing special element list handling from the individual build/fetch/track commands.
* _pipeline.py: Fix inconsistent element error to print element fullnames.Tristan Van Berkom2018-04-131-1/+1
|
* _frontend/cli.py, _pipeline.py: Add options for cross junction tracking.Tristan Van Berkom2018-04-121-29/+59
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes cross junction tracking disabled by default, which was the initial intention when landing project.refs but never got around to doing this (intended to get addressing of junctioned elements via command line sorted first, but didnt happen). This adds the following options to enable cross-junction tracking: o bst build -J / --track-cross-junctions o bst fetch -J / --track-cross-junctions o bst track -J / --cross-junctions This also fixes `bst fetch --track` which had a bug, it was avoiding to track and fetch elements which are in a `cached` consistency state, which is wrong when `--track` is specified. This also updates some test cases which were broken by this change. This fixes issue #354
* _workspaces.py: Remove knowledge of Elements completelyTristan Van Berkom2018-04-101-15/+10
| | | | | | | | | | | | | This makes workspaces more cleanly separated from everything else. o Removed some methods from Workspace() o Added Element._open_workspace() to initialize workspaces on sources o Cleanup some code in the pipeline o Have the App() call Element._open_workspace() instead of Workspace.open()
* element.py: Cache source consistency logic and refactor workspace logic into ↵Tristan Van Berkom2018-04-091-2/+2
| | | | | | | Element Workspaces are now element wide, so consistency edge cases must be handled at the element level instead of the source level.
* _platform package: Adhere to policy on private symbolsTristan Van Berkom2018-04-051-1/+1
| | | | This is a part of issue #285
* _pipeline.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-031-267/+334
| | | | This is a part of issue #285
* _project.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-031-7/+7
| | | | | | | | | | | | | | | And adjust all surrounding sources for changed symbols. Additional details: o Added Project.get_shell_config() to report the shell configuration, instead of making those members all public o Moved assertions about project specified format versions required of plugins out of Plugin.__init__, and into Project.create_element() and Project.create_source(), so we can keep more things private This is a part of issue #285
* _context.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-031-5/+5
| | | | | | And adjust all surrounding sources for changed symbols. This is a part of issue #285
* Refactoring of highlevel workspace codeTristan Van Berkom2018-04-021-136/+0
| | | | | | | | | | | | | | | | | | Move all workspace related code out of Pipeline() and into the frontend App() object. Some changes in transition here include: o Workspaces() object methods for looking up and deleting workspaces now take an element name instead of an element. o Share code for partial App() initialization between the `workspace close` and `workspace list` commands o No longer require that an element exist in the project in order to close a workspace This fixes issue #249
* Include initialization time in the total session time of the build logTristan Van Berkom2018-04-011-71/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the frontend App object and touches a few internals. o The scheduler now takes a start time given to it at instantiation time, instead of considering the start time to commence in Scheduler.run() o The App.initialize() method has been swapped out for an App.initialized() context manager. This context manager now takes care of the main start/fail/success messages. For convenience and ensured consistency, this context manager is now responsible for: o Printing the startup heading o Printing the end of session summary o Exiting with a consistent error status in case of errors o The Pipeline() object no longer prints the start/fail/success messages, as they are now taken care of by the App() o The cli.py frontend code is much simplified by using the new context manager, also enforcing consistency in how we handle and report errors. This fixes issue #186
* Make workspaces use objects instead of pipeline helper methodsTristan Maat2018-03-271-20/+18
|
* Remove unused importsJürg Billeter2018-03-251-1/+1
|