Closed galamit86 closed 3 years ago
Hmmm, I think there might be something else going on which may also be the root cause of the long processing times.
On Fri, Mar 19, 2021 at 2:01 PM Amit Gal @.***> wrote:
Even with a non preemptible machine, prefect's Local Agent seems to crash sometimes.
To ensure it is always running in the background when the VM is running, Prefect recommend https://docs.prefect.io/orchestration/agents/local.html#using-with-supervisor using Supervisor http://supervisord.org/index.html.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dataverbinders/nl-open-data/issues/77, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7GYDU6727OAQJX6L3A6OTTENDMFANCNFSM4ZOYAT3Q .
Actually, I think it was how I started the client: SSH'ing from my terminal, then starting the client - so when my machine went to sleep, it broke the connection and the agent. I've restarted it by using SSH's command
option, so it's not related to my terminal. If there are no issues in this round, then we're good. TBC.
In that case, perhaps give nohup a try: https://www.maketecheasier.com/nohup-and-uses/
So far so good. This is the local command I use to start up the remote agent:
gcloud compute ssh amitgalmail@nl-open-data-vm-1 --command '. $HOME/.ssh_init && cd nl-open-data && . .venv/bin/activate && nohup prefect agent local start'
This assumes that the VM is preconfigured with nl-open-data
installed via poetry
, and that the following file is placed at $HOME/.ssh_init
:
# store this file as ".ssh_init" in the $HOME directory of the vm
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
export PATH="$HOME/.poetry/bin:$PATH"
Even with a non preemptible machine, prefect's
Local Agent
seems to crash sometimes.To ensure it is always running in the background when the VM is running, Prefect recommend using Supervisor.