Browse Source

Add Binder setup files (#1603)

* Setup files for Binder tested with mybinder.org.
* Sample data downloaded during the image build on Binder.
* Empty notebook included as a placeholder.
* JupyterLab used on Binder.
* Using standard system setup of GRASS, so grass command works, but anything else needs to be set up.
Caitlin H 3 years ago
parent
commit
019f18d61a
4 changed files with 102 additions and 0 deletions
  1. 36 0
      binder/apt.txt
  2. 34 0
      binder/postBuild
  3. 4 0
      binder/requirements.txt
  4. 28 0
      doc/notebooks/example_notebook.ipynb

+ 36 - 0
binder/apt.txt

@@ -0,0 +1,36 @@
+autoconf2.13
+autotools-dev
+bison
+flex
+g++
+gettext
+libblas-dev
+libbz2-dev
+libcairo2-dev
+libfftw3-dev
+libfreetype6-dev
+libgdal-dev
+libgeos-dev
+libglu1-mesa-dev
+libjpeg-dev
+liblapack-dev
+liblas-c-dev
+libncurses5-dev
+libnetcdf-dev
+libpng-dev
+libpq-dev
+libproj-dev
+libreadline-dev
+libsqlite3-dev
+libtiff-dev
+libxmu-dev
+libzstd-dev
+make
+netcdf-bin
+proj-bin
+sqlite3
+unixodbc-dev
+zlib1g-dev
+p7zip
+imagemagick
+git

+ 34 - 0
binder/postBuild

@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# exit on error
+set -e
+
+# compile
+./configure \
+    --enable-largefile=yes \
+    --with-nls \
+    --with-cxx \
+    --with-readline \
+    --with-bzlib \
+    --with-pthread \
+    --with-proj-share=/usr/share/proj \
+    --with-geos=/usr/bin/geos-config \
+    --with-cairo \
+    --with-opengl-libs=/usr/include/GL \
+    --with-freetype=yes --with-freetype-includes="/usr/include/freetype2/" \
+    --with-sqlite=yes
+make
+
+# put command on path
+# ensure the user specific bin dir exists (already on path)
+mkdir -p $HOME/.local/bin/
+# create link to build
+ln -s $HOME/bin.*/grass* $HOME/.local/bin/grass
+
+# download a sample dataset
+mkdir -p data/grassdata \
+  && curl -SL https://grass.osgeo.org/sampledata/north_carolina/nc_basic_spm_grass7.zip > nc_basic_spm_grass7.zip \
+  && unzip -qq nc_basic_spm_grass7.zip \
+  && mv nc_basic_spm_grass7 data/grassdata \
+  && rm nc_basic_spm_grass7.zip
+  

+ 4 - 0
binder/requirements.txt

@@ -0,0 +1,4 @@
+numpy
+matplotlib
+Pillow
+ply

+ 28 - 0
doc/notebooks/example_notebook.ipynb

@@ -0,0 +1,28 @@
+{
+ "metadata": {
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": 3
+  },
+  "orig_nbformat": 2
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ]
+}