Skip to content

Community server: Making a release

Erik Hesselink edited this page Apr 22, 2014 · 3 revisions

This page describes how to make a release of the Hackage server and how to update the instance running on http://hackage.haskell.org/.

Notes on the server setup

First, make yourself familiar with the server layout.

Updating the central-server branch

We use a special branch of the public git repo for the central hackage.haskell.org instance. We keep it as a public branch so that everyone can see and contribute to any bits that are specific to the central instance (like doc pages, special config etc).

So the first step is to bring the central-server branch up to date with the master branch. Get a checkout of the hackage-server git repo and merge from the master branch into the central-server branch. We try to avoid differences in the code, just the docs and other ancillary stuff, so there should not be any tricky conflicts. Please commit your merge change to the upstream repo, especially if you had to do any non-trivial merge.

Building the release

Of course best practice is to build on one machine and deploy to the server. You're welcome to do that if you have a matching system. Otherwise, you're welcome to build on the server. The instructions below are for building on the server.

The current version of ghc the on the server (in /usr/local/bin/) is 7.6.3. A recent version of cabal is also kept in /usr/local/bin/. If you need to update either/both of these then see below for additional important notes.

Get yourself a checkout of the central-server branch in your home dir on the server

cd ~/build/hackage-server  # or wherever you want build it
cabal update               # if necessary

nice cabal install --only-dependencies [--dry]
nice cabal configure --prefix=/srv/hackage --bindir=/srv/hackage/lib/
nice cabal build
cabal copy --destdir=./image/

Deploying the release

We currently deploy the binaries and the data files in different ways.

Currently this is not a very useful distinction since the server caches the the templates, but if we just add a feature to notify the server to re-read them then we could deploy updated data files without updating or restarting the server.

The /srv/hackage/var/server/datafiles is just a symlink to /srv/hackage/git/public/datafiles. So to update the data files, do a git pull in /srv/hackage/git/public (which is the central-server branch of course).

cd /srv/hackage/git/public
git pull

For the binaries, we have a simple install script:

cd ~/build/hackage-server  # or wherever you were building it
/srv/hackage/git/private/scripts/install.sh

This will:

  • Copy over the new binaries to /srv/hackage/lib.
  • Stop hackage-build
  • Restart hackage-server, wait 2min.
  • Restart hackage-build

Which should perform a full upgrade.

The server will give a 503 page while its starting. If you're paranoid, you can follow the startup progress via tail -f /srv/hackage/log/server/log.

Testing

TODO

Starting a testing instance

To run on http://beta.hackage.haskell.org.

hackage-server run \
  --port=8082 \
  --ip=127.0.0.1 \
  --base-uri=http://hackage.haskell.org:82 \
  --state-dir=/home/hackage-test/state/ \
  --static-dir=/srv/hackage/var/server/datafiles \
  -v \
  --tmp-dir=/home/hackage-test/state/tmp

Uploading the package to Hackage

TODO

Tagging the release in Git

TODO