Skip to content

Commit

Permalink
Trying alternative for BinderHub set up
Browse files Browse the repository at this point in the history
  • Loading branch information
amyheather committed Jun 11, 2024
1 parent 9322218 commit c1d420c
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .binder/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: covid19
channels:
- defaults
dependencies:
- joblib=0.14.1
- jupyterlab=1.2.6
- matplotlib=3.1.3
- notebook=6.0.3
- numpy=1.18.1
- pandas=1.0.1
- pip=20.0.2
- pytest=5.3.5
- python=3.8.1
- scipy=1.4.1
- seaborn=0.10.0
- statsmodels=0.11.0
- pip:
- simpy==3.0.11

56 changes: 56 additions & 0 deletions logbook/posts/2024_06_11/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "Day 9"
author: "Amy Heather"
date: "2024-06-11"
categories: [compendium]
---

::: {.callout-note}

Continued working on research compendium.

:::

## Work log

### Research compendium

Explored options for virtual hosting of materials...

**Google Colab:**

* Simply add 'tocolab' within the url so it becomes 'githubtocolab.com/' - e.g. <https://githubtocolab.com/pythonhealthdatascience/stars-reproduce-allen-2020/blob/main/reproduction/reproduction.ipynb>. This has a few issues though...
* Won't have the environment set up, so you'll need to pip install dependencies within this script.
* Can't use local materials (e.g. the local sim package) without uploading those files to Google Drive
* Have to "hack" it to correct version of Python

```
!python3 --version
!sudo apt-get install python3.8
!sudo apt-get update -y
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
!sudo update-alternatives --config python3
!python3 --version
```

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://githubtocolab.com/pythonhealthdatascience/stars-reproduce-allen-2020/blob/main/reproduction/reproduction.ipynb)<nbsp>

**BinderHub:**

* Created BinderHub config file to use the GHCR image (`reproduction/binderhub/config.yaml`)

```
config:
BinderHub:
use_registry: true
image_prefix: ghcr.io/pythonhealthdatascience/covid19:latest
```

* Then set up on <mybinder.org>. This set up but had some issues:
* Takes a long time to set-up.
* Test-run of reproduction.ipynb failed - said there was "no module named 'simpy'".
* Displayed whole repository (rather than just the reproduction folder) - but looks like this is not supported by binder as an option - closest is to modify url so it points to a particular notebook - <https://mybinder.org/v2/gh/pythonhealthdatascience/stars-reproduce-allen-2020/HEAD?labpath=reproduction%2Freproduction.ipynb>.

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pythonhealthdatascience/stars-reproduce-allen-2020/HEAD?labpath=reproduction%2Freproduction.ipynb)

* Tried simplifying this ([as Binder recommends against Docker](https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html)), so removed the config file and instead copied the environment file into a .binder folder in the root, as then Binder should ignore configuration files elsewhere...
4 changes: 0 additions & 4 deletions reproduction/binderhub/config.yaml

This file was deleted.

0 comments on commit c1d420c

Please sign in to comment.