[cl-dwim-devel] cl-dwim questions
Attila Lendvai
attila.lendvai at gmail.com
Sat Feb 28 12:32:55 UTC 2009
hello Rommel,
(i cc the list because it contains some useful info. others reading
this should ignore the stuff related to ebr42...)
> * What is the most natural and/or ideal way to start up cl-dwim? Is
> there more than one way of starting up cl-dwim?
this is how we start our unix service:
cl-dwim/utils/build-image.lisp
driven by a shell script: ebr42/bin/build-image
and the init.d script is: ebr42/etc/init-script
for how it is started when we are testing it locally see what this does:
(progn
(asdf:find-system :ebr42-test)
(asdf:oos 'asdf:load-op :ebr42-nafi-test))
(although i just changed the load-op locally to (asdf:oos
'asdf:test-op :ebr42-nafi) because it's a bad idea to do random
sideffects from a load-op, even if it's a test system)
the interesting parts are around the (block running ...) in the
toplevel function, startup-cluster-node and shutdown-cluster-node
ebr42-nafi and ebr42-honti are basically two applications running from
the same repository. they are very similar apps for two ministries
sharing much of the code.
> * What else are required aside from the libraries that you mentioned
> in an earlier mail?
hm... i think currently the stuff around cl-dwim pretty much expects a
postgresql connection and a minimally set up database. e.g.
startup-cluster-node looks for (machine-instance) among the
cluster-node persistent instances associated to the given cluster
(named "test" when started in test mode, "production" otherwise).
see the first parts of recreate-model-data in src/io/import.lisp
> * You mentioned that cl-dwim needs to connect to a database so that
> it could run properly? Specifically, what kind of database
> connectivity is it? How should it be setup? Is this database a must
> for cl-dwim to run?
at the moment it's a must, but it's not inherently required. i think
if you don't need the persistent process scheduler then it should be
possible to start only the web service alone, without a database
connection.
db setup:
# to initialize a db with a different locale (only for locale
dependent sorting, etc, not needed normally)
sudo localedef -f UTF-8 -i hu_HU hu_HU.UTF-8
sudo su - postgres
mkdir ~/bin
ln -s /usr/share/postgresql-common/pg_wrapper ~/bin/initdb
~/bin/initdb --pgdata=/var/lib/postgresql/8.3/main/ --encoding="UTF-8"
--locale="en_US.UTF-8" --lc-collate="hu_HU.UTF-8"
--lc-ctype="hu_HU.UTF-8"
ln -s /etc/postgresql-common/root.crt /var/lib/postgresql/8.3/main/root.crt
ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem
/var/lib/postgresql/8.3/main/server.crt
ln -s /etc/ssl/private/ssl-cert-snakeoil.key
/var/lib/postgresql/8.3/main/server.key
dropdb ebr42-nafi
createdb ebr42-nafi
createuser -d -l -P ebr42
db password is "szupertitok" by default.
> * Istm, that there some stuff are hardcoded in cl-dwim's source files
> that is somehow related to your environment (for example,
> dwim-system:*developer-machine-names*). Are such things in the code
> negligible if one wants to run cl-dwim outside your environment or
> some modifications must be made to the code (Kambiz?)
we have a repo called "environment" under cl-dwim, but it's mostly
unrelated and can be ignored.
dwim-system:*developer-machine-names* is used for various decisions,
mostly the ones that help debugging/developing when started on our own
machines (e.g. fake login buttons, even when running in test mode, are
only shown on dev machines).
> * Since there are no formal documentation written for cl-dwim (afaik),
> can you give me some pointers on how to proceed next or if I ever
> have questions like these, so I can try to figure out things myself
> before asking questions.
the ideal solution would be an application that can be started up and
played with. unfortunately ebr42 is not a good candidate, because it's
big'n'convoluted, and contains stuff that is kinda private.
Kami, can you maybe help in this regard? how secret is your project,
could it be shared as a less convoluted example maybe?
as time permits i'll update our blog code, which would be an ideal
example project, but i doubt i'll have free hacking time for that in
the near future...
it's available at the link below, but its revive is half done, so it's
only here for reference:
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cl-dwim-cl-dwim-blog;a=summary
> Thank you for reading and have a nice day.
hope this helps a bit,
--
attila
More information about the cl-dwim-devel
mailing list