Skip to content

Commit 6fe4c0f

Browse files
fix(build): resolve gcl_sdk migrations path instead of hardcoding it
The path baked in a literal python3.14 site-packages location. That assumption already breaks in the common dev-mode build (LOCAL_GENESIS_SDK_PATH set -> gcl_sdk reinstalled with `pip install -e`), since an editable install has no physical site-packages/gcl_sdk directory at all, only a finder redirecting to the source tree - regardless of python version. Resolve it via gcl_sdk.migrations.__file__ in the already-activated venv instead, which works for both a normal and an editable install.
1 parent 698da07 commit 6fe4c0f

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
@@ -231,7 +231,8 @@ sudo cp "$GC_PATH/etc/exordos_universal_agent/logging.yaml" /etc/exordos_univers
231231
# 1) The bootstrap script will transfer the data to the data disk
232232
# 2) It's speed up the first run since the migrations are already applied.
233233
# 3) It's allows to debug the migrations at build time.
234-
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"
234+
GCL_SDK_MIGRATIONS_PATH=$(python3 -c "import os, gcl_sdk.migrations as m; print(os.path.dirname(m.__file__))")
235+
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"
235236
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"
236237

237238
deactivate

0 commit comments

Comments
 (0)