Skip to content

Commit c1d420c

Browse files
committed
Trying alternative for BinderHub set up
1 parent 9322218 commit c1d420c

File tree

3 files changed

+75
-4
lines changed

3 files changed

+75
-4
lines changed

.binder/environment.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: covid19
2+
channels:
3+
- defaults
4+
dependencies:
5+
- joblib=0.14.1
6+
- jupyterlab=1.2.6
7+
- matplotlib=3.1.3
8+
- notebook=6.0.3
9+
- numpy=1.18.1
10+
- pandas=1.0.1
11+
- pip=20.0.2
12+
- pytest=5.3.5
13+
- python=3.8.1
14+
- scipy=1.4.1
15+
- seaborn=0.10.0
16+
- statsmodels=0.11.0
17+
- pip:
18+
- simpy==3.0.11
19+

logbook/posts/2024_06_11/index.qmd

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Day 9"
3+
author: "Amy Heather"
4+
date: "2024-06-11"
5+
categories: [compendium]
6+
---
7+
8+
::: {.callout-note}
9+
10+
Continued working on research compendium.
11+
12+
:::
13+
14+
## Work log
15+
16+
### Research compendium
17+
18+
Explored options for virtual hosting of materials...
19+
20+
**Google Colab:**
21+
22+
* 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...
23+
* Won't have the environment set up, so you'll need to pip install dependencies within this script.
24+
* Can't use local materials (e.g. the local sim package) without uploading those files to Google Drive
25+
* Have to "hack" it to correct version of Python
26+
27+
```
28+
!python3 --version
29+
!sudo apt-get install python3.8
30+
!sudo apt-get update -y
31+
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
32+
!sudo update-alternatives --config python3
33+
!python3 --version
34+
```
35+
36+
[![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>
37+
38+
**BinderHub:**
39+
40+
* Created BinderHub config file to use the GHCR image (`reproduction/binderhub/config.yaml`)
41+
42+
```
43+
config:
44+
BinderHub:
45+
use_registry: true
46+
image_prefix: ghcr.io/pythonhealthdatascience/covid19:latest
47+
```
48+
49+
* Then set up on <mybinder.org>. This set up but had some issues:
50+
* Takes a long time to set-up.
51+
* Test-run of reproduction.ipynb failed - said there was "no module named 'simpy'".
52+
* 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>.
53+
54+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pythonhealthdatascience/stars-reproduce-allen-2020/HEAD?labpath=reproduction%2Freproduction.ipynb)
55+
56+
* 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...

reproduction/binderhub/config.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)