@@ -12,32 +12,30 @@ jobs:
1212 steps :
1313 - uses : actions/checkout@v4
1414
15- - name : Set up Docker
16- uses : docker/setup-buildx-action@v3
15+ - name : Pull pre-built image
16+ run : docker pull sourceslicer/scalar_tagger:tagname
1717
18- - name : Start Docker container
18+ - name : Start container
1919 run : |
20- docker compose pull
21- docker compose up --build -d
22- docker compose up
20+ docker run -d -p 8080:8080 sourceslicer/scalar_tagger:tagname
2321
24- - name : Wait for model loading and service start
22+ - name : Wait for service to start
2523 run : |
26- # Wait for up to 5 minutes for the service to start and load models
27- timeout=300
24+ # Wait for up to 2 minutes for the service to start
25+ timeout=120
2826 while [ $timeout -gt 0 ]; do
2927 if curl -s "http://localhost:8080/cache/numberArray/DECLARATION" > /dev/null; then
3028 echo "Service is ready"
3129 break
3230 fi
3331 echo "Waiting for service to start... ($timeout seconds remaining)"
34- sleep 10
35- timeout=$((timeout - 10 ))
32+ sleep 5
33+ timeout=$((timeout - 5 ))
3634 done
3735
3836 if [ $timeout -le 0 ]; then
3937 echo "Service failed to start within timeout"
40- docker compose logs
38+ docker logs $(docker ps -q)
4139 exit 1
4240 fi
4341
@@ -82,21 +80,20 @@ jobs:
8280 run : |
8381 ./main -r &
8482
85- # Wait for up to 5 minutes for the service to start and load models
86- timeout=300
83+ # Wait for up to 2 minutes for the service to start
84+ timeout=120
8785 while [ $timeout -gt 0 ]; do
8886 if curl -s "http://localhost:5000/cache/numberArray/DECLARATION" > /dev/null; then
8987 echo "Service is ready"
9088 break
9189 fi
9290 echo "Waiting for service to start... ($timeout seconds remaining)"
93- sleep 10
94- timeout=$((timeout - 10 ))
91+ sleep 5
92+ timeout=$((timeout - 5 ))
9593 done
9694
9795 if [ $timeout -le 0 ]; then
9896 echo "Service failed to start within timeout"
99- # Print logs or debug information
10097 cat logs/*.log 2>/dev/null || true
10198 exit 1
10299 fi
0 commit comments