mirror of
https://github.com/langchain-ai/langsmith-self-hosted-workshops.git
synced 2026-07-01 20:44:14 -04:00
3a190f1c19
This commit introduces the foundational infrastructure for running LangSmith
self-hosted deployment workshops using Jupyter notebooks.
- Add `notebooks/shared/_bootstrap.py`: Centralized bootstrap logic that:
- Loads environment variables from `.env` or `workshop.env` files
- Validates required tools (aws, terraform, helm, kubectl, jq)
- Prints AWS identity and region information
- Creates artifacts directory for notebook outputs
- Automatically installs required Python packages (python-dotenv, pyyaml, requests)
- Add `notebooks/shared/_shell.py`: Shell command execution utilities with:
- Homebrew path resolution for macOS (fixes PATH issues for subprocess calls)
- AWS_PROFILE handling
- Streaming and non-streaming command execution
- Add `notebooks/shared/_validation.py`: Validation helpers for environment
variables and configuration
- Add `notebooks/shared/_aws_helpers.py`: AWS-specific helper functions
- Add `notebooks/shared/_k8s_helpers.py`: Kubernetes helper functions
Create complete set of Module 1 notebooks following the workshop curriculum:
- `01_aws_preflight.ipynb`: Pre-deployment environment validation
- Tool validation
- AWS credentials and region checks
- Cluster capacity expectations
- Storage prerequisites (EBS CSI, StorageClasses)
- S3 blob storage verification
- Terraform and Helm repository path validation
- `02_terraform_apply.ipynb`: Infrastructure provisioning
- Terraform module discovery and validation
- Version pinning verification
- Remote state configuration
- Terraform initialization
- Plan creation with environment variable support
- Infrastructure application (commented by default)
- Output capture for Helm deployment
- `03_helm_install_langsmith.ipynb`: LangSmith installation
- Helm chart discovery and validation
- Chart version pinning
- Terraform outputs loading
- Values file management
- Kubernetes secrets creation
- Template rendering before install
- Helm installation (commented by default)
- `04_validate_ingress_and_ui.ipynb`: Deployment validation
- Pod readiness checks
- PVC binding verification
- Ingress provisioning
- Endpoint reachability
- UI availability
- Diagnostic artifact collection
- `99_teardown.ipynb`: Cleanup procedures
- Helm uninstall
- Kubernetes resource cleanup
- Terraform destroy
- Verification steps
- Add `.gitignore`: Comprehensive ignore patterns for Python, Jupyter,
environment files, artifacts, and infrastructure tool outputs
- Add `env-samples/workshop.env.example`: Template environment file with:
- Workshop configuration variables
- AWS settings
- Terraform and Helm repository paths
- PostgreSQL credentials (POSTGRES_USERNAME, POSTGRES_PASSWORD)
- Helm configuration
- Add additional example env files for AWS, OIDC, and Module 3
- Environment variable expansion: Supports `$VAR` and `${VAR}` syntax in paths
(e.g., `$TERRAFORM_REPO_DIR/aws/langsmith`)
- Robust path resolution: Handles different Jupyter working directories and
automatically finds the notebooks/shared directory
- Error handling: Clear error messages with actionable instructions when
required tools, directories, or environment variables are missing
- Terraform variable passing: Automatically reads POSTGRES_USERNAME and
POSTGRES_PASSWORD from environment and passes them to Terraform commands
- Clone instructions: Helpful guidance when Terraform or Helm repositories
are not found
- Artifact management: Centralized artifacts directory for saving outputs,
plans, and diagnostic information
All notebooks follow best practices:
- Use official repositories (no forking)
- Pin versions for reproducibility
- Plan before applying
- Render templates before installing
- Validate before proceeding
This establishes a solid foundation for the workshop series, ensuring
participants start from a supported baseline configuration.
13 lines
341 B
Bash
13 lines
341 B
Bash
# ===== Module 3 (optional load/capacity) =====
|
|
|
|
# If you generate synthetic traces / load
|
|
LOAD_TEST_ENABLED="false"
|
|
LOAD_TEST_RPS="5"
|
|
LOAD_TEST_DURATION_SECONDS="120"
|
|
|
|
# Namespace/service identifiers for metrics lookups
|
|
LANGSMITH_SERVICE_NAME="langsmith"
|
|
CLICKHOUSE_SERVICE_NAME="clickhouse"
|
|
REDIS_SERVICE_NAME="redis"
|
|
POSTGRES_ENDPOINT=""
|