This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Author: Christopher Hench | |
# command line program makes ipynb PEP-8 compliant | |
import json | |
import autopep8 | |
import sys | |
import re | |
file_path = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f <- function(df) { | |
for (col in names(df)) { | |
if (is.list(df[[col]])) { | |
i <- 1 | |
for (row in df[[col]]) { | |
df[[col]][i] <- paste(row, collapse = '; ') | |
i <- i + 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf __pycache__ | |
rm -rf /tmp/tmp* | |
rm -rf /tmp/rust* | |
rm -rf /tmp/mozilla* | |
rm -rf /tmp/.org* | |
pkill firefox | |
pkill chrome | |
pkill Xvfb | |
pkill python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from yaml import safe_load as load | |
import requests | |
url_requirements = "https://raw.githubusercontent.com/jupyterhub/mybinder.org-deploy/master/mybinder/requirements.yaml" | |
requirements = load(requests.get(url_requirements).text) | |
binderhub_dep = [ii for ii in requirements['dependencies'] if ii['name'] == 'binderhub'][0] | |
bhub_live = binderhub_dep['version'].split('-')[-1] | |
print(bhub_live) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url_helm_chart = "https://raw.githubusercontent.com/jupyterhub/mybinder.org-deploy/master/mybinder/values.yaml" | |
helm_chart = requests.get(url_helm_chart) | |
helm_chart = load(helm_chart.text) | |
r2d_live = helm_chart['binderhub']['config']['BinderHub']['build_image'].split(':')[-1] | |
print(r2d_live) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit_info = { | |
'repo2docker': {}, | |
'binderhub': {} | |
} | |
commit_info['binderhub']['live'] = bhub_live | |
commit_info['repo2docker']['live'] = r2d_live | |
print(commit_info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = "https://hub.docker.com/v2/repositories/jupyter/repo2docker/tags/" | |
resp = requests.get(url) | |
r2d_master = resp.json()['results'][0]['name'] | |
print(r2d_master) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url_helm_chart = 'https://raw.githubusercontent.com/jupyterhub/helm-chart/gh-pages/index.yaml' | |
helm_chart_yaml = load(requests.get(url_helm_chart).text) | |
# sort by date created | |
updates_sorted = sorted(helm_chart_yaml['entries']['binderhub'], key=lambda k: k['created']) | |
bh_master = updates_sorted[-1]['version'].split('-')[-1] | |
print(bh_master) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to commit_info dictionary | |
commit_info['repo2docker']['latest'] = r2d_master | |
print('repo2docker', commit_info['repo2docker']['live'], commit_info['repo2docker']['latest']) | |
commit_info['binderhub']['latest'] = bh_master | |
print('binderhub', commit_info['binderhub']['live'], commit_info['binderhub']['latest']) | |
print(commit_info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
TOKEN = os.environ.get('HENCHBOT_TOKEN') | |
for repo in ['binderhub', 'repo2docker']: | |
if commit_info[repo]['live'] != commit_info[repo]['latest']: | |
res = requests.post('https://api.github.com/repos/jupyterhub/mybinder.org-deploy/forks', | |
headers={'Authorization': 'token {}'.format(TOKEN)}) |
OlderNewer