Haskell Cloud is an OpenShift cartridge for deploying Haskell on the open source PaaS cloud. It includes:
- gold linker
Haskell Cloud is built in various flavours, with different pre-installed packages. See the Haskell wiki for details and installation links.
cabal file must define an executable called
server, which takes two command line arguments; the IP address and port number to listen on. (These can also be take from
$OPENSHIFT_HASKELL_PORT.) When new code is pushed to the application's repository, the cartridge will build it with
cabal install, then start the server. The server will be sent the
SIGTERM signal when the cartridge receives the stop command.
Paths_ module is likely to return the wrong paths, as the program may not be running on the same gear that built it (#462, #1542). Use the relevant Openshift environment variables instead.
Cabal does not automatically install
build-tools (#220). They can be installed by temporarily adding them to
build-depends. If they are installed directly on the server over ssh, any absolute paths in the database entries (
.conf) of newly installed packages should be made relative to
cabal_update marker (see below) will run
cabal update before every build. Ad-hoc updates can be performed with
rhc ssh <app> 'cabal update'.
cabal test are logged to
$OPENSHIFT_LOG_DIR (remember to
hFlush stdout after each log message, or
hSetBuffering stdout LineBuffering). These logs are piped through logshifter, and are automatically rotated.
Other logs may be written to
$OPENSHIFT_LOG_DIR as desired.
tidy command will delete all haskell-* logs, cabal's cache of downloaded packages, and the repository working directory. Installed packages (and binaries) are not deleted.
Markers can be created in
.openshift/markers to modify the build process. See README for details.
Pre-built cartridges can be installed from the links in the Haskell wiki. To build from source:
- Clone the repo onto an OpenShift gear. You can use the Jenkins git plugin for this.
$buildto one of the values in the
caseblock in build.
trueto create a cartridge called dev, with no cartridge locks. Any other value will create a production cartridge.
.openshift/package. The manifest and zip will be created in