Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit for auth and stages workflow #1003

Merged
merged 64 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5f7639b
Initial commit for large refactor
costrouc Jan 20, 2022
439249a
Getting most services running
costrouc Jan 20, 2022
22b8a4f
Adding jupyterhub theme bits
costrouc Jan 21, 2022
9d73eec
Work on group based mounts for qhub
costrouc Jan 21, 2022
2282d75
working volume mounts
costrouc Jan 21, 2022
88a5c64
Setting up jupyterlab user environment
costrouc Jan 22, 2022
4c81f7a
Beginning to remove cookiecutter
costrouc Jan 22, 2022
0ed8785
Further removal of cookiecutter templates
costrouc Jan 22, 2022
442efee
Further removal of cookiecutter
costrouc Jan 22, 2022
5c021f4
Enable forwardauth service
costrouc Jan 22, 2022
20d3020
Conditionally add groups for conda-store and configure condarc
costrouc Jan 22, 2022
961b5d9
Adding description of section
costrouc Jan 22, 2022
93e4c2f
Working forwardauth
costrouc Jan 23, 2022
d4aa8dd
Support for namespaced environments
costrouc Jan 24, 2022
e710055
Removing locals references to node_groups
costrouc Jan 24, 2022
af562ea
Conda-Store integration at a stop where I am quite happy :)
costrouc Jan 24, 2022
bfbd40f
Adding renaming for nbconda kernels environments so easier to find
costrouc Jan 24, 2022
c90ca50
Adding dask gateway permissions
costrouc Jan 25, 2022
fd6adb5
Adding authentication
costrouc Jan 25, 2022
0ea1a63
Adding node_group labels
costrouc Jan 25, 2022
f8ea602
Setting worker node
costrouc Jan 25, 2022
b5cacab
Adding node_group selectors
costrouc Jan 25, 2022
4a746db
Adding support for clouds without cookiecutter
costrouc Jan 27, 2022
55225c5
Working digitalocean deployment
costrouc Jan 27, 2022
527493b
Working GCP deployment
costrouc Jan 28, 2022
911e10f
Adding kubeconfig for gcp
costrouc Jan 28, 2022
cf6c8bb
Added working azure deployment past stage 2 getting close
costrouc Jan 28, 2022
d9be6a0
Working AWS configuration
costrouc Jan 28, 2022
c49dd3a
Moving all module parts to within their specific cloud provider
costrouc Jan 28, 2022
038d30b
Clean creation and deletion of digital ocean
costrouc Jan 29, 2022
1e33aad
Creating qhub-enterprise directory
costrouc Jan 31, 2022
1eaa15a
Fixing node selectors on several resources
costrouc Jan 31, 2022
01c7697
Pinning minio version
costrouc Jan 31, 2022
7775580
Fixing node selectors for some monitoring metrics
costrouc Jan 31, 2022
8325496
Pinning kube-state-metrics to general node pool
costrouc Jan 31, 2022
c6f89b1
State syncing for terraform state
costrouc Jan 31, 2022
f1f07db
Cleaner destroy command that refreshed state of resources
costrouc Jan 31, 2022
da20312
Adding terraform dynamic objects to 02-infrastructure
costrouc Feb 1, 2022
95f55d0
Removing experimental configuration
costrouc Feb 1, 2022
47a62f1
Remove cookiecutter dependency during render (#1010)
viniciusdc Feb 1, 2022
22680c0
Fixing issues with gcp instance size and nodeSelectors
costrouc Feb 2, 2022
974903a
Fixing aws deployment
costrouc Feb 2, 2022
a229a45
Fixing names of azure resource groups for terraform imports
costrouc Feb 2, 2022
e95ef8b
Black and flake8 formatting
costrouc Feb 2, 2022
5ec0e76
Set the default conda-store version to v0.3.9
costrouc Feb 2, 2022
a2f4bc0
Removing bits from tests that are no longer used functions in
costrouc Feb 2, 2022
10ac462
Flake8 formatting
costrouc Feb 2, 2022
9bfe2cf
Disable group for azure check
costrouc Feb 2, 2022
2e531e3
Enabling group test
costrouc Feb 2, 2022
b057f64
Fixing docker image build path
costrouc Feb 2, 2022
994ab4c
Fixing docker build pathing
costrouc Feb 2, 2022
0a4d610
Trigger docker build of images
costrouc Feb 2, 2022
1829fd4
Fixing centos EOL issue
costrouc Feb 2, 2022
4b493eb
Removing centos from qhub
costrouc Feb 2, 2022
4124d4c
How did a -q get added to the dask-gateway wget?
costrouc Feb 2, 2022
492f517
Fixing realm name
costrouc Feb 2, 2022
bc26662
Captalize service_name to match tests
costrouc Feb 2, 2022
5ed0e6a
More resilient checks for qhub
costrouc Feb 2, 2022
f1d3f21
Ensure that keycloak cli add user by default adds them to /deveoper g…
costrouc Feb 2, 2022
581c282
Forgot to add a timeout for keycloak admin login check
costrouc Feb 2, 2022
2e7d0f8
Properly grab jupyterhub api token
costrouc Feb 2, 2022
5894efc
Fixing tests for tests_deployment
costrouc Feb 3, 2022
b742cfb
Adding more keycloak checks and port checks
costrouc Feb 3, 2022
6d0c142
Attempting to fix tls certificate issue with traefik
costrouc Feb 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 8 additions & 11 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

push:
paths:
- "qhub/template/{{ cookiecutter.repo_directory }}/image/**"
- "qhub/template/image/**"
- ".github/workflows/image.yaml"

branches: # Only on paths above
Expand All @@ -17,9 +17,9 @@ on:
tags: # Always, regardless of paths above
- '*'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
# concurrency:
# group: ${{ github.ref }}
# cancel-in-progress: true

jobs:
jupyterlab:
Expand All @@ -29,10 +29,8 @@ jobs:
matrix:
dockerfile:
- jupyterlab
- jupyterlab-centos
- jupyterhub
- dask-worker
- dask-worker-centos
- dask-gateway
steps:
- name: 'Checkout Infrastructure'
Expand Down Expand Up @@ -77,15 +75,14 @@ jobs:
- name: Add symlink to cookiecutter dir and tree
run: |
cd ./qhub/template
ln -s ./\{\{\ cookiecutter.repo_directory\ \}\} cookiecutter
sudo apt-get install tree
tree ./cookiecutter/image
tree ./image

- name: Build docker
uses: docker/build-push-action@v2
with:
context: ./qhub/template/cookiecutter/image
file: "./qhub/template/cookiecutter/image/Dockerfile.${{ matrix.dockerfile }}"
context: "./qhub/template/image"
file: "./qhub/template/image/Dockerfile.${{ matrix.dockerfile }}"
tags: |
${{ steps.meta.outputs.tags }}
ghcr.io/${{ steps.meta.outputs.tags }}
Expand All @@ -96,6 +93,6 @@ jobs:
- name: Lint Dockerfiles
uses: jbergstroem/hadolint-gh-action@v1
with:
dockerfile: ./qhub/template/cookiecutter/image/Dockerfile.${{ matrix.dockerfile }}
dockerfile: ./qhub/template/image/Dockerfile.${{ matrix.dockerfile }}
output_format: tty
error_level: 0
7 changes: 6 additions & 1 deletion .github/workflows/kubernetes_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ jobs:
run: echo "QHUB_CONFIG_PATH=`realpath ./local-deployment/qhub-config.yaml`" >> "$GITHUB_ENV"

- name: Create example-user
run: qhub keycloak --config "${QHUB_CONFIG_PATH}" adduser example-user "${CYPRESS_EXAMPLE_USER_PASSWORD}"
run: |
qhub keycloak --config "${QHUB_CONFIG_PATH}" adduser example-user "${CYPRESS_EXAMPLE_USER_PASSWORD}"
qhub keycloak --config "${QHUB_CONFIG_PATH}" listusers

- name: Sleep to see if it fixes flaky Kubernetes Tests
run: sleep 60
Expand All @@ -153,6 +155,9 @@ jobs:

- name: Deployment Pytests
run: |
export KEYCLOAK_USERNAME=qhub-user
export KEYCLOAK_PASSWORD=password
qhub keycloak --config "${QHUB_CONFIG_PATH}" adduser $KEYCLOAK_USERNAME $KEYCLOAK_PASSWORD
pytest tests_deployment/ -v

### CLEANUP AFTER TESTS
Expand Down
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
rev: v2.3.0
hooks:
- id: check-yaml
exclude: 'qhub/template/\{\{ cookiecutter\.repo_directory \}\}/(\.github/.*|infrastructure/jupyterhub.yaml)'
exclude: 'qhub/template/(\.github/.*|infrastructure/jupyterhub.yaml|stages/07-kubernetes-services/modules/kubernetes/services/(clearml/chart/templates/.*|prefect/chart/templates/.*))'
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
Expand All @@ -14,7 +14,10 @@ repos:
rev: 3.8.4
hooks:
- id: flake8
exclude: 'qhub/template/\{\{ cookiecutter\.repo_directory \}\}/infrastructure/modules/kubernetes/services/conda-store/config/conda_store_config.py'
exclude: 'qhub/template/stages/07-kubernetes-services/modules/kubernetes/services/conda-store/config/conda_store_config.py'
args: [
"--builtins=c"
]
- repo: https://github.com/hadolint/hadolint.git
rev: v2.3.0
hooks:
Expand Down
35 changes: 0 additions & 35 deletions docs/source/user_guide/experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,3 @@
> NOTE: The features listed below are experimental, proceed with caution.


## CentOS `jupyterlab` and `dask-worker` profiles

The default images used during a typical QHub deployment are running on `ubuntu`. If you need your `jupyterlab` or `dask-worker` pods to run on `centOS` instead, simply update the appropriate images in your `qhub-config.yaml`.

```
...
default_images:
jupyterhub: quansight/qhub-jupyterhub:main
jupyterlab: quansight/qhub-jupyterlab-centos:main <--- here
dask_worker: quansight/qhub-dask-worker-centos:main <--- here
dask_gateway: quansight/qhub-dask-gateway:main
conda_store: quansight/conda-store-server:v0.3.3
...
profiles:
jupyterlab:
- display_name: Small Instance
description: Stable environment with 1 cpu / 4 GB ram
default: true
kubespawner_override:
cpu_limit: 0.25
cpu_guarantee: 0.25
mem_limit: 2G
mem_guarantee: 2G
image: quansight/qhub-jupyterlab-centos:main <--- here
dask_worker:
Small Worker:
worker_cores_limit: 0.5
worker_cores: 0.5
worker_memory_limit: 2G
worker_memory: 2G
worker_threads: 1
image: quansight/qhub-dask-worker-centos:main <--- here
```

Then to get these changes to take hold, simply redeploy QHub.
1 change: 0 additions & 1 deletion environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: qhub-dev
channels:
- conda-forge
dependencies:
- cookiecutter ==1.7.2
- ruamel.yaml
- cloudflare
- auth0-python
Expand Down
2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
keycloak = (import nixpkgs-keycloak { system = "x86_64-linux"; }).python3Packages.python-keycloak;

propagatedDependencies = [
pythonPackages.cookiecutter
pythonPackages.ruamel-yaml
pythonPackages.cloudflare
pythonPackages.auth0-python
Expand Down Expand Up @@ -53,7 +52,6 @@

patchPhase = ''
substituteInPlace setup.py \
--replace "cookiecutter==1.7.2" "cookiecutter" \
--replace "azure-identity==1.6.1" "azure-identity" \
--replace "azure-mgmt-containerservice==16.2.0" "azure-mgmt-containerservice"
'';
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[tool.black]
line-length = 88
target-version = ['py36', 'py37', 'py38']
exclude = '/\{\{ cookiecutter.repo_directory \}\}/'
16 changes: 1 addition & 15 deletions qhub/cli/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,11 @@ def create_destroy_subcommand(subparser):
subparser = subparser.add_parser("destroy")
subparser.add_argument("-c", "--config", help="qhub configuration", required=True)
subparser.add_argument("-o", "--output", default="./", help="output directory")
subparser.add_argument(
"--skip-remote-state-provision",
action="store_true",
help="Skip terraform state import and destroy",
)
subparser.add_argument(
"--disable-render",
action="store_true",
help="Disable auto-rendering before destroy",
)
subparser.add_argument(
"--full-only",
action="store_true",
help="Only carry out one full pass instead of targeted sections",
)
subparser.set_defaults(func=handle_destroy)


Expand All @@ -45,8 +35,4 @@ def handle_destroy(args):
if not args.disable_render:
render_template(args.output, args.config, force=True)

destroy_configuration(
config,
args.skip_remote_state_provision,
args.full_only,
)
destroy_configuration(config)
4 changes: 3 additions & 1 deletion qhub/cli/keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ def create_keycloak_subcommand(subparser):
subparser = subparser.add_parser("keycloak")
subparser.add_argument("-c", "--config", help="qhub configuration", required=True)
subparser.add_argument(
"keycloak_action", nargs="+", help="adduser <username> [password]"
"keycloak_action",
nargs="+",
help="`adduser <username> [password]` or `listusers`",
)
subparser.set_defaults(func=handle_keycloak)

Expand Down
7 changes: 6 additions & 1 deletion qhub/cli/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def create_render_subcommand(subparser):
subparser.add_argument(
"-c", "--config", help="qhub configuration yaml file", required=True
)
subparser.add_argument(
"--dry-run",
action="store_true",
help="simulate rendering files without actually writing or updating any files",
)
subparser.set_defaults(func=handle_render)


Expand All @@ -25,4 +30,4 @@ def handle_render(args):

verify(config)

render_template(args.output, args.config, force=True)
render_template(args.output, args.config, force=True, dry_run=args.dry_run)
Loading