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

[Do Not Merge] Kubeflow release changes #39

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions llm/utils/get_auth_session_cookie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""
Script to get auth session cookie

Usage:
python get_auth_session_cookie.py --email <EMAIL> --password <PASSWORD>
"""
import argparse
import os
import sys
import requests


def get_auth_session_cookie(email: str, password: str) -> str:
"""
Function to get authservice_session cookie from dex idp.
It requires INGRESS_HOST and INGRESS_HOST to be set as env variables.
"""
ingress_host = os.getenv("INGRESS_HOST")
if not ingress_host:
print("INGRESS_HOST env variable is not set")
sys.exit(1)

ingress_port = os.getenv("INGRESS_PORT")
if not ingress_host:
print("INGRESS_PORT env variable is not set")
sys.exit(1)

host = f"http://{ingress_host}:{ingress_port}/"
session = requests.Session()
response = session.get(host)

headers = {
"Content-Type": "application/x-www-form-urlencoded",
}
data = {"login": email, "password": password}
session.post(response.url, headers=headers, data=data)
return session.cookies.get_dict()["authservice_session"]


if __name__ == "__main__":
# Create the argument parser
parser = argparse.ArgumentParser(description="Script to get auth session cookie.")

# Add arguments
parser.add_argument("--email", type=str, help="user email", required=True)
parser.add_argument("--password", type=str, help="user password", required=True)

# Parse the command-line arguments
args = parser.parse_args()

session_cookie = get_auth_session_cookie(args.email, args.password)
print(session_cookie)
42 changes: 42 additions & 0 deletions setup/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

KF_VERSION=release-v1.8

if [ -z "$WORK_DIR" ]; then
echo "Working directory env variable not set"
exit 1
fi

helpFunction()
{
echo ""
echo "Usage: $0 -d <COMPANY_DOMAIN>"
echo " -d provide company domain e.g. ntnx.com"
exit 1 # Exit script after printing help
}
while getopts ":d:" opt;
do
case "$opt" in
d ) company_domain="$OPTARG" ;;
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done

if [ -z "$company_domain" ]
then
echo "Company domain not provided"
helpFunction
fi

# Download kubeflow manifests and install
cd $WORK_DIR/setup && git clone -b $KF_VERSION https://github.com/nutanix/kubeflow-manifests.git
cp $WORK_DIR/setup/object-store-secrets.env $WORK_DIR/setup/kubeflow-manifests/kubeflow/overlays/pipeline/ntnx/object-store-secrets.env
cp $WORK_DIR/setup/pipeline-install-config.env $WORK_DIR/setup/kubeflow-manifests/kubeflow/overlays/pipeline/ntnx/pipeline-install-config.env
cd $WORK_DIR/setup/kubeflow-manifests && make install-nke-kubeflow

# Apply patches
kubectl patch cm config-domain -p "{\"data\": {\"$company_domain\": \"\"}}" -n knative-serving
kubectl patch service istio-ingressgateway -p '{"spec": {"type": "LoadBalancer"}}' -n istio-system

# Remove kubeflow manifests
rm -rf $WORK_DIR/setup/kubeflow-manifests
2 changes: 2 additions & 0 deletions setup/object-store-secrets.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
accesskey=YOUR_NUTANIX_OBJECT_STORE_ACCESS_KEY
secretkey=YOUR_NUTANIX_OBJECT_STORE_SECRET_KEY
4 changes: 4 additions & 0 deletions setup/pipeline-install-config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bucketName=mlpipeline
insecure=true
objStoreHost=YOUR_NTNX_OBJECT_STORE_HOST
objStoreRegion=us-east-1