modify baseddata-worker variables

This commit is contained in:
Sam 2024-10-19 13:27:30 +01:00
parent 2516f9de21
commit ca9dff8442
1 changed files with 20 additions and 16 deletions

View File

@ -127,6 +127,9 @@ in {
pkgs.git
pkgs.python311
pkgs.poetry
pkgs.aria2
pkgs.osmctools
pkgs.osmium-tool
];
environment.variables = {
@ -196,26 +199,27 @@ in {
serviceConfig = {
Environment = "PATH=/run/current-system/sw/bin/";
WorkingDirectory = "/srv/baseddata-models";
ExecStartPre = "${pkgs.coreutils}/bin/timeout 120 ${pkgs.bash}/bin/bash -c 'until ${pkgs.netcat-openbsd}/bin/nc -z ${containerIp} 4200; do sleep 3; done'";
ExecStart = pkgs.writeShellScript "baseddata-serve-flows" ''
# set prefect environment variables
.venv/bin/prefect variable set "xmpp_jid" $(cat /run/secrets/notifybotUsername)
.venv/bin/prefect variable set "xmpp_password" $(cat /run/secrets/notifybotPassword)
.venv/bin/prefect variable set "xmpp_recipient" $(cat /run/secrets/recipientUsername)
.venv/bin/prefect variable set "mongoclient_auth" $(cat /run/secrets/mongoclientAuth)
.venv/bin/prefect variable set "mongoclient_host" "${mongodbIp}:${mongodbPort}"
.venv/bin/prefect variable set "mongoclient_user" $(cat /run/secrets/mongoclientUser)
.venv/bin/prefect variable set "mongoclient_pwd" $(cat /run/secrets/mongoclientPassword)
.venv/bin/prefect variable set "postgres_host" ${postgresIp}
.venv/bin/prefect variable set "postgres_port" ${postgresPort}
.venv/bin/prefect variable set "postgres_user" $(cat /run/secrets/postgresUser)
.venv/bin/prefect variable set "postgres_pwd" $(cat /run/secrets/postgresPassword)
.venv/bin/prefect variable set "xmpp_jid" $(cat /run/secrets/notifybotUsername) --overwrite
.venv/bin/prefect variable set "xmpp_password" $(cat /run/secrets/notifybotPassword) --overwrite
.venv/bin/prefect variable set "xmpp_recipient" $(cat /run/secrets/recipientUsername) --overwrite
.venv/bin/prefect variable set "mongoclient_auth" $(cat /run/secrets/mongoclientAuth) --overwrite
.venv/bin/prefect variable set "mongoclient_host" "${mongodbIp}:${mongodbPort}" --overwrite
.venv/bin/prefect variable set "mongoclient_user" $(cat /run/secrets/mongoclientUser) --overwrite
.venv/bin/prefect variable set "mongoclient_pwd" $(cat /run/secrets/mongoclientPassword) --overwrite
.venv/bin/prefect variable set "postgres_host" ${postgresIp} --overwrite
.venv/bin/prefect variable set "postgres_port" ${postgresPort} --overwrite
.venv/bin/prefect variable set "postgres_user" $(cat /run/secrets/postgresUser) --overwrite
.venv/bin/prefect variable set "postgres_pwd" $(cat /run/secrets/postgresPassword) --overwrite
.venv/bin/prefect variable set "osm_history_dir" "/media/baseddata-data/osm-history"
.venv/bin/prefect variable set "mongo_db_name" "baseddata"
.venv/bin/prefect variable set "postgres_dbname" "dev_baseddata_models"
.venv/bin/prefect variable set "postgres_schema" "models_final"
.venv/bin/prefect variable set "unique_key" "row_uuid"
.venv/bin/prefect variable set "osm_history_dir" "/media/baseddata-data/osm-history" --overwrite
.venv/bin/prefect variable set "mongo_db_name" "baseddata" --overwrite
.venv/bin/prefect variable set "postgres_dbname" "dev_baseddata_models" --overwrite
.venv/bin/prefect variable set "postgres_schema" "models_final" --overwrite
.venv/bin/prefect variable set "unique_key" "row_uuid" --overwrite
# serve flows
.venv/bin/python automation/flows/serve-flows.py