简体   繁体   English

Gitlab CI Flask 超时

[英]Gitlab CI Flask timeouts

I am trying to deploy a Flask webapp using gitlab CI.我正在尝试使用 gitlab CI 部署 Flask webapp。

In my script I launch the following command:在我的脚本中,我启动以下命令:

- if [[ "$STATUS" == "NOTRUN" ]] ; then eval "nohup flask run &" ; fi

The problem is that the webapp is deploying, but my gitlab CI timeouts after 1hour because it thinks the command is still running.问题是 webapp 正在部署,但我的 gitlab CI 在 1 小时后超时,因为它认为命令仍在运行。

What do I have to add for it to succeed and not fail?我必须添加什么才能成功而不失败?

Thank you very much非常感谢

Unfortunately it won't be so easy.不幸的是,这不会那么容易。 There is similar issue on gitlab . gitlab也有类似的问题。

Process started with Runner, even if you add nohup and & at the end, is marked with process group ID.以 Runner 开头的进程,即使您在末尾添加 nohup 和 &,也会使用进程组 ID 进行标记。 When job is finished Runner is sending kill signal to whole process group.作业完成后,Runner 正在向整个进程组发送终止信号。 So any process started directly from CI job will be terminated at job end.因此,任何直接从 CI 作业启动的进程都将在作业结束时终止。 Using service manager you're not starting the process in context of Runner's job.使用服务管理器,您不会在 Runner 的工作环境中启动该过程。 Your only notifying a manager to start a process using prepared configuration您唯一通知经理使用准备好的配置启动流程

The only solution I know is to create some .service and run it with systemctl .我知道的唯一解决方案是创建一些.service并使用systemctl运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM