Skip to content

Commit 3565b62

Browse files
authored
Merge pull request #3515 from PolicyEngine/fix/app-engine-deploy-quiet
Fix App Engine deploy and startup script false failures
2 parents b7c5e75 + d07f6d2 commit 3565b62

5 files changed

Lines changed: 7 additions & 17 deletions

File tree

.github/scripts/deploy_app_engine_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ if [[ "${APP_ENGINE_PROMOTE}" != "1" ]]; then
3434
deploy_args+=("--no-promote")
3535
fi
3636

37-
yes | gcloud app deploy "${deploy_args[@]}"
37+
gcloud app deploy --quiet "${deploy_args[@]}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ brew install redis
108108
redis-server
109109
```
110110

111-
2. Start the API service worker
111+
2. Start the API
112112

113113
Run the below
114114

115115
```
116-
FLASK_DEBUG=1 python policyengine_api/worker.py
116+
FLASK_DEBUG=1 python -m flask --app policyengine_api.api run
117117
```
118118

119119
NOTE: Calculations are not possible in the uk app without access to a specific dataset. Expect an error: "ValueError: Invalid response code 404 for url https://api.github.com/repos/policyengine/non-public-microdata/releases/tags/uk-2024-march-efo."
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed staged App Engine deploy automation to use `gcloud app deploy --quiet` instead of piping `yes`, preventing false CI failures after successful deployments. Also removed stale runtime, test-fixture, and README references to a nonexistent `policyengine_api/worker.py` process.

gcp/policyengine_api/start.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/sh
22
# Environment variables
33
PORT="${PORT:-8080}"
4-
WORKER_COUNT="${WORKER_COUNT:-3}"
54
REDIS_PORT="${REDIS_PORT:-6379}"
65

76
# Start the API
@@ -15,16 +14,7 @@ redis-server --protected-mode no \
1514
# Wait for Redis to be ready
1615
sleep 2
1716

18-
# Start multiple workers using POSIX-compliant loop
19-
i=1
20-
while [ $i -le "$WORKER_COUNT" ]
21-
do
22-
echo "Starting worker $i..."
23-
python3 policyengine_api/worker.py &
24-
i=$((i + 1))
25-
done
26-
2717
# Keep the script running and handle shutdown gracefully
2818
trap "pkill -P $$; exit 1" INT TERM
2919

30-
wait
20+
wait

tests/conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,5 @@ def client():
3636
with running(["redis-server"], 3):
3737
redis_client = redis.Redis()
3838
redis_client.ping()
39-
with running([sys.executable, "policyengine_api/worker.py"], 3):
40-
with app.test_client() as test_client:
41-
yield test_client
39+
with app.test_client() as test_client:
40+
yield test_client

0 commit comments

Comments
 (0)