Diff for "Code/HowToUseCodehostingLocally"

Not logged in - Log In / Register

Differences between revisions 1 and 16 (spanning 15 versions)
Revision 1 as of 2009-07-21 05:44:31
Size: 2603
Editor: mwhudson
Comment:
Revision 16 as of 2021-12-09 10:57:23
Size: 2937
Editor: jugmac00
Comment: `dev` is `test` now
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

'''Note:''' This guide is for bazaar hosting. For git hosting, see [[https://git.launchpad.net/turnip/tree/README.rst|the turnip README]].
Line 7: Line 9:
Various parts of the codehosting system require that Apache is configured appropriately. If launchpad.dev works at all for you, you've probably already done this, but if it doesn't work, running {{{sudo make install}}} from the root of your launchpad tree should configure things appropriately. Various parts of the codehosting system require that Apache is configured appropriately. If launchpad.test works at all for you, you've probably already done this, but if it doesn't work, running {{{sudo make install}}} from the root of your launchpad tree should configure things appropriately.
Line 11: Line 13:
Getting all the servers that need to be running started is as simple as running {{{make run_all}}} in the root of your Launchpad tree.

== (Intermission) ==

After {{{make run_all}}} gets going, you might notice that the terminal you're running it it gets filled up with spam like this:

{{{
127.0.0.88 - "" "xmlrpc-private.launchpad.dev:8087" [21/Jul/2009:12:02:45 +1300] "POST /mailinglists HTTP/1.0" 200 392 4 0.0119841098785 14 46 "Anonymous" "MailingListApplication:MailingListAPIView" "" "xmlrpclib.py/1.0.1 (by www.pythonware.com)"
}}}

You can shut this up by running {{{killall mailmanctl}}}.
Getting all the servers that need to be running started is as simple as running {{{make run_all}}} or {{{make run_codehosting}}} in the root of your Launchpad tree.
Line 25: Line 17:
Two options. The sensible one is to run {{{./utilities/make-lp-user <your real launchpad id>}}}, as then you can use {{{lp://dev/}}} shortcuts. First ensure you have an mta installed e.g. postfix.
If
you run {{{./utilities/make-lp-user <your real launchpad id>}}}, you can use {{{lp://test/}}} shortcuts.
Line 27: Line 20:
The other option is to use the only user in the sample data to have an ssh key set up -- 'sabdfl'. Running the rocketfuel-setup script should have set this up for you -- try {{{sftp bazaar.launchpad.dev}}}. You can also use the 'mark' launchpad user, the only user in the sample data with an ssh key set up, but it's probably best not to these days.
Line 34: Line 27:
bzr push -d <some branch> lp://dev/~<you>/+junk/branchname bzr push -d <some branch> lp://test/~<you>/+junk/branchname
Line 37: Line 30:
If you're using the sabdfl account, there's a bit more typing to do: You might have to add the following to ~/.ssh/config:
Line 40: Line 33:
bzr push -d <some branch> bzr+ssh://bazaar.launchpad.dev/~sabdfl/+junk/branchname Host bazaar.launchpad.test
 Port 5022
 Hostname launchpad.test
Line 45: Line 40:
At this point the branch is just in the 'hosted area', and needs to be ''pulled'' (copied to the mirrored area, where anonymous and read only access to the branch is served from) and ''scanned'' (data about the branch copied into the Launchpad database). At this point the branch is just in the 'hosted area', and needs to be ''scanned'' (data about the branch copied into the Launchpad database).
Line 47: Line 42:
On production, this happens via the magic of cron. Locally you can make it happen by running {{{make sync_branches}}}. On production, this happens via the magic of cron. Locally you can make it happen by running {{{cronscripts/process-job-source.py IBranchScanJobSource}}}.
Line 49: Line 44:
Now you have a fully working and up-to-date branch -- you should be able to look at the branch page in Launchpad, view the source in codebrowse, Now you have a fully working and up-to-date branch -- you should be able to look at the branch page in Launchpad, view the source in codebrowse, and so on.

== Troubleshooting ==

 * If you have troubles pushing to a local code hosting instance with an error like below, the stale {{{/var/tmp/launchpad_forking_service.sock}}} might be the problem. Remove it and restart code hosting.
{{{
    $ bzr push lp://test/~danilo/translated/trunk
    exec request failed on channel 0
    bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.
}}}
 * If you are receiving connection refused to port 5022, in `configs/development/launchpad-lazr.conf`, under the `[codehosting]` heading, amend the line:
{{{
    port: tcp:5022:interface=127.0.0.88
}}}
to
{{{
    port: tcp:5022:interface=0.0.0.0
}}}
Alternatively, push from within the container.

How To Use Codehosting Locally

Note: This guide is for bazaar hosting. For git hosting, see the turnip README.

Just as it's possible to run the launchpad web application locally, it is also possible to run the complete codehosting stack on your development machine. The main awkwardness is that you have to manually kick off some of the things that are usually done by cronjobs.

Make sure Apache is set up

Various parts of the codehosting system require that Apache is configured appropriately. If launchpad.test works at all for you, you've probably already done this, but if it doesn't work, running sudo make install from the root of your launchpad tree should configure things appropriately.

Get things running

Getting all the servers that need to be running started is as simple as running make run_all or make run_codehosting in the root of your Launchpad tree.

Set up a user

First ensure you have an mta installed e.g. postfix. If you run ./utilities/make-lp-user <your real launchpad id>, you can use lp://test/ shortcuts.

You can also use the 'mark' launchpad user, the only user in the sample data with an ssh key set up, but it's probably best not to these days.

Push up a branch

If you ran make-lp-user, this is just a few more keystrokes than pushing a branch to launchpad:

bzr push -d <some branch> lp://test/~<you>/+junk/branchname

You might have to add the following to ~/.ssh/config:

Host bazaar.launchpad.test
        Port 5022
        Hostname launchpad.test

Pull and scan the branch

At this point the branch is just in the 'hosted area', and needs to be scanned (data about the branch copied into the Launchpad database).

On production, this happens via the magic of cron. Locally you can make it happen by running cronscripts/process-job-source.py IBranchScanJobSource.

Now you have a fully working and up-to-date branch -- you should be able to look at the branch page in Launchpad, view the source in codebrowse, and so on.

Troubleshooting

  • If you have troubles pushing to a local code hosting instance with an error like below, the stale /var/tmp/launchpad_forking_service.sock might be the problem. Remove it and restart code hosting.

    $ bzr push lp://test/~danilo/translated/trunk
    exec request failed on channel 0
    bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.
  • If you are receiving connection refused to port 5022, in configs/development/launchpad-lazr.conf, under the [codehosting] heading, amend the line:

    port: tcp:5022:interface=127.0.0.88

to

    port: tcp:5022:interface=0.0.0.0

Alternatively, push from within the container.

Code/HowToUseCodehostingLocally (last edited 2021-12-09 10:57:23 by jugmac00)