-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding support for nix flakes * Adding dependencies * Adding .direnv * Adding conda-store terraform charts along with postgres/minio charts * Adding changes to ensure postgresql and minio deployment * Make easy connection to s3 and database storage * Adding url for conda-store in qhub * Adding documentation on Conda-Store environment management * Fixing all refrences to old conda-store image * Remove use of fstring flake8 formatting * FEAT: Add additional port to handle Minio object storage (#988) * FEAT: Add additional port to handle Minio object storage * Add missing vars * Update minio entrypoint and disable tls * Exclude traitlets config from pre-commit * Update conda-store minio service eternal endpoint Co-authored-by: viniciusdc <[email protected]> Co-authored-by: Harsh Mishra <[email protected]> Co-authored-by: viniciusdc <[email protected]>
- Loading branch information
1 parent
ee9653c
commit b27a14f
Showing
32 changed files
with
637 additions
and
77 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ result | |
shell.nix | ||
.envrc | ||
build.nix | ||
.direnv | ||
|
||
# ignore deploments | ||
do-jupyterhub | ||
|
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
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
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,44 @@ | ||
# Managing Conda Environments | ||
|
||
QHub has several ways to manage environments for users. The | ||
traditional approach available in older QHub deployments is still | ||
available by editing the `qhub-config.yaml` `environments:` key within | ||
the configuration file. An example would be | ||
|
||
```yaml | ||
environments: | ||
"environment-default.yaml": | ||
name: default | ||
channels: | ||
- conda-forge | ||
- defaults | ||
dependencies: | ||
- python=3.7 | ||
- ipykernel | ||
- ipywidgets | ||
- qhub-dask==||QHUB_VERSION|| | ||
- numpy | ||
- numba | ||
- pandas | ||
``` | ||
When the environments are updated in this file and an automated `qhub | ||
deploy` is kicked off the environments are updated for all users. An | ||
additional method is allowed which enables users to easily create | ||
ad-hoc environments. Visiting `https://<qhub-domain>/conda-store/` | ||
will take you to | ||
[Conda-Store](https://conda-store.readthedocs.io/en/latest/) an open | ||
source tool for managing conda environments within enterprise | ||
environments. For now the username is anything with a password of | ||
`password`. Soon this will be integrated with central authentication | ||
via keycloak. The [create environment | ||
endpoint](https://conda-store.readthedocs.io/en/latest/user_guide.html#create-create-environment) | ||
will allow you to easily create a new environment. Additionally you | ||
can update existing environments via [visiting the | ||
environment](https://conda-store.readthedocs.io/en/latest/user_guide.html#environment-namespace-name-environments) | ||
and clicking edit. | ||
|
||
We are working towards developing an extension within jupyterlab for | ||
editing these environments but it is not complete at the | ||
moment. Follow [gator](https://github.com/mamba-org/gator) for | ||
progress on this extension. |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
:maxdepth: 2 | ||
getting_started.md | ||
environments.md | ||
code_server.md | ||
ssh.md | ||
dashboard.md | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,46 @@ | ||
{ | ||
description = "QHub"; | ||
|
||
inputs = { | ||
nixpkgs = { url = "github:nixos/nixpkgs/nixpkgs-unstable"; }; | ||
nixpkgs-keycloak = { url = "github:costrouc/nixpkgs/python-keycloak"; }; | ||
}; | ||
|
||
outputs = inputs@{ self, nixpkgs, nixpkgs-keycloak, ... }: { | ||
devShell.x86_64-linux = | ||
let | ||
pkgs = import nixpkgs { system = "x86_64-linux"; }; | ||
pythonPackages = pkgs.python3Packages; | ||
|
||
keycloak = (import nixpkgs-keycloak { system = "x86_64-linux"; }).python3Packages.python-keycloak; | ||
in pkgs.mkShell { | ||
buildInputs = [ | ||
pythonPackages.cookiecutter | ||
pythonPackages.ruamel-yaml | ||
pythonPackages.cloudflare | ||
pythonPackages.auth0-python | ||
pythonPackages.pydantic | ||
pythonPackages.pynacl | ||
pythonPackages.bcrypt | ||
pythonPackages.kubernetes | ||
pythonPackages.packaging | ||
keycloak | ||
|
||
# cloud packages | ||
pythonPackages.azure-mgmt-containerservice | ||
pythonPackages.azure-identity | ||
pythonPackages.boto3 | ||
|
||
# development | ||
pythonPackages.pytest | ||
pythonPackages.black | ||
pythonPackages.flake8 | ||
pythonPackages.sphinx | ||
|
||
# additional | ||
pkgs.minikube | ||
pkgs.k9s | ||
]; | ||
}; | ||
}; | ||
} |
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
16 changes: 0 additions & 16 deletions
16
qhub/template/{{ cookiecutter.repo_directory }}/image/Dockerfile.conda-store
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
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
48 changes: 48 additions & 0 deletions
48
...ry }}/infrastructure/modules/kubernetes/services/conda-store/config/conda_store_config.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,48 @@ | ||
import logging | ||
|
||
from conda_store_server.storage import S3Storage | ||
from conda_store_server.server.auth import DummyAuthentication | ||
|
||
# ================================== | ||
# conda-store settings | ||
# ================================== | ||
c.CondaStore.storage_class = S3Storage | ||
c.CondaStore.store_directory = "/home/conda/" | ||
c.CondaStore.environment_directory = "/home/conda/environments/" | ||
c.CondaStore.database_url = "postgresql+psycopg2://${postgres-username}:${postgres-password}@${postgres-service}/conda-store" | ||
c.CondaStore.default_uid = 1000 | ||
c.CondaStore.default_gid = 100 | ||
c.CondaStore.default_permissions = "775" | ||
|
||
c.S3Storage.internal_endpoint = "${minio-service}:9000" | ||
c.S3Storage.external_endpoint = "${external-url}:9080" | ||
c.S3Storage.access_key = "${minio-username}" | ||
c.S3Storage.secret_key = "${minio-password}" | ||
c.S3Storage.region = "us-east-1" # minio region default | ||
c.S3Storage.bucket_name = "conda-store" | ||
c.S3Storage.secure = False | ||
|
||
# ================================== | ||
# server settings | ||
# ================================== | ||
c.CondaStoreServer.log_level = logging.INFO | ||
c.CondaStoreServer.enable_ui = True | ||
c.CondaStoreServer.enable_api = True | ||
c.CondaStoreServer.enable_registry = True | ||
c.CondaStoreServer.enable_metrics = True | ||
c.CondaStoreServer.address = "0.0.0.0" | ||
c.CondaStoreServer.port = 5000 | ||
# This MUST start with `/` | ||
c.CondaStoreServer.url_prefix = "/conda-store" | ||
|
||
|
||
# ================================== | ||
# auth settings | ||
# ================================== | ||
c.CondaStoreServer.authentication_class = DummyAuthentication | ||
|
||
# ================================== | ||
# worker settings | ||
# ================================== | ||
c.CondaStoreWorker.log_level = logging.INFO | ||
c.CondaStoreWorker.watch_paths = ["/opt/environments"] |
7 changes: 7 additions & 0 deletions
7
...cutter.repo_directory }}/infrastructure/modules/kubernetes/services/conda-store/locals.tf
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,7 @@ | ||
locals { | ||
tls = (var.certificate-secret-name != "") ? ({ | ||
secretName = var.certificate-secret-name | ||
}) : ({ | ||
certResolver = "default" | ||
}) | ||
} |
4 changes: 2 additions & 2 deletions
4
...cutter.repo_directory }}/infrastructure/modules/kubernetes/services/conda-store/output.tf
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,9 +1,9 @@ | ||
output "endpoint" { | ||
description = "Endpoint dns name of conda-store nfs server" | ||
value = "${var.name}-nfs.${var.namespace}.svc.cluster.local" | ||
value = "${kubernetes_service.nfs.metadata.0.name}.${var.namespace}.svc.cluster.local" | ||
} | ||
|
||
output "endpoint_ip" { | ||
description = "IP Address of conda-store nfs server" | ||
value = kubernetes_service.main.spec.0.cluster_ip | ||
value = kubernetes_service.nfs.spec.0.cluster_ip | ||
} |
Oops, something went wrong.