-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
101 lines (91 loc) · 3.29 KB
/
Copy pathaction.yml
File metadata and controls
101 lines (91 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: 'Setup PanDA'
description: >
Start a self-contained PanDA server stack via Docker Compose.
author: 'eic'
branding:
icon: 'server'
color: 'blue'
inputs:
ref:
description: 'Git ref (branch, tag, SHA) of eic/panda-compose to check out'
default: 'main'
timeout:
description: 'Seconds to wait for the PanDA server to become healthy'
default: '300'
project-name:
description: >
Docker Compose project name. Determines container name prefixes
(e.g. <project-name>-panda-jedi-1). Change only if the default
conflicts with other services on the runner.
default: 'panda-compose'
env-overrides:
description: >
Newline-separated KEY=VALUE pairs appended to the .env file before
the stack starts. Use this to override default passwords or other
variables consumed by the compose file or containers.
default: ''
outputs:
panda-url:
description: 'HTTP URL of the PanDA REST API'
value: 'http://localhost:25080/server/panda'
panda-url-ssl:
description: 'URL for SSL PanDA REST API (same as HTTP in the dev stack)'
value: 'http://localhost:25080/server/panda'
runs:
using: 'composite'
steps:
- name: Check out eic/panda-compose
uses: actions/checkout@v6
with:
repository: eic/panda-compose
ref: ${{ inputs.ref }}
path: __panda_compose__
- name: Configure environment
shell: bash
run: |
cp __panda_compose__/.env.example __panda_compose__/.env
if [[ -n "${{ inputs.env-overrides }}" ]]; then
printf '%s\n' "${{ inputs.env-overrides }}" >> __panda_compose__/.env
fi
- name: Start PanDA stack
shell: bash
run: |
docker compose \
-f __panda_compose__/docker-compose.yml \
-p ${{ inputs.project-name }} \
up -d
- name: Wait for PanDA server
shell: bash
run: |
__panda_compose__/scripts/healthcheck.sh ${{ inputs.timeout }}
- name: Wait for JEDI
shell: bash
run: |
echo "Waiting for JEDI to become healthy (timeout 120s)..."
DEADLINE=$((SECONDS + 120))
STATUS="unknown"
while [[ $SECONDS -lt $DEADLINE ]]; do
STATUS=$(docker inspect \
--format='{{.State.Health.Status}}' \
${{ inputs.project-name }}-panda-jedi-1 2>/dev/null || echo "not_found")
echo " JEDI health: $STATUS"
[[ "$STATUS" == "healthy" ]] && break
sleep 10
done
if [[ "$STATUS" != "healthy" ]]; then
docker compose \
-f __panda_compose__/docker-compose.yml \
-p ${{ inputs.project-name }} \
logs panda-jedi --tail=50
echo "ERROR: JEDI did not become healthy within 2 minutes (status: $STATUS)"
exit 1
fi
echo "JEDI is healthy."
- name: Export environment variables
shell: bash
run: |
echo "PANDA_URL=http://localhost:25080/server/panda" >> "$GITHUB_ENV"
echo "PANDA_URL_SSL=http://localhost:25080/server/panda" >> "$GITHUB_ENV"
echo "X509_USER_PROXY=/dev/null" >> "$GITHUB_ENV"
echo "PANDA_COMPOSE_PROJECT=${{ inputs.project-name }}" >> "$GITHUB_ENV"
echo "PANDA_COMPOSE_DIR=__panda_compose__" >> "$GITHUB_ENV"