Create CLI-Jupyter integration workflow
- Add jupyter_launcher.sh script to start Jupyter with ML tools - Create cli_integration.py helper for CLI operations - Add sample notebook structure for experiments - Create workflow documentation for seamless data science integration
This commit is contained in:
parent
5cf16ac27d
commit
34c632dcde
5 changed files with 63 additions and 0 deletions
8
podman/cli_integration.py
Normal file
8
podman/cli_integration.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# CLI-Jupyter Integration Helper
|
||||
import subprocess
|
||||
import os
|
||||
def sync_project(project_path):
|
||||
"""Sync project using CLI"""
|
||||
cmd = ["../cli/zig-out/bin/ml", "sync", project_path, "--queue"]
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
return result.returncode == 0
|
||||
4
podman/jupyter_launcher.sh
Executable file
4
podman/jupyter_launcher.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
echo "Starting Jupyter with ML tools..."
|
||||
podman run -d -p 8888:8888 --name ml-jupyter -v "$(pwd)/workspace:/workspace:Z" --entrypoint conda localhost/ml-tools-runner run -n ml_env jupyter notebook --no-browser --ip=0.0.0.0 --port=8888 --NotebookApp.token="" --NotebookApp.password="" --allow-root
|
||||
echo "Jupyter available at http://localhost:8888"
|
||||
50
podman/jupyter_workflow.md
Normal file
50
podman/jupyter_workflow.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# CLI-Jupyter Integration Workflow
|
||||
## Workflow Overview
|
||||
|
||||
This workflow integrates the FetchML CLI with Jupyter notebooks for seamless data science experiments.
|
||||
|
||||
### Step 1: Start Jupyter Server
|
||||
```bash
|
||||
# Build the container with ML tools
|
||||
podman build -f ml-tools-runner.podfile -t ml-tools-runner .
|
||||
|
||||
# Start Jupyter server
|
||||
podman run -d -p 8888:8888 --name ml-jupyter \
|
||||
-v "$(pwd)/workspace:/workspace:Z" \
|
||||
--entrypoint conda localhost/ml-tools-runner \
|
||||
run -n ml_env jupyter notebook --no-browser --ip=0.0.0.0 --port=8888 \
|
||||
--NotebookApp.token='' --NotebookApp.password='' --allow-root
|
||||
|
||||
# Access at http://localhost:8888
|
||||
```
|
||||
|
||||
### Step 2: Use CLI to Sync Projects
|
||||
```bash
|
||||
# From another terminal, sync your project
|
||||
cd cli && ./zig-out/bin/ml sync ./my_project --queue
|
||||
|
||||
# Check status
|
||||
./zig-out/bin/ml status
|
||||
```
|
||||
|
||||
### Step 3: Run Experiments in Jupyter
|
||||
```python
|
||||
# In your Jupyter notebook
|
||||
import mlflow
|
||||
import wandb
|
||||
import pandas as pd
|
||||
|
||||
# Start MLflow tracking
|
||||
mlflow.start_run()
|
||||
mlflow.log_param("model", "random_forest")
|
||||
mlflow.log_metric("accuracy", 0.95)
|
||||
```
|
||||
|
||||
### Step 4: Monitor with CLI
|
||||
```bash
|
||||
# Monitor jobs from CLI
|
||||
./zig-out/bin/ml monitor
|
||||
|
||||
# View logs
|
||||
./zig-out/bin/ml experiment log my_experiment
|
||||
```
|
||||
0
podman/workspace/notebooks/mlflow_demo.ipynb
Normal file
0
podman/workspace/notebooks/mlflow_demo.ipynb
Normal file
1
podman/workspace/notebooks/sample_experiment.ipynb
Normal file
1
podman/workspace/notebooks/sample_experiment.ipynb
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# ML Experiment with FetchML\n\nThis notebook demonstrates how to use FetchML CLI with Jupyter notebooks."]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}}, "nbformat": 4, "nbformat_minor": 4}
|
||||
Loading…
Reference in a new issue