forked from jupyterhub/binderhub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from thomas-bc/aws-ecr-support
Rebase to current and requested modifications
- Loading branch information
Showing
184 changed files
with
9,381 additions
and
5,128 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"jquery": true, | ||
"es6": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# flake8 is a Python linting tool run by pre-commit as declared by our | ||
# pre-commit-config.yaml file. | ||
# | ||
# This configuration is compatible with the autoformatter tool black, and | ||
# further relaxed to not bug us with too small details. | ||
# | ||
# flake8 configuration reference: | ||
# https://flake8.pycqa.org/en/latest/user/configuration.html | ||
# | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = C, E, W | ||
|
||
# Adjustments to linting the binderhub repo | ||
builtins = c, load_subconfig | ||
exclude = versioneer.py,binderhub/_version.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file can be used to disregard certain commits when using `git blame`, and | ||
# GitHub will automatically use it for that by file name convention. | ||
# | ||
# Reference 1: https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt | ||
# Reference 2: https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view | ||
# | ||
|
||
# pre-commit: run requirements-txt-fixer | ||
da40927c5b187e37755901e675eee092e12ae2eb | ||
# pre-commit: run end-of-file-fixer | ||
b815163691eade7daeeb01549d0fc6bdf4a33186 | ||
# pre-commit: run prettier | ||
9fefdc42ec4d1701117f8f2880a80695eeaad5c9 | ||
# pre-commit: run update-values-based-on-bindarspawner-mixin | ||
d32e9efa34cf0ca8880939e82ff01d3edc35705b | ||
# pre-commit: run isort | ||
f0fe0257506fd667279e97354f0207168aa1368c | ||
# pre-commit: run black | ||
bb047d8bce89655e197a7fdf2bdec2cb9c79940a | ||
# pre-commit: run pyupgrade | ||
24da4e593461640aaa47dc008b1f657b92189085 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
secrets/** filter=git-crypt diff=git-crypt | ||
binderhub/_version.py export-subst |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# dependabot.yml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
# | ||
# Notes: | ||
# - Status and logs from dependabot are provided at | ||
# https://github.com/jupyterhub/binderhub/network/updates. | ||
# - YAML anchors are not supported here or in GitHub Workflows. | ||
# | ||
version: 2 | ||
updates: | ||
# Maintain dependencies in our GitHub Workflows | ||
- package-ecosystem: github-actions | ||
directory: "/" # This should be / rather than .github/workflows | ||
schedule: | ||
interval: weekly | ||
time: "05:00" | ||
timezone: "Etc/UTC" | ||
labels: | ||
- dependencies |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This workflow provides a diff of the rendered Helm chart's templates with the | ||
# latest released dev version of the chart. | ||
# | ||
name: Helm diff | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- ".github/workflows/diff.yml" | ||
- "helm-chart/binderhub/**" | ||
push: | ||
paths: | ||
- ".github/workflows/diff.yml" | ||
- "helm-chart/binderhub/**" | ||
branches-ignore: | ||
- "dependabot/**" | ||
- "pre-commit-ci-update-config" | ||
- "update-*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
diff-rendered-templates: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: jupyterhub/action-k3s-helm@v3 | ||
with: | ||
k3s-channel: stable | ||
metrics-enabled: false | ||
traefik-enabled: false | ||
docker-enabled: true | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install helm diff plugin, update local chart dependencies | ||
run: | | ||
helm plugin install https://github.com/databus23/helm-diff | ||
helm dependency update ./helm-chart/binderhub | ||
- name: "Install latest released dev chart" | ||
run: | | ||
UPGRADE_FROM_VERSION=$(curl -sS https://jupyterhub.github.io/helm-chart/info.json | jq -er '.binderhub.dev') | ||
# NOTE: We change the directory so binderhub the chart name won't be | ||
# misunderstood as the local folder name. | ||
# validation is disabled, because the config is for a different version! | ||
cd testing | ||
old_config="../testing/k8s-binder-k8s-hub/binderhub-chart-config-old.yaml" | ||
if [ -f "$old_config" ]; then | ||
echo "using old config" | ||
else | ||
old_config="../testing/k8s-binder-k8s-hub/binderhub-chart-config.yaml" | ||
fi | ||
helm install binderhub-test binderhub \ | ||
--values "$old_config" \ | ||
--repo https://jupyterhub.github.io/helm-chart/ \ | ||
--disable-openapi-validation \ | ||
--version=$UPGRADE_FROM_VERSION | ||
- name: "Helm diff latest released dev chart with local chart" | ||
run: | | ||
echo "NOTE: For the helm diff, we have not updated the Chart.yaml" | ||
echo " version or image tags using chartpress." | ||
echo | ||
helm diff upgrade binderhub-test helm-chart/binderhub \ | ||
--values testing/k8s-binder-k8s-hub/binderhub-chart-config.yaml \ | ||
--context=3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Lints the binderhub/static/js folders content with eslint, influenced by | ||
# ".eslintrc.js", by running "npm run lint" where "lint" is a command defined in | ||
# package.json. | ||
# | ||
name: eslint | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- ".github/workflows/eslint.yml" | ||
- ".eslintrc.js" | ||
- "package.json" | ||
- "binderhub/static/js/**" | ||
push: | ||
paths: | ||
- ".github/workflows/eslint.yml" | ||
- ".eslintrc.js" | ||
- "package.json" | ||
- "binderhub/static/js/**" | ||
branches-ignore: | ||
- "dependabot/**" | ||
- "pre-commit-ci-update-config" | ||
- "update-*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- run: npm install | ||
|
||
- run: npm run lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Publish helm chart and docker images | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
- "**.rst" | ||
- "doc/**" | ||
- "examples/**" | ||
- ".github/workflows/**" | ||
- "!.github/workflows/publish.yml" | ||
push: | ||
paths-ignore: | ||
- "**.md" | ||
- "**.rst" | ||
- "doc/**" | ||
- "examples/**" | ||
- ".github/workflows/**" | ||
- "!.github/workflows/publish.yml" | ||
branches-ignore: | ||
- "dependabot/**" | ||
- "pre-commit-ci-update-config" | ||
- "update-*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# Builds and pushes docker images to DockerHub, packages the Helm chart and | ||
# pushes it to jupyterhub/helm-chart@gh-pages where index.yaml represents the | ||
# JupyterHub organization Helm chart repository. | ||
# | ||
# ref: https://github.com/jupyterhub/helm-chart | ||
# ref: https://hub.docker.com/orgs/jupyterhub | ||
# | ||
Publish: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/master') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# chartpress requires the full history | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Set up QEMU (for docker buildx) | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx (for chartpress multi-arch builds) | ||
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # dependabot updates to latest release | ||
|
||
- name: Install chart publishing dependencies (chartpress, helm) | ||
run: | | ||
. ./ci/common | ||
setup_helm v3.5.4 | ||
pip install --no-cache-dir chartpress>=1.2 pyyaml | ||
- name: Setup push rights to jupyterhub/helm-chart | ||
# This was setup by... | ||
# 1. Generating a private/public key pair: | ||
# ssh-keygen -t ed25519 -C "jupyterhub/binderhub" -f /tmp/id_ed25519 | ||
# 2. Registering the private key (/tmp/id_ed25519) as a secret for this | ||
# repo: | ||
# https://github.com/jupyterhub/binderhub/settings/secrets/actions | ||
# 3. Registering the public key (/tmp/id_ed25519.pub) as a deploy key | ||
# with push rights for the jupyterhub/helm chart repo: | ||
# https://github.com/jupyterhub/helm-chart/settings/keys | ||
# | ||
run: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
echo "${{ secrets.JUPYTERHUB_HELM_CHART_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 | ||
chmod 600 ~/.ssh/id_ed25519 | ||
- name: Setup push rights to Docker Hub | ||
# This was setup by... | ||
# 1. Creating a Docker Hub service account "jupyterhubbot" | ||
# 2. Making the account part of the "bots" team, and granting that team | ||
# permissions to push to the relevant images: | ||
# https://hub.docker.com/orgs/jupyterhub/teams/bots/permissions | ||
# 3. Registering the username and password as a secret for this repo: | ||
# https://github.com/jupyterhub/binderhub/settings/secrets/actions | ||
# | ||
run: | | ||
docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" | ||
- name: Configure a git user | ||
# Having a user.email and user.name configured with git is required to | ||
# make commits, which is something chartpress does when publishing. | ||
# While Travis CI had a dummy user by default, GitHub Actions doesn't | ||
# and require this explicitly setup. | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions user" | ||
- name: Publish images and chart with chartpress | ||
env: | ||
GITHUB_REPOSITORY: "${{ github.repository }}" | ||
run: | | ||
./tools/generate-json-schema.py | ||
./ci/publish | ||
PyPI-testbuild: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Versioneer requires past tags | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install pypa/build | ||
run: python -mpip install build | ||
- name: Build a sdist, and a binary wheel from the sdist | ||
run: python -mbuild . | ||
# ref: https://github.com/actions/upload-artifact#readme | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pypi-dist | ||
path: "dist/*" | ||
if-no-files-found: error |
Oops, something went wrong.