Skip to content

Commit b3b2f1d

Browse files
fix(build): resolve gcl_sdk migrations path instead of hardcoding python3.14
The path baked in python3.14 literally, so it silently broke ra-apply-migration whenever the venv's actual interpreter version differs (e.g. python3.12). Resolve it via gcl_sdk.migrations.__file__ in the already-activated venv instead.
1 parent 7b9f74d commit b3b2f1d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

exordos/images/bootstrap.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ log "Apply migrations"
154154
source "$VENV_PATH/bin/activate"
155155
# TODO(akremenetsky): Database configuration parameters should be taken
156156
# from persistent configuration file.
157-
ra-apply-migration --config-dir "$GC_CFG_DIR/" --path "$GC_PATH/.venv/lib/python3.14/site-packages/gcl_sdk/migrations"
157+
GCL_SDK_MIGRATIONS_PATH=$(python3 -c "import os, gcl_sdk.migrations as m; print(os.path.dirname(m.__file__))")
158+
ra-apply-migration --config-dir "$GC_CFG_DIR/" --path "$GCL_SDK_MIGRATIONS_PATH"
158159
ra-apply-migration --config-dir "$GC_CFG_DIR/" --path "$GC_PATH/migrations"
159160

160161
# --- Meta file migrations ---

exordos/images/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ sudo cp "$GC_PATH/etc/exordos_universal_agent/logging.yaml" /etc/exordos_univers
234234
# 1) The bootstrap script will transfer the data to the data disk
235235
# 2) It's speed up the first run since the migrations are already applied.
236236
# 3) It's allows to debug the migrations at build time.
237-
OS_DB__CONNECTION_URL="postgresql://$GC_PG_USER:$GC_PG_PASS@127.0.0.1:5432/$GC_PG_DB" ra-apply-migration --path "$GC_PATH/.venv/lib/python3.14/site-packages/gcl_sdk/migrations"
237+
GCL_SDK_MIGRATIONS_PATH=$(python3 -c "import os, gcl_sdk.migrations as m; print(os.path.dirname(m.__file__))")
238+
OS_DB__CONNECTION_URL="postgresql://$GC_PG_USER:$GC_PG_PASS@127.0.0.1:5432/$GC_PG_DB" ra-apply-migration --path "$GCL_SDK_MIGRATIONS_PATH"
238239
OS_DB__CONNECTION_URL="postgresql://$GC_PG_USER:$GC_PG_PASS@127.0.0.1:5432/$GC_PG_DB" ra-apply-migration --path "$GC_PATH/migrations"
239240

240241
deactivate

0 commit comments

Comments
 (0)