Can loggerhead serve up multiple repositories

Asked by jrenbaum on 2009-08-21

We use Launchpad for our open source development, but need to set-up a central server for internal (private) development. We envisioned each project being a separate repository with its own release cycle and development branches. Is there a way to configure loggerhead to serve up multiple repositories or do we need to create one repo with multiple projects?

In the Bazaar docs one of the listed "preferred" ways to set-up Bazaar is:

project1/ # A repository for project1
 +- trunk/ # The mainline of development of project1
 +- branches/ # A container directory
     +- foo/ # Branch for developing feature foo of project1
       ...

project2/ # A repository for project2
 +- trunk/ # Mainline for project2
 +- branches/ # Container for project2 branches

Bassically, I am asking if this can this be supported with Loggerhead?

Thanks,

Jay

Question information

Language:
English Edit question
Status:
Solved
For:
loggerhead Edit question
Assignee:
No assignee Edit question
Solved by:
Michael Hudson-Doyle
Solved:
2009-08-26
Last query:
2009-08-26
Last reply:
2009-08-26
Martin Albisetti (beuno) said : #1

Hi Jay,

At the moment, Loggerhead doesn't support serving from different two or more different locations.
What you can do, is serve from the top level directory, so, lets say you have:

/home/projects/project1
/home/projects/project2

If you run: serve-branches /home/projects/

It will show you a listing of all projects, which you can navigate into. There are config options available now in loggerhead to block out certain projects if you need to do so.

jrenbaum (jrenbaum) said : #2

Martin,

Are you implying that project1 and project2 are both unique repositories and "projects" is simply a directory that Loggerhead starts at?

Jay

Yes, that's what he meant.

jrenbaum (jrenbaum) said : #4

Thanks Michael Hudson, that solved my question.

kgraefe (konradgraefe) said : #5

I know that it is an ancient thread, but the solution doesn't work for me. :(

This is my environment:

kgraefe@paktolos:~/bazaar> serve-branches --version
loggerhead 1.17
kgraefe@paktolos:~/bazaar> pwd
/home/kgraefe/bazaar
kgraefe@paktolos:~/bazaar> find . -iname .bzr
./Forschungsarbeit/.bzr
./HeuristischeVerfahren/.bzr

The web server runs, but the web page says "The resource could not be found."
These are the commands I tried:
serve-branches .
serve-branches $(pwd)
sudo serve-branches $(pwd)
sudo serve-branches .

I am on Debian 6 but with sudo enabled. "serve-branches Forschungsarbeit/" works but I wan't all projects to be served.

John A Meinel (jameinel) said : #6

Can you try "bzr serve --http" instead of "serve-branches" ?

kgraefe (konradgraefe) said : #7

That works.

The goal is to use it as a service but I think I can modify the init script. Thank you.

kgraefe (konradgraefe) said : #8

Somehow it works with "serve-branches" too, hm.

Ľubomír Mlích (hater-zlin) said : #9

Hi,

i would like to do the same with loggerhead 1.18.1 but im not successful

This is functional:
serve-branches --trunk-dir=/var/tmp/bzr-test/project1 --user-dirs
serve-branches --trunk-dir=/var/tmp/bzr-test/project2 --user-dirs
bzr serve --http --directory /var/tmp/bzr-test/project1/

This is not:
bzr serve --http --directory /var/tmp/bzr-test/
serve-branches /var/tmp/bzr-test/project1
serve-branches /var/tmp/bzr-test

With debug:
serve-branches --log-level=debug ./project1/
DEBUG:paste.httpserver.ThreadPool:Started new worker -1220605120: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1231029440: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1241515200: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1252000960: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1260393664: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1268786368: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1277179072: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1285571776: Initial worker pool
serving on 0.0.0.0:8080 view at http://127.0.0.1:8080
DEBUG:paste.httpserver.ThreadPool:Started new worker -1293964480: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1302357184: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Added task (0 tasks queued)
INFO:loggerhead:127.0.0.1 - - [31/Oct/2012:19:24:49 +0200] "GET /changes HTTP/1.1" 404 - "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0"
^CINFO:paste.httpserver.ThreadPool:Shutting down threadpool
DEBUG:paste.httpserver.ThreadPool:Worker -1241515200 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1231029440 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1252000960 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1268786368 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1260393664 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1293964480 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1285571776 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1220605120 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1277179072 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1302357184 asked to SHUTDOWN
INFO:paste.httpserver.ThreadPool:All workers stopped
INFO:paste.httpserver.ThreadPool:Shutting down threadpool
INFO:paste.httpserver.ThreadPool:All workers stopped

 serve-branches --trunk-dir=/var/tmp/bzr-test/project1 --user-dirs --log-level=debug
DEBUG:paste.httpserver.ThreadPool:Started new worker -1220269248: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1229980864: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1240466624: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1250952384: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1259345088: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1267737792: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1276130496: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1284523200: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1292915904: Initial worker pool
DEBUG:paste.httpserver.ThreadPool:Started new worker -1301308608: Initial worker pool
serving on 0.0.0.0:8080 view at http://127.0.0.1:8080
DEBUG:paste.httpserver.ThreadPool:Added task (0 tasks queued)
INFO:loggerhead.project1:built revision graph cache: 0.001 secs
INFO:loggerhead.project1:Getting information for ChangeLogUI: 0.449 secs
INFO:loggerhead:127.0.0.1 - - [31/Oct/2012:19:26:33 +0200] "GET /changes HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0"
INFO:loggerhead.project1:Rendering ChangeLogUI: 0.039 secs, 4153 bytes
DEBUG:paste.httpserver.ThreadPool:Added task (0 tasks queued)
^CINFO:paste.httpserver.ThreadPool:Shutting down threadpool
DEBUG:paste.httpserver.ThreadPool:Worker -1259345088 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1240466624 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1250952384 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1284523200 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1267737792 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1292915904 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1276130496 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1301308608 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1229980864 asked to SHUTDOWN
DEBUG:paste.httpserver.ThreadPool:Worker -1220269248 asked to SHUTDOWN
INFO:paste.httpserver.ThreadPool:All workers stopped
INFO:paste.httpserver.ThreadPool:Shutting down threadpool
INFO:paste.httpserver.ThreadPool:All workers stopped

So I would like to ask, what should I do now? Where to look to discover problem reason?

Thanks for your time.

Ľubomír Mlích (hater-zlin) said : #10

this is not good too:

serve-branches . --profile
Traceback (most recent call last):
  File "/usr/bin/serve-branches", line 27, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/loggerhead/main.py", line 160, in main
    app = make_app_for_config_and_path(config, path)
  File "/usr/lib/python2.7/dist-packages/loggerhead/main.py", line 117, in make_app_for_config_and_path
    from loggerhead.middleware.profile import LSProfMiddleware
ImportError: No module named middleware.profile