annotate simpypi.txt @ 82:f974c6d79804 default tip

lost and found
author Jeff Hammel <k0scist@gmail.com>
date Tue, 19 May 2015 21:02:59 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
82
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
1 Internal Python Package Index for Build Infrastructure
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
2
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
3 In working on https://bugzilla.mozilla.org/show_bug.cgi?id=701506 ,
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
4 create python package webserver,
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
5 I have explored several different solutions. In short there are
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
6 many different python packages available for doing such a thing, none
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
7 of which I found completely appropriate to our needs.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
8
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
9 My goals for this project are:
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
10
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
11 - get the build infrastructure able to depend on python packages (vs
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
12 having each package having to be either deployed to each slave or
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
13 having to bundle them a la
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
14 http://hg.mozilla.org/build/talos/file/8197dc094fe3/create_talos_zip.py
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
15 which does not scale)
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
16
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
17 - being able to declare python dependencies in the conventional way:
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
18 you declare ``install_requires`` as part of the ``setup`` function
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
19 and e.g. ``python setup.py develop`` should grab the dependencies
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
20 and versions it needs from a package index
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
21
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
22 - avoid hitting outside networks. Tests should not fail because
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
23 e.g. pypi.python.org is down. We should not depend on this or any
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
24 other networks being fast or up at all.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
25
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
26 - being easy to upload new versions
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
27
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
28 - being easy to maintain
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
29
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
30 To this end, I wrote simpypi, as detailed in:
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
31 http://pypi.python.org/pypi/simpypi
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
32
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
33 Since it is likely that whatever is done for a first iteration will
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
34 not prove the solution we want to go with down the line, and instead
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
35 will be more of a talking point for developing a long-term solution, I
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
36 have decided to make the initial version of simpypi as simple as
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
37 possible. To this end, I made the following architecture choices:
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
38
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
39 - The simpypi GET view is just a file upload widget in a static HTML
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
40 form. We may want to add more to this page, such as a listing of
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
41 packages.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
42
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
43 - simpypi currently does nothing to get packages from pypi. Whether
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
44 it should or not depends on our needs.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
45
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
46 - there is no authentication. While the simple index may be served
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
47 within and outside of the build system without security impact, I
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
48 have been laboring under the assumption that file upload will be
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
49 protected by VPN. Other auth methods could also be considered
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
50
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
51 Other issues are described in the documentation:
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
52 http://k0s.org/mozilla/hg/simpypi/file/tip/README.txt
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
53
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
54 In crafting simpypi, I've realized that the simple index and the
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
55 upload mechanisms are actually uncoupled: the former serves a package index
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
56 for installation, the latter takes an upload an puts it in an
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
57 appropriate place in a directory. This uncoupling gives significant
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
58 flexibility with respect to deployment or development. For instance,
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
59 the simpypi piece can be swapped out as long as the simple index
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
60 directory server continues to work.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
61
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
62 I initially (and still, to a lesser degree, continue) to investigate
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
63 https://github.com/SurveyMonkey/CheesePrism . CheesePrism is a
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
64 heavier solution (although, compared to my survey of existing python
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
65 package index solutions, it is not that heavy) that centers on taking
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
66 packages from pypi.python.org for population. As best I can tell,
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
67 this is not really what we want from a Mozilla package server: not
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
68 all of the packages we want or need are on pypi.python.org and the
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
69 workflow proscribed by such a solution is probably undesirable to us.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
70 I initially hoped to add more options to CheesePrism, but bug fixes
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
71 and turnarounds have been slow.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
72
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
73 You can see active simpypi at http://k0s.org:8080 for the upload page
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
74 and http://k0s.org:8080/index/ for the index page. I have uploaded
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
75 mozbase and a few other packages as a demonstration. If you want to
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
76 test, deploy a new virtualenv and run e.g.
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
77
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
78 easy_install -i http://k0s.org:8080/index/ mozrunner
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
79
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
80 Note that the packages come from k0s.org:8080 .
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
81
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
82 You can see an active CheesePrism instance at http://k0s.org:6543/
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
83
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
84 Note that this is a POC and is intended as a talking point more than a
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
85 final solution. A basic package index can be realized using tarballs
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
86 served with a static fileserver, but we need to have a machine to do
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
87 it on. We should also figure out our network needs: the package
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
88 index must be usable via the build infrastructure, but can also be
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
89 publicly available. The web UI for uploading packages, be it simpypi
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
90 or other, should be behind a VPN. The build infrastructure needs to
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
91 drastically begin to change to start installing dependencies from this
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
92 system vs. what we do now (which is largely work around the lack of a
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
93 package index).
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
94
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
95 We need to figure out what we want to do and drive this effort
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
96 forward. I can work on deployment issues if we come up with a system
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
97 that I am comfortable administrating and have a computer to put it
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
98 on, though I'm not necessarily ideal for the job. The web UI for
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
99 uploading packages should be worked through -- I give the simplest
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
100 possible model, though it can no doubt be improved. That said, the
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
101 web UI is not necessary for serving packages now, though a computer
f974c6d79804 lost and found
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
102 and a static fileserver is.