Skip to content

Commit

Permalink
feat: add containers and proxy for peak fit
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Apr 12, 2024
1 parent 9c18950 commit 5ec54ba
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
42 changes: 42 additions & 0 deletions containers/mmm5-tax-day-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,44 @@ services:
interval: 20s
timeout: 10s
retries: 5

peakfinding-agent:
image: gsas:conda
command: conda run -n GSASII --no-capture-output uvicorn bluesky_adaptive.server:app --host 0.0.0.0 --root-path /peakfinding-agent
environment:
- TILED_API_KEY=$TILED_API_KEY
- HTTPSERVER_API_KEY=$HTTPSERVER_API_KEY
- BS_AGENT_STARTUP_SCRIPT_PATH=/src/pdf-agents/pdf_agents/startup_scripts/mmm5-tax-day/peakfit.py
volumes:
- type: bind
source: ../
target: /src/pdf-agents/
read_only: true
- type: bind
source: /etc/bluesky/kafka.yml
target: /etc/bluesky/kafka.yml
read_only: true

peakfinding-ui:
image: ghcr.io/maffettone/bluesky-adaptive-ui:latest
entrypoint: /modify_dns.sh
command: python3 /src/bluesky-adaptive-ui/bluesky_adaptive_ui/default_dash_app/app.py --agent-address peakfinding-agent --agent-port 8000
environment:
- DASH_REQUEST_PATHNAME_PREFIX=/peakfinding/
volumes:
- ./modify_dns.sh:/modify_dns.sh
- type: bind
source: ../../bluesky-adaptive-ui
target: /src/bluesky-adaptive-ui
read_only: true
depends_on:
peakfinding-agent:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8050"]
interval: 20s
timeout: 10s
retries: 5

proxy:
image: docker.io/nginx
Expand Down Expand Up @@ -112,6 +150,10 @@ services:
condition: service_started
kmeans-gsas-ui:
condition: service_healthy
peakfinding-agent:
condition: service_started
peakfinding-ui:
condition: service_healthy
restart: always


4 changes: 4 additions & 0 deletions containers/nginx/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ <h2>Available Agents</h2>
<li><a href="/gsas-agent/docs">GSAS Service (FastAPI)</a></li>
<!-- Link to the KMeans-GSAS service -->
<li><a href="/kmeans-gsas-agent/docs">KMeans-GSAS (FastAPI)</a></li>
<!-- Link to the Peakfinding service -->
<li><a href="/peakfinding-agent/docs">Peakfinding Service (FastAPI)</a></li>
<!-- Add more services here -->
<!-- Example: <li><a href="/your-service/">Your Service Name</a></li> -->
</ul>
Expand All @@ -77,6 +79,8 @@ <h2>Available Agent User Interfaces</h2>
<li><a href="/gsas/">GSAS UI</a></li>
<!-- Link to the KMeans-GSAS service -->
<li><a href="/kmeans-gsas/">KMeans-GSAS UI</a></li>
<!-- Link to the Peakfinding service -->
<li><a href="/peakfinding/">Peakfinding UI</a></li>
<!-- Add more services here -->
<!-- Example: <li><a href="/your-service/">Your Service Name</a></li> -->
</ul>
Expand Down
15 changes: 15 additions & 0 deletions containers/nginx/locs.d/peakfinding.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
location /peakfinding/ {
proxy_pass http://peakfinding-ui:8050/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 60s;
}

location /peakfinding-agent/ {
proxy_pass http://peakfinding-agent:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 60s;
}

0 comments on commit 5ec54ba

Please sign in to comment.