Merge lp:~hazmat/pyjuju/auto-magic-dependency-spec into lp:pyjuju

Proposed by Kapil Thangavelu
Status: Merged
Merged at revision: 241
Proposed branch: lp:~hazmat/pyjuju/auto-magic-dependency-spec
Merge into: lp:pyjuju
Diff against target: 116 lines (+112/-0)
1 file modified
docs/source/specifications/auto-dependency.rst (+112/-0)
To merge this branch: bzr merge lp:~hazmat/pyjuju/auto-magic-dependency-spec
Reviewer Review Type Date Requested Status
Gustavo Niemeyer Needs Fixing
Review via email: mp+53865@code.launchpad.net

Description of the change

A spec describing the resolution of dependencies and the basic interaction with remote repositories.

To post a comment you must log in.
178. By Kapil Thangavelu

start documenting implementation approach to dependencies.

179. By Kapil Thangavelu

go into some details into internals of dependency resolution and deployment.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Kapil, here is some feedback on the spec. Let's freeze the work on automatic
dependencies for the moment, and focus on upgrades, so that we get one thing
done well at a time. We have two specs but neither of them feels close to being
ready, and you won't be able to code these two things at once either way.

[1]

97 +implementation details of a repository. The multi dict ordering is
98 +manipulated after any given result to allow for the origin repository
99 +of the most recent result to be in the front of the lookup order. The
100 +default order per user configuration is stored separately and
101 +resumable as needed.

This whole sentence is extremely dense, and mixes algorithms with storage
format with server implementation with a number of other things, making it
very hard to follow.

We need something which is significantly simpler and better structured.

E.g. What are the specific new concepts being introduced into the code base,
and how do they relate with what's already in place. What are the specific
queries which a repository must answer, and what is the specific information
being sent back in the response. How will the namespacing issues we've
talked about influence the way in which dependencies are automatically
selected. What happens when there are existing services deployed. How to
pick specific formulas/service names for solving certain dependencies.
And so on.

But for now, let's freeze that spec, and focus on upgrades. Pushing these
two big concepts at the same time is not working.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'docs/source/specifications/auto-dependency.rst'
2--- docs/source/specifications/auto-dependency.rst 1970-01-01 00:00:00 +0000
3+++ docs/source/specifications/auto-dependency.rst 2011-03-21 16:29:52 +0000
4@@ -0,0 +1,112 @@
5+Installing Dependencies
6+=======================
7+
8+One of the key features for ease of use when utilizing in ensemble is
9+the ability to have it fetch and deploy formulas from remote
10+repositories with dependency resolution. Ie. invoking::
11+
12+ ensemble deploy wordpress
13+
14+Will lookup a formula named wordpress in the configured remote formula
15+repositories, and should pick up any required interfaces of wordpress
16+and satisfy those dependencies within the environment if they don't
17+already exist.
18+
19+This last part is key, as it embodies ensemble moniker as a network
20+enabled apt, where dependency resolution of installed packages is
21+satisifed by services available within the local network/environment.
22+
23+Ensemble allows for multiple formula repositories to be utilized when
24+searching for formulas, unlike apt where multiple repositories are
25+overlayed into a single global namespace, ensemble provides for
26+each repository as an independent namespace. ie. Once a package is
27+installed from a repository, it will not be upgraded automatically
28+by a newer version in a different repository. Updates will only
29+be detected against its origin repository, unless explicitly modified
30+by the user.
31+
32+Dependencies are not looked up directly by formula name, but by
33+interface names, which is also how dependencies are expressed. In the
34+example above wordpress requires something providing the mysql
35+interface. Ensemble will first attempt to satisfy this dependency by
36+examining the services already deployed within the environment to
37+determine if any of them provide the required interface.
38+
39+If the interface dependency cannot be satisified from the local
40+environment, the repository of the formula which specified the
41+dependency will be utilized. So in the case of deploying a wordpress
42+formula, the repository that contains the wordpress formula would be
43+searched next for a formula that provides the required dependency,
44+mysql, if one was not already present in the environment.
45+
46+If the required dependencies are not found in this repository,
47+ensemble fallbacks to its repository lookup algorithm, searching each
48+repository in turn for the dependency. The repository lookup algorithm
49+can be configured by the user in their environment configuration. It
50+defaults to searching any command line specified formula directories
51+or repositories, and then the central ubuntu formula repositories.
52+The user may specify additional private or public repositories in
53+their environment configuration.
54+
55+
56+Repository Interaction
57+======================
58+
59+Remote repository communication is modeled as a collection of REST
60+resources exposed over HTTP. All resources respond with proper cache
61+headers (If-Modified-Since and E-tag) to allow for efficient
62+detection of changes. The formulation as a collection of REST
63+resources should provide for both the use of a smart formula
64+repository server, as well as just a directory exposed over http.
65+
66+The path to a formula in a repository::
67+
68+ <repo_url>/formulas/<formula_id>
69+
70+which returns the zipped formula archive.
71+
72+Formulas can be queried by the interface they provide via examining the
73+interface location.
74+
75+ <repo_url>/provides/<interface_name>
76+
77+The returned resource contains urls to a formula one per line. The
78+return of fully qualified urls to formulas is to assist in the
79+implementation of a smart server that might serve as an aggregate over
80+multiple formula repositories (ie. community contrib/ppa).
81+
82+Additional command line utilities are provided to turn a formula of
83+directories into a formula repository.
84+
85+
86+Internals
87+=========
88+
89+An ordered multi dict variation is utilized for dependency resolution,
90+with each layer of the multi dict representing a named
91+repository. Keys into the multidict are the provide interface
92+names. Results returned are a sequence of repository name, and the
93+formula urn for eaching matching result. Internally each repository
94+presents a retrieval interface to return formulas by interface. The
95+internal mechanics of querying this resource, caching values, and
96+applying any ordering when multiple results are found are left as
97+implementation details of a repository. The multi dict ordering is
98+manipulated after any given result to allow for the origin repository
99+of the most recent result to be in the front of the lookup order. The
100+default order per user configuration is stored separately and
101+resumable as needed.
102+
103+The dependency resolution process is started by examining the required
104+interfaces of the formula to be deployed. These populate a deploy dependency
105+dictionary, with key of provides to depend list values. The dependency
106+values are iteratively resolved via the repository ordered multi dict
107+via topological sorts with population of formula names into a deploy
108+formula dict.
109+
110+After fully solving all required dependencies, the system goes about
111+downloading the formulas into the environment, and deploying them
112+each in turn with relations.
113+
114+
115+
116+

Subscribers

People subscribed via source and target branches

to status/vote changes: