forked from GoogleCloudPlatform/ai-on-gke
-
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.
- Loading branch information
1 parent
9d7a427
commit d2e2a8a
Showing
86 changed files
with
1,313 additions
and
670 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ This code can also perform auto brand creation. Please check the details [below] | |
* Terraform | ||
* Gcloud CLI | ||
|
||
Jupyterhub server can use either local storage or GCS to store notebooks and other artifcts. | ||
JupyterHub server can use either local storage or GCS to store notebooks and other artifcts. | ||
To use GCS, create a bucket with your username. For example, when authenticating with IAP as [email protected], ensure your bucket name is `gcsfuse-<username>` | ||
|
||
## Installation | ||
|
@@ -43,7 +43,7 @@ To use GCS, create a bucket with your username. For example, when authenticating | |
cd ai-on-gke/applications/jupyter | ||
``` | ||
|
||
2. Edit `workloads.tfvars` with your GCP settings. The `namespace` that you specify will become a K8s namespace for your Jupyterhub services. For more information about what the variables do visit [here](https://github.com/GoogleCloudPlatform/ai-on-gke/blob/main/applications/jupyter/variable_definitions.md) | ||
2. Edit `workloads.tfvars` with your GCP settings. The `namespace` that you specify will become a K8s namespace for your JupyterHub services. For more information about what the variables do visit [here](https://github.com/GoogleCloudPlatform/ai-on-gke/blob/main/applications/jupyter/variable_definitions.md) | ||
|
||
**Important Note:** | ||
If using this with the Ray module (`applications/ray/`), it is recommended to use the same k8s namespace | ||
|
@@ -55,12 +55,12 @@ for both i.e. set this to the same namespace as `applications/ray/workloads.tfva | |
| cluster_name | GKE Cluster Name | Yes | | ||
| cluster_location | GCP Region | Yes | | ||
| cluster_membership_id | Fleet membership name for GKE cluster. <br /> Required when using private clusters with Anthos Connect Gateway | | | ||
| namespace | The namespace that Jupyterhub and rest of the other resources will be installed in. | Yes | | ||
| namespace | The namespace that JupyterHub and rest of the other resources will be installed in. | Yes | | ||
| gcs_bucket | GCS bucket to be used for Jupyter storage | | | ||
| create_service_account | Create service accounts used for Workload Identity mapping | Yes | | ||
| gcp_and_k8s_service_account | GCP service account used for Workload Identity mapping and k8s sa attached with workload | Yes | | ||
|
||
For variables under `Jupyterhub with IAP`, please see the section below | ||
For variables under `JupyterHub with IAP`, please see the section below | ||
|
||
### Secure endpoint with IAP | ||
|
||
|
@@ -78,7 +78,7 @@ See the example `.tfvars` files under `/applications/jupyter` for different bran | |
|
||
| Variable | Description | Default Value | Required | | ||
| ------------------------ |--------------------------- |:-------------:|:--------:| | ||
| add_auth | Enable IAP on Jupyterhub | true | Yes | | ||
| add_auth | Enable IAP on JupyterHub | true | Yes | | ||
| brand | Name of the brand used for creating IAP OAuth clients. Only one is allowed per project. View existing brands: `gcloud iap oauth-brands list`. Leave it empty to create a new brand. Uses [support_email](#support_email) | | | | ||
| support_email | Support email assocated with the [brand](#brand). Used as a point of contact for consent for the ["OAuth Consent" in Cloud Console](https://console.cloud.google.com/apis/credentials/consent). Optional field if `brand` is empty. | | | | ||
| default_backend_service | default_backend_service | | | | ||
|
@@ -109,19 +109,17 @@ gcloud auth application-default login | |
- Should have `jupyter-proxy-public` in the name eg.: `k8s1-63da503a-jupyter-proxy-public-80-74043627`. | ||
* Run `terraform apply --var-file=./workloads.tfvars` | ||
|
||
## Using Jupyterhub | ||
## Using JupyterHub | ||
|
||
### If Auth with IAP is disabled | ||
|
||
1. Extract the randomly generated password for Jupyterhub login | ||
1. Extract the randomly generated password for JupyterHub login | ||
|
||
``` | ||
terraform output password | ||
``` | ||
|
||
2. Visit [Services](https://console.cloud.google.com/kubernetes/discovery) section on the GKE console & open the external IP for the `proxy-public` service in the browser. | ||
|
||
> **_NOTE:_** If there isn't an external IP for `proxy-public`, is it most likely due to authentication being enabled. | ||
2. Setup port forwarding for the frontend: `kubectl port-forward service/proxy-public -n <namespace> 8081:80 &`, and open `localhost:8081` in a browser. | ||
|
||
### If Auth with IAP is enabled | ||
|
||
|
@@ -139,17 +137,17 @@ Please note there may be some propagation delay after adding IAP principals (5-1 | |
### Setup Access | ||
|
||
In order for users to login to Jupyterhub via IAP, their access needs to be configured. To allow access for users/groups: | ||
In order for users to login to JupyterHub via IAP, their access needs to be configured. To allow access for users/groups: | ||
|
||
1. Navigate to the [GCP IAP Cloud Console](https://console.cloud.google.com/security/iap) and select your backend-service for `<namespace>/proxy-public`. | ||
|
||
2. Click on `Add Principal`, insert the username / group name and select under `Cloud IAP` with role `IAP-secured Web App User`. Once presmission is granted, these users / groups can login to Jupyterhub with IAP. Please note there may be some propagation delay after adding IAP principals (5-10 mins). | ||
2. Click on `Add Principal`, insert the username / group name and select under `Cloud IAP` with role `IAP-secured Web App User`. Once presmission is granted, these users / groups can login to JupyterHub with IAP. Please note there may be some propagation delay after adding IAP principals (5-10 mins). | ||
|
||
## Persistent Storage | ||
|
||
Jupyterhub is configured to provide 2 choices for storage: | ||
JupyterHub is configured to provide 2 choices for storage: | ||
|
||
1. Default Jupyterhub Storage - `pd.csi.storage.gke.io` with reclaim policy `Delete` | ||
1. Default JupyterHub Storage - `pd.csi.storage.gke.io` with reclaim policy `Delete` | ||
|
||
2. GCSFuse - `gcsfuse.csi.storage.gke.io` uses GCS Buckets and require users to pre-create buckets with name format `gcsfuse-{username}` | ||
|
||
|
@@ -194,4 +192,4 @@ This module uses `<ip>.nip.io` as the domain name with a global static ipv4 addr | |
## Additional Information | ||
For more information about Jupyterhub profiles and the preset profiles visit [here](https://github.com/GoogleCloudPlatform/ai-on-gke/blob/main/applications/jupyter/profiles.md) | ||
For more information about JupyterHub profiles and the preset profiles visit [here](https://github.com/GoogleCloudPlatform/ai-on-gke/blob/main/applications/jupyter/profiles.md) |
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 |
---|---|---|
|
@@ -38,7 +38,7 @@ spec: | |
defaultValue: false | ||
- name: autopilot_cluster | ||
varType: string | ||
defaultValue: "false" | ||
defaultValue: "true" | ||
- name: client_id | ||
description: Client ID used for enabling IAP | ||
varType: string | ||
|
@@ -71,7 +71,7 @@ spec: | |
- name: domain | ||
description: Domain used for SSL certificate. If it's empty, *.nip.io DNS is used. | ||
varType: string | ||
defaultValue: "" | ||
defaultValue: "jupyter.example.com" | ||
- name: gcs_bucket | ||
description: Bucket name to store the dataset. The bucket name must be globally unique across google cloud projects | ||
varType: string | ||
|
@@ -109,7 +109,7 @@ spec: | |
- name: additional_labels | ||
description: Additional labels to apply to Kubenetes resources | ||
varType: list(string) | ||
defaultValue: ["created-by=jupyter-on-gke-qss"] | ||
defaultValue: ["created-by=gke-ai-quick-start-solutions", "ai.gke.io=jupyter"] | ||
- name: members_allowlist | ||
description: "For example - user:[email protected],serviceAccount:[email protected],group:[email protected],domain:google.com" | ||
varType: string | ||
|
@@ -131,7 +131,7 @@ spec: | |
defaultValue: jupyter-service-account | ||
outputs: | ||
- name: jupyterhub_ip_address | ||
description: JupyterHub gloabl IP address | ||
description: JupyterHub global IP address | ||
- name: jupyterhub_password | ||
description: JupyterHub password is only required for standard authentication. Ignore, in case of IAP authentication | ||
- name: jupyterhub_uri | ||
|
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
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
Oops, something went wrong.