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

Update Bike Sharing for EzUA 1.2.0 #103

Merged
merged 2 commits into from
Dec 19, 2023
Merged
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
33 changes: 31 additions & 2 deletions demos/bike-sharing/01.bike-sharing-mlflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@
"warnings.filterwarnings('ignore')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"os.environ[\"AWS_ACCESS_KEY_ID\"] = os.environ['MLFLOW_TRACKING_TOKEN']\n",
"os.environ[\"AWS_SECRET_ACCESS_KEY\"] = \"s3\"\n",
"os.environ[\"AWS_ENDPOINT_URL\"] = 'http://local-s3-service.ezdata-system.svc.cluster.local:30000'\n",
"os.environ[\"MLFLOW_S3_ENDPOINT_URL\"] = os.environ[\"AWS_ENDPOINT_URL\"]\n",
"os.environ[\"MLFLOW_S3_IGNORE_TLS\"] = \"true\"\n",
"os.environ[\"MLFLOW_TRACKING_INSECURE_TLS\"] = \"true\""
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -942,11 +956,26 @@
"source": [
"manifest = f\"\"\"\n",
"apiVersion: v1\n",
"kind: Secret\n",
"metadata:\n",
" name: s3creds\n",
" annotations:\n",
" serving.kserve.io/s3-endpoint: {os.environ[\"AWS_ENDPOINT_URL\"].replace(\"http://\", \"\")}\n",
" serving.kserve.io/s3-usehttps: \"0\"\n",
" serving.kserve.io/s3-useanoncredential: \"false\"\n",
" serving.kserve.io/s3-cabundle: \"\"\n",
"type: Opaque\n",
"stringData:\n",
" AWS_ACCESS_KEY_ID: {os.environ[\"AWS_ACCESS_KEY_ID\"]}\n",
" AWS_SECRET_ACCESS_KEY: {os.environ[\"AWS_SECRET_ACCESS_KEY\"]}\n",
"\n",
"---\n",
"apiVersion: v1\n",
"kind: ServiceAccount\n",
"metadata:\n",
" name: kserve-minio-sa\n",
"secrets:\n",
"- name: {os.getenv('USER')}-objectstore-secret\n",
"- name: s3creds\n",
"\n",
"---\n",
"apiVersion: \"serving.kserve.io/v1beta1\"\n",
Expand Down Expand Up @@ -1022,7 +1051,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.17"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
35 changes: 26 additions & 9 deletions demos/bike-sharing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,32 @@ To complete the tutorial follow the steps below:
server.
1. Connect to the Notebook server, launch a new terminal window, and clone the repository locally.
1. Navigate to the tutorial's directory (`ezua-tutorials/tutorials/mlflow`)
1. Create a new conda environment using the specified `environment.yaml` file:
```
conda env create -f environment.yaml
```
1. Add the new conda environment as an ipykernel:
```
python -m ipykernel install --user --name=bike-sharing
```
1. Refresh your browser tab to access the updated environment.
1. Create your virtual environment:
- Deactivate the base conda environment:
```
conda deactivate
```
- Create a new virtual environment:
```
python -m venv bike-sharing
```
- Activate the new virtual environment:
```
source bike-sharing/bin/activate
```
- Upgrade `pip`:
```
pip install --upgrade pip
```
- Install the dependencies:
```
pip install -r requirements.txt
```
- Add the new conda environment as an ipykernel:
```
python -m ipykernel install --user --name=bike-sharing
```
- Refresh your browser tab to access the updated environment.
1. Launch the two Notebooks in order and execute the code cells. Make sure to select the `bike-sharing` environment
kernel for each Notebook.

Expand Down
7 changes: 7 additions & 0 deletions demos/bike-sharing/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
numpy==1.19.5
pandas==1.4.4
seaborn==0.12.2
scikit-learn==1.0.1
boto3==1.20.24
jupyter==1.0.0
mlflow==2.1.1