Gentoo Archives: gentoo-soc

From: "Andreas Nüßlein" <nutz@×××××.de>
To: gentoo-soc@l.g.o
Subject: [gentoo-soc] Fwd: wacfg midterm report
Date: Fri, 16 Jul 2010 19:11:23
Message-Id: AANLkTil2hDz5BuhjI1_31_Nace2XHcOgfMV67X_b1RDQ@mail.gmail.com
1 Hi all,
2
3 This is my 'wacfg' midterm report. Hopefully I'll be able to post
4 weekly status updates from now on.
5
6 Abstract:
7 wacfg is supposed to be a replacement for the old webapp-config for Gentoo.
8 webapp-config is the web application installer and updater on gentoo.
9 it currently has many issues and bugs,
10 and its design has some serious flaws. fixing the current mess would
11 be a waste of time. instead it should be
12 reimplemented, possibly in a distro-agnostic manner.
13
14 Status:
15 For my proposal I created a Gantt-Timechart [1] which helped me give a
16 general idea when I was expecting to be
17 done with what. Eventhough I haven't looked at it for a while, I
18 realised a few days ago that my progress stuck pretty
19 neatly to the timeline - the following are done so far:
20
21 - Evaluation of package formats / Parser for selected package format
22        After some evaluation, we, Benedikt and I, realized that
23 creating an own format would be overkill
24        and I'd rather create a syntax that is similar to that of
25 'setuptools' (from Python).
26        What i came up with is the following:
27        Portage (or later on apt-get) will simply copy the
28 source-tarball and a special wacfg.py-'configfile'
29        into /usr/share/webapps/$webapp/$version/. Afterwards the
30 wacfg CLI will handle the installation to the
31        correct vhost (even if it is simply "localhost"). See below
32 for some examples.
33
34 - Installation fo application instances:
35        Works. I started testing with wordpress, joomla and phpBB,
36 which all worked out of the box.
37        More web-application will obviously be tested, as mentioned in
38 the Gantt.
39
40 - Configurating instances:
41        I started writing tools for that, e.g. "chmod", "chown" and
42 "server_own" (which will give permissions
43        to the server-user). I will create more tools as the need
44 arises when I'm evaluating more webapps.
45
46 - Upgrading instances:
47        Works. In an installed webapp-instance a file
48 .wacfg-$webapp-$version is created with the files' checksums
49        (just like in webapp-config). Just like portage, when a file
50 has been manually changed, wacfg renames the new
51        file to ._cfg????_file and copies it into the same location.
52 Afterwards etc-update or dispatch-conf can be used
53        to run diffs on these files.
54        Not yet included is a fully automated upgrade of all installed
55 instances. Obviously this is an upcoming feature.
56
57
58
59 wacfg.py-format:
60
61 Example 1:
62 -------------------------
63 from WaCfg import main
64
65 main(source='webapp-version.tar.bz2')
66 -------------------------
67 This should work on most packages as it will unpack the tarball into a
68 sandbox, and move them to the given
69 location (/var/www/vhost/htdocs/installdir).
70
71 Example 2:
72 -------------------------
73 from Wacfg import main, WaCfg, tools
74 class MyApp(WaCfg):
75        def src_unpack(self):
76                tools.archive_unpack()
77                some other stuff..
78        def src_config(self):
79                tools.chmod(0700, certainfile)
80                tools.chown('otherserveruser')
81        def post_install(self):
82                print("Do stuff after installing... e.g. create a
83 database-user like so:... yada yada yada")
84
85 main(MyApp)
86 -------------------------
87 This example won't work like that and it's only supposed to show the
88 general idea... As I said: more tools need
89 to be defined for convenience.
90
91
92
93 About the author:
94 My CV can be found on my website [2].
95 I've been somewhat active in the Open Source community for years now
96 (writing a few bugtracker reports, minor patches,
97 ebuilds...) ; I've been using Gentoo since 2005 and I don't see a
98 reason to change that anytime soon. Also I joined
99 the Gentoo e.V. earlier this year.
100
101
102 1 - http://nutz.noova.de/gsoc-gantt.png
103 2 - http://nutz.noova.de/cv.pdf
104
105
106 Cheers,
107 Andy