The mops command provides infrastructure orchestration for simulation-based methods. Commands are organized into logical groups for managing different aspects of the system.
All commands support:
--help- Show help for any command
Unified infrastructure provisioning that orchestrates all components in correct dependency order.
Generate infrastructure configuration with guided setup.
mops infra init # Interactive mode, saves to ~/.modelops/
mops infra init --non-interactive # Use defaults
mops infra init --output custom.yaml # Custom locationOptions:
--output, -o- Custom output path (default: ~/.modelops/infrastructure.yaml)--interactive/--non-interactive- Interactive mode for selections
Behavior:
- Detects Azure subscriptions from
az account list - Prompts for subscription selection if multiple found
- Fetches latest AKS versions for selected region
- Generates complete infrastructure configuration
- Saves to ~/.modelops/infrastructure.yaml by default
Provision infrastructure from YAML configuration.
mops infra up # Uses ~/.modelops/infrastructure.yaml
mops infra up infrastructure.yaml # Custom config
mops infra up --components storage,workspace
mops infra up --env staging --verboseArguments:
CONFIG- Infrastructure configuration file (optional, defaults to ~/.modelops/infrastructure.yaml)
Options:
--components, -c- Specific components to provision (registry,cluster,storage,workspace)--env, -e- Environment name (dev, staging, prod)--verbose, -v- Show detailed output--force, -f- Force reprovisioning even if exists--plan- Preview changes without applying
Destroy infrastructure components.
mops infra down --env dev
mops infra down --env dev --destroy-storage --destroy-registry
mops infra down --env dev --destroy-all --yesOptions:
--env, -e- Environment name--destroy-storage- Include storage in destruction--destroy-registry- Include registry in destruction--destroy-all- Destroy all components including data--delete-rg- Also delete resource group (dangerous!)--yes, -y- Skip confirmation prompts--verbose, -v- Show detailed output
Show status of all infrastructure components.
mops infra status
mops infra status --env staging
mops infra status --jsonOptions:
--env, -e- Environment name--json- Output in JSON format
Get infrastructure outputs (endpoints, credentials, etc.).
mops infra outputs
mops infra outputs --component cluster
mops infra outputs --show-secretsOptions:
--env, -e- Environment name--component- Specific component outputs--show-secrets- Show sensitive values--json- Output in JSON format
Manage Dask clusters for distributed computation.
Deploy Dask workspace on existing infrastructure.
mops workspace up --env dev
mops workspace up --config workspace.yaml --env devOptions:
--config- Workspace configuration file--env, -e- Environment name--verbose, -v- Show detailed output
Destroy Dask workspace.
mops workspace down --env dev
mops workspace down --env dev --forceOptions:
--env, -e- Environment name--force, -f- Force destroy--verbose, -v- Show detailed output
Check workspace status and get connection details.
mops workspace status --env dev
mops workspace status --env dev --jsonSubmit and manage simulation jobs.
Submit a simulation job to the cluster.
mops jobs submit examples/study.yaml
mops jobs submit study.yaml --name my-experiment
mops jobs submit study.yaml --output-dir ./resultsArguments:
STUDY_FILE- Study configuration file (YAML)
Options:
--name- Job name (auto-generated if not provided)--output-dir- Local directory for results--namespace- Kubernetes namespace--env, -e- Environment name--wait- Wait for job completion--follow, -f- Follow job logs
List all jobs.
mops jobs list
mops jobs list --namespace modelops-dev
mops jobs list --status runningGet status of a specific job.
mops jobs status job-abc123
mops jobs status job-abc123 --jsonView job logs.
mops jobs logs job-abc123
mops jobs logs job-abc123 --follow
mops jobs logs job-abc123 --tail 100Sync job status from Kubernetes.
mops jobs sync
mops jobs sync --job-id job-abc123Developer utilities and testing commands.
Manage Docker image configuration.
# Print image references
mops dev images print scheduler
mops dev images print --all
mops dev images print --profile dev worker
# Export as environment variables
mops dev images export-env
mops dev images export-env --profile localActions:
print- Print image reference(s)export-env- Export as shell environment variables
Options:
--profile- Image profile (prod, dev, local)--all- Show all images
Run smoke test to verify bundle execution.
mops dev smoke-test
mops dev smoke-test --bundle ./my-bundle
mops dev smoke-test --registry localhost:5000Options:
--bundle- Bundle directory to test--registry- Registry URL--namespace- Kubernetes namespace--verbose, -v- Show detailed output
Manage optimization runs (Optuna, MCMC, etc.).
Start an optimization run.
mops adaptive up optuna-config.yaml
mops adaptive up config.yaml --run-id my-calibrationArguments:
CONFIG- Adaptive configuration file
Options:
--run-id- Run identifier (auto-generated if not provided)--env, -e- Environment name--verbose, -v- Show detailed output
Stop and clean up an optimization run.
mops adaptive down my-calibration
mops adaptive down my-calibration --forceView and manage ModelOps configuration.
mops config
mops config --jsonShows:
- Current environment
- Active profiles
- Configuration paths
- Provider settings
Show ModelOps version and component versions.
mops version
mops version --jsonThese commands manage individual components. For most use cases, use mops infra instead.
up- Create AKS clusterdown- Destroy clusterstatus- Check cluster status
create- Create ACR registrydestroy- Destroy registrystatus- Check registry statuslogin- Authenticate to registry
up- Create storage accountdown- Destroy storagestatus- Check storage status
MODELOPS_ENV- Default environment (dev, staging, prod)PULUMI_CONFIG_PASSPHRASE_FILE- Pulumi passphrase file locationMODELOPS_BUNDLE_REGISTRY- Bundle registry URLAZURE_SUBSCRIPTION_ID- Azure subscription for resources
apiVersion: modelops/v1
kind: Infrastructure
metadata:
name: dev
spec:
cluster:
provider: azure
location: eastus2
kubernetes_version: "1.30"
node_count: 2
storage:
account_tier: Standard
account_kind: StorageV2
registry:
sku: Basic
workspace:
workers:
replicas: 4
processes: 2
threads: 1apiVersion: modelops/v1
kind: Study
metadata:
name: pi-estimation
spec:
simulation:
function: examples.simulations:monte_carlo_pi
bundle_ref: ""
parameters:
n_samples: 100000
replicates: 100
seed: 42# 1. Create infrastructure
mops infra up infrastructure.yaml --env dev
# 2. Check status
mops infra status --env dev
# 3. Deploy workspace
mops workspace up --env dev
# 4. Submit a job
mops jobs submit study.yaml
# 5. Check results
mops jobs status <job-id>
mops jobs logs <job-id>
# 6. Clean up
mops workspace down --env dev
mops infra down --env dev --yes# Check image configuration
mops dev images print scheduler
# Run smoke test
mops dev smoke-test
# View logs
kubectl logs -n modelops-dask-dev -l app=dask-worker0- Success1- General error2- Configuration error3- Infrastructure error130- Interrupted (Ctrl+C)