From ca9dff8442e5bce3aace307f98049779d625b3c5 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 19 Oct 2024 13:27:30 +0100 Subject: [PATCH] modify baseddata-worker variables --- .../nixos-containers/baseddata-worker.nix | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/hosts/common/optional/nixos-containers/baseddata-worker.nix b/hosts/common/optional/nixos-containers/baseddata-worker.nix index b0ff85d..04ed8e7 100644 --- a/hosts/common/optional/nixos-containers/baseddata-worker.nix +++ b/hosts/common/optional/nixos-containers/baseddata-worker.nix @@ -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