From 5b223c7721288b13ac287b50e7bd4c64103086d2 Mon Sep 17 00:00:00 2001 From: Vishwa Shah Date: Thu, 7 Dec 2023 00:49:59 +0000 Subject: [PATCH] feat: add binder --- README.md | 2 +- binder/postBuild | 39 +++++++++++++++++++++++++++++++++++++++ binder/requirements.txt | 14 ++++++++++++++ binder/runtime.txt | 3 +++ binder/start | 19 +++++++++++++++++++ 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 binder/postBuild create mode 100644 binder/requirements.txt create mode 100644 binder/runtime.txt create mode 100644 binder/start diff --git a/README.md b/README.md index 4591a2c..8e74677 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The Open Space Toolkit (**OSTk**) is a collection of versatile libraries for aer Want to get started? This is the simplest and quickest way: -[![JupyterHosted](https://img.shields.io/badge/JupyterLab-white?logo=jupyter)](https://open-space-toolkit-r22wh5qixa-uc.a.run.app/lab/tree/notebooks) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-space-collective/open-space-toolkit/main?urlpath=lab/tree/notebooks) *This will automatically start a [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) environment in your web browser with Open Space Toolkit libraries and example notebooks ready to use. Nothing to download or install! 🚀* diff --git a/binder/postBuild b/binder/postBuild new file mode 100644 index 0000000..54f45dc --- /dev/null +++ b/binder/postBuild @@ -0,0 +1,39 @@ +#!/bin/bash + +################################################################################################################################################################ + +# @project Open Space Toolkit +# @file binder/postBuild +# @author Lucas Brémond +# @license Apache License 2.0 + +################################################################################################################################################################ + +# Install Jupyter widgets extension + +jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build + +# Install Matplotlib for JupyterLab + +jupyter labextension install jupyter-matplotlib --no-build + +# Install Plotly for JupyterLab + +## FigureWidget support + +jupyter labextension install plotlywidget --no-build + +## JupyterLab renderer support + +jupyter labextension install jupyterlab-plotly --no-build + +## Build extensions (must be done to activate extensions since --no-build is used above) + +jupyter lab build + +# Install Open Space Toolkit default datasets + +mkdir -p /home/jovyan/open-space-toolkit/physics +gsutil -m cp -r gs://open-space-toolkit/physics /home/jovyan/open-space-toolkit/ + +################################################################################################################################################################ diff --git a/binder/requirements.txt b/binder/requirements.txt new file mode 100644 index 0000000..b3c1629 --- /dev/null +++ b/binder/requirements.txt @@ -0,0 +1,14 @@ +# Apache License 2.0 + +gsutil~=4.47 + +jupyterlab_launcher>=0.5 + +ipywidgets~=7.5 +ipympl~=0.4 +plotly~=5.5 +plotly-geo~=1.0 + +pandas~=2.1 + +open-space-toolkit-astrodynamics~=5.1 diff --git a/binder/runtime.txt b/binder/runtime.txt new file mode 100644 index 0000000..393d84f --- /dev/null +++ b/binder/runtime.txt @@ -0,0 +1,3 @@ +# Apache License 2.0 + +python-3.10 \ No newline at end of file diff --git a/binder/start b/binder/start new file mode 100644 index 0000000..ddd1e81 --- /dev/null +++ b/binder/start @@ -0,0 +1,19 @@ +#!/bin/bash +# Apache License 2.0 + +export LD_LIBRARY_PATH=/srv/conda/lib/ + +export OSTK_PHYSICS_COORDINATE_FRAME_PROVIDERS_IERS_MANAGER_MODE="Automatic" +export OSTK_PHYSICS_COORDINATE_FRAME_PROVIDERS_IERS_MANAGER_LOCAL_REPOSITORY="/home/jovyan/open-space-toolkit/physics/coordinate/frame/providers/iers" +export OSTK_PHYSICS_COORDINATE_FRAME_PROVIDERS_IERS_MANAGER_REMOTE_URL="https://storage.googleapis.com/loft-orbital-open-space-toolkit/physics/coordinate/frame/providers/iers/latest/" +export OSTK_PHYSICS_ENVIRONMENT_EPHEMERIDES_SPICE_ENGINE_MODE="Automatic" +export OSTK_PHYSICS_ENVIRONMENT_EPHEMERIDES_SPICE_MANAGER_LOCAL_REPOSITORY="/home/jovyan/open-space-toolkit/physics/environment/ephemerides/spice" +ENV OSTK_PHYSICS_ENVIRONMENT_EPHEMERIDES_SPICE_MANAGER_REMOTE_URL "https://storage.googleapis.com/loft-orbital-open-space-toolkit/physics/environment/ephemerides/spice/" +export OSTK_PHYSICS_ENVIRONMENT_GRAVITATIONAL_EARTH_MANAGER_ENABLED=true +export OSTK_PHYSICS_ENVIRONMENT_GRAVITATIONAL_EARTH_MANAGER_LOCAL_REPOSITORY="/home/jovyan/open-space-toolkit/physics/environment/gravitational/earth" +export OSTK_PHYSICS_ENVIRONMENT_GRAVITATIONAL_EARTH_MANAGER_REMOTE_URL="https://storage.googleapis.com/loft-orbital-open-space-toolkit/physics/environment/gravitational/earth/" +export OSTK_PHYSICS_ENVIRONMENT_MAGNETIC_EARTH_MANAGER_ENABLED=true +export OSTK_PHYSICS_ENVIRONMENT_MAGNETIC_EARTH_MANAGER_LOCAL_REPOSITORY="/home/jovyan/open-space-toolkit/physics/environment/gravitational/earth" +export OSTK_PHYSICS_ENVIRONMENT_MAGNETIC_EARTH_MANAGER_REMOTE_URL="https://storage.googleapis.com/loft-orbital-open-space-toolkit/physics/environment/magnetic/earth/" + +exec "$@"