How to Install
The user interface allows to run and edit pipelines. It is used through the browser, but doesn’t need to be installed on a web server. This can all happen locally. The code for the scripts, however, is not edited through the UI but rather with a standard text editor such as VS Code or RStudio.
Deploying BON in a Box locally
BON in a Box can be installed and ran on a local computer. While personnal computers have less computing power than servers, it is more convenient for pipeline development, or when working with small examples. Users adding scripts and creating pipelines on their local computer can directly run them through BON in a Box.
Prerequisites :
Git - A github account, with an SSH key registered. See Adding a new SSH key to your GitHub account.
At least 6 GB of free space (this includes the installation of Docker Desktop) - RAM requirements will depend on the scripts that you run.
Windows:
Docker Desktop - Note that it is not necessary to make an account
A Linux shell (git bash, Bash through PowerShell, cygwin, etc.) necessary to run th
.sh
scripts in the instructions below.
Mac:
Docker Desktop Note that it is not necessary to make an account
Make sure docker is added to the path of your terminal. From a terminal, run command
docker run hello-world
. If there is an error message, see https://stackoverflow.com/a/71923962/3519951.If you encounter error
no matching manifest for linux/arm64/v8 in the manifest list entries
, export DOCKER_DEFAULT_PLATFORM. See https://stackoverflow.com/a/76404045/3519951.If you have a Silicon chip, check “Use Rosetta for x86_64/amd64 emulation on Apple Silicon”. See issue #175.
Linux: Docker with Docker Compose installed. It is required to add your user to the docker group.
To run:
Clone repository (Windows users: do not clone the repo in a folder under OneDrive.) This can be done in terminal using the following code:
git clone git@github.com:GEO-BON/bon-in-a-box-pipelines.git
or in GitHub desktop.Provide the environment variables: - Open the newly cloned repository on your computer
Find the file called
runner-sample.env
Duplicate the file and rename the copy to
runner.env
.Fill the properties depending on what you intend to run. Include any API keys that you need to access data (e.g. GBIF or IUCN)
Adjust any server option as you see fit.
Using a linux terminal (terminal on Mac or Git Bash), navigate to the folder of the cloned repository.
In the linux terminal, type
./server-up.sh
Make sure the server is started from a linux terminal that is in the same folder as the cloned repository so it can access the files.
Make sure you have docker open and running on your computer.
The first execution will be long, in order to download the micro-services. The next ones will be shorter or immediate, depending on the changes.
Network problems may cause the process to fail. First try running the command again. Intermediate states are saved so not everything will be redone even when there is a failure.
Windows users may need to turn on virtualization and other tools for Docker Desktop to work and update wsl (“wsl –update”, see https://docs.docker.com/desktop/troubleshoot/topics/#virtualization. Access to the BIOS may be required to enable virtualization)
Type http://localhost/ to open BON in a Box
Run
./server-down.sh
in a terminal to stop the server when doneOn Windows, to completely stop the processes, you might have to run
wsl --shutdown
When modifying scripts in the /scripts
folder, servers do not need to be restarted: - When modifying an existing script, simply re-run the script from the UI and the new version will be executed. - When adding or renaming scripts, refresh the browser page.
When modifying pipelines in the /pipelines folder, servers do not need to be restarted: - In the pipeline editor, click save, paste the file to your file in the pipeline folder and run it from the “pipeline run” page. - When adding or renaming pipelines, refresh the browser page.
Deploying BON in a Box on a server
Installation steps on a server are the same as installing on a Linux computer, but some additional configurations need to be changed:
In
runner.env
, choose the appropriateHTTP_ADDRESS
andHTTP_PORT
for your server configuration. In a typical installation, use 0.0.0.0 as an HTTP address and default port (80).In
runner.env
, select the “partial” cache cleaning mode. This will allow for calculated results to be long-lived on the server, as long as they are not run again with a new version of the script. The results in the output folder are always accessible by URL.The outputs are precious, while the server machine can be re-generated anytime. Consider mounting an external backed-up drive to the output folder of your BON in a Box installation.
By default, BON in a Box listens for http. To enable https, we hide it behind a reverse proxy and activate https with certbot. How to do this is out of scope for this readme.
Running a script or pipeline
You now have an instance of BON in a Box deployed, either locally or remotely, and you want to run your first script or pipeline.
There is one page to run scripts, and one to run pipelines. Once there, select the script or pipelines from the dropdown and fill the form.
The form might ask you for a file. In order to provide a file that you own locally, upload or copy it to the userdata
folder. You can then refer to it with a url as such: /userdata/myFile.shp
, or /userdata/myFolder/myFile.shp
if there are subfolders.