Back to home page

EIC code displayed by LXR

 
 

    


Warning, /swf-testbed/docs/quick-start.md is written in an unsupported language. File is not indexed.

0001 # Quick Start Guide
0002 
0003 Minimal setup for experienced users who want to get the testbed running quickly.
0004 
0005 ## Prerequisites
0006 
0007 - Docker Desktop (running)
0008 - Python 3.9+
0009 - Git
0010 
0011 ## One-Command Setup
0012 
0013 ```bash
0014 # Clone repos, install Docker, then:
0015 cd swf-testbed
0016 docker-compose up -d
0017 cd ../swf-monitor && cp .env.example .env  # Edit DB_PASSWORD='admin'
0018 cd ../swf-testbed
0019 source .venv/bin/activate
0020 pip install -e ../swf-common-lib ../swf-monitor .
0021 swf-testbed init
0022 cd ../swf-monitor/src && python manage.py createsuperuser && cd ../../swf-testbed
0023 ../swf-monitor/start_django_dual.sh &  # Start monitor (HTTP:8002, HTTPS:8443)
0024 swf-testbed start
0025 ```
0026 
0027 ## Running Persistent Agents (New in Jan 2026)
0028 
0029 Persistent agents are controlled by messages via CLI commands or MCP.
0030 
0031 ```bash
0032 cd swf-testbed && source .venv/bin/activate && source ~/.env
0033 
0034 testbed run                     # Uses workflows/testbed.toml
0035 testbed run fast_processing     # Uses workflows/fast_processing_default.toml
0036 ```
0037 
0038 This starts agents via supervisord with proper process management.
0039 
0040 ## Configure Namespace
0041 
0042 Before running workflows, set your namespace in `workflows/testbed.toml`:
0043 
0044 ```toml
0045 [testbed]
0046 namespace = "your-namespace"  # e.g., "myname-dev", "team-test1"
0047 ```
0048 
0049 This isolates your workflows from others in the system.
0050 
0051 ## Verification
0052 
0053 **Check these URLs work:**
0054 - Monitor: http://localhost:8002/
0055 - ActiveMQ: http://localhost:8161/admin/ (admin/admin)
0056 
0057 **Run a processing agent test (two terminals):**
0058 ```bash
0059 # Terminal 1: Workflow runner (one-time mode)
0060 cd swf-testbed && source .venv/bin/activate && source ~/.env
0061 python workflows/workflow_runner.py --run-once stf_datataking --workflow-config fast_processing_default --stf-count 5 --realtime
0062 
0063 # Terminal 2: Processing agent
0064 cd swf-testbed && source .venv/bin/activate && source ~/.env
0065 python example_agents/example_processing_agent.py
0066 ```
0067 
0068 **Check STF files appear:**
0069 - http://localhost:8002/stf-files/
0070 
0071 ## Fast Processing Test
0072 
0073 **Run a fast processing test (two terminals):**
0074 ```bash
0075 # Terminal 1: Workflow runner (one-time mode)
0076 cd swf-testbed && source .venv/bin/activate && source ~/.env
0077 python workflows/workflow_runner.py --run-once stf_datataking --workflow-config fast_processing_default --stf-count 5 --realtime
0078 
0079 # Terminal 2: Fast processing agent
0080 cd swf-testbed && source .venv/bin/activate && source ~/.env
0081 python example_agents/fast_processing_agent.py --testbed-config workflows/testbed.toml
0082 ```
0083 
0084 **Check results:**
0085 - TF Slices: http://localhost:8002/tf-slices/
0086 - Run States: http://localhost:8002/run-states/
0087 
0088 ## Key Environment Variables
0089 
0090 Add to `~/.env`:
0091 ```bash
0092 # Required for BNL/corporate proxy environments
0093 export NO_PROXY=localhost,127.0.0.1,0.0.0.0
0094 
0095 # Monitor configuration  
0096 export SWF_MONITOR_URL=https://localhost:8443      # API calls
0097 export SWF_MONITOR_HTTP_URL=http://localhost:8002  # Logging
0098 export SWF_API_TOKEN=<get_from_django_admin>
0099 ```
0100 
0101 ## Common Issues
0102 
0103 - **STF files empty**: Monitor not serving HTTPS → Use `start_django_dual.sh`
0104 - **Proxy timeouts**: Add `NO_PROXY` to `~/.env`
0105 - **ActiveMQ connection failed**: Check Docker services running
0106 
0107 For detailed setup: [Installation Guide](installation.md)