Skip to content
This repository has been archived by the owner. It is now read-only.
OpenShift v2 cartridge for Haskell
Shell HTML Haskell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.openshift
bin
cabal
env
metadata
template
LICENSE
README.md

README.md

Haskell Cloud

Haskell Cloud is an OpenShift cartridge for deploying Haskell on the open source PaaS cloud. It includes:

  • GHC
  • cabal-install
  • gold linker

OpenShift

For a general understanding of the OpenShift environment, consult the Online or Origin user guides.

Installation

Haskell Cloud is built in various flavours, with different pre-installed packages. See the Haskell wiki for details and installation links.

Haskell

The application's 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_IP and $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_

Cabal's autogenerated 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.

Build Tools

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 ${pkgroot}.

Cabal Update

The cabal_update marker (see below) will run cabal update before every build. Ad-hoc updates can be performed with rhc ssh <app> 'cabal update'.

Logging

stdout, stderr and 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.

Tidying

OpenShift's 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

Markers can be created in .openshift/markers to modify the build process. See README for details.

Building

Pre-built cartridges can be installed from the links in the Haskell wiki. To build from source:

  1. Clone the repo onto an OpenShift gear. You can use the Jenkins git plugin for this.
  2. Set $build to one of the values in the case block in build.
  3. Set $dev to true to create a cartridge called dev, with no cartridge locks. Any other value will create a production cartridge.
  4. Run .openshift/build.
  5. Run .openshift/package. The manifest and zip will be created in .openshift.
You can’t perform that action at this time.