Running on the Cloud#

Docker#

Docker is one of the easiest ways to run Brightway on a server. The Brightway2 Dockerfile is based on the Jupyter minimal-notebook Docker file, and lets you run a notebook server or iPython shell.

To run the Brightway2 Docker file:

  1. Install Docker

  2. Run the Docker file:

docker run -d -p 8888:8888 jupyter/minimal-notebook

Note

This will start a detached container (-d) with port 8888 on your machine forwarded to port 8888 in the container, where the notebook server is listening.

  1. Start an iPython shell:

docker run -i -t --entrypoint ipython cmutel/brightway2

Note

This creates an container with STDIN open (-i) and a TTY shell (-t). Instead of running the start-notebook.sh shell, this uses a different entrypoint.

  1. Alternatively, start a Bash shell:

docker run -i -t --entrypoint bash cmutel/brightway2

Using Data Volumes#

The default data directory in the Docker container is /home/jovyan/data/. You can use an existing data directory by mounting a data volume, e.g.:

docker run -i -t -v "/Users/cmutel/Library/Application Support/Brightway3":/home/jovyan/data --entrypoint ipython cmutel/brightway2

Warning

Compare the Jupyter minimal-notebook documentation for information on how to secure your server using https.

You may also want to mount the following:

directory

description

/home/jovyan/notebooks

directory in which the notebook server starts

/home/jovyan/output

output directory for most Brightway IO functions

Amazon AWS Cloud Nine (C9)#

  1. Create an [Amazon AWS account] to use the Cloud 9 service.

  2. Create a new C9 environment.

  3. Download and install Brightway using the C9 terminal:

wget https://github.com/brightway-lca/brightway2/raw/master/cloud-nine-install.sh && bash cloud-nine-install.sh
  1. Click on Preview > Preview Running Application to open the introductory Brightway notebook. You can also copy/paste the URL into a new tab.