33set -e
44
55# Modal Gateway version check script
6- # Verifies that the US and UK package versions used by API v1 are deployed
6+ # Verifies that the US package version used by API v1 is deployed
77# in the Modal simulation API before allowing API v1 deployment to proceed.
88#
9- # Usage: ./request-simulation-model-versions.sh -us <us_version> -uk <uk_version>
9+ # NOTE: We explicitly do NOT check for UK versions here. The UK package
10+ # (policyengine-uk) does not support the older Python versions that API v1
11+ # runs on, so the UK version deployed to Modal may not match the version
12+ # pinned in API v1's requirements.
13+ #
14+ # Usage: ./request-simulation-model-versions.sh -us <us_version>
1015
1116GATEWAY_URL=" https://policyengine--policyengine-simulation-gateway-web-app.modal.run"
1217
1318usage () {
14- echo " Usage: $0 -us <us_version> -uk <uk_version> "
19+ echo " Usage: $0 -us <us_version>"
1520 echo " "
1621 echo " Required flags:"
1722 echo " -us us_version - US package version (e.g., 1.459.0)"
18- echo " -uk uk_version - UK package version (e.g., 2.65.9)"
1923 exit 1
2024}
2125
2226US_VERSION=" "
23- UK_VERSION=" "
2427
2528while [ $# -gt 0 ]; do
2629 case " $1 " in
@@ -29,7 +32,8 @@ while [ $# -gt 0 ]; do
2932 shift 2
3033 ;;
3134 -uk)
32- UK_VERSION=" $2 "
35+ # Accept but ignore UK version flag for backwards compatibility
36+ echo " Note: UK version check is disabled (see script comments)"
3337 shift 2
3438 ;;
3539 -h|--help)
@@ -42,15 +46,14 @@ while [ $# -gt 0 ]; do
4246 esac
4347done
4448
45- if [ -z " $US_VERSION " ] || [ -z " $UK_VERSION " ] ; then
46- echo " Error: Both -us and -uk versions are required"
49+ if [ -z " $US_VERSION " ]; then
50+ echo " Error: -us version is required"
4751 usage
4852fi
4953
5054echo " Checking Modal simulation API versions..."
5155echo " Gateway: $GATEWAY_URL "
5256echo " Expected US version: $US_VERSION "
53- echo " Expected UK version: $UK_VERSION "
5457echo " "
5558
5659# Query the gateway for deployed versions
@@ -71,16 +74,6 @@ if [ -z "$US_DEPLOYED" ]; then
7174fi
7275echo " US version $US_VERSION is deployed (app: $US_DEPLOYED )"
7376
74- # Check if UK version is deployed
75- UK_DEPLOYED=$( echo " $VERSIONS_RESPONSE " | jq -r --arg v " $UK_VERSION " ' .uk[$v] // empty' )
76- if [ -z " $UK_DEPLOYED " ]; then
77- echo " ERROR: UK version $UK_VERSION is NOT deployed in Modal simulation API"
78- echo " Available UK versions:"
79- echo " $VERSIONS_RESPONSE " | jq -r ' .uk | keys[]'
80- exit 1
81- fi
82- echo " UK version $UK_VERSION is deployed (app: $UK_DEPLOYED )"
83-
8477echo " "
85- echo " SUCCESS: Both US and UK versions are deployed and ready"
78+ echo " SUCCESS: US version is deployed and ready"
8679exit 0
0 commit comments