python - 游牧者 : Unable to Run a python script

标签 python scheduler nomad

我正在尝试将以下作业提交到我的游牧服务器。该作业基本上使用一个有效负载,它是来 self 的本地主机的 python 文件。

job "agent-collector-bot" {
  datacenters = ["staging"]

  type = "batch"

  periodic {
    cron             = "*/10 * * * *"
    prohibit_overlap = true
  }

  group "python-bot" {
    count = 1
    task "slack-bot" {
      driver = "raw_exec"

      config {
        command = "python"
        args = ["local/agent-collector-slackbot.py"]
      }

      dispatch_payload {
       file = "agent-collector-slackbot.py"
     }

    }
  }
}

现在,当我看到 nomad 中的工作状态时,它会显示:

snomad 状态代理-收集器-bot/

ID            = agent-collector-bot/periodic-1512465000
Name          = agent-collector-bot/periodic-1512465000
Submit Date   = 12/05/17 14:40:00 IST
Type          = batch
Priority      = 50
Datacenters   = staging
Status        = pending
Periodic      = false
Parameterized = false

Summary
Task Group  Queued  Starting  Running  Failed  Complete  Lost
python-bot  1       0         0        0       0         0

Placement Failure
Task Group "python-bot":
  * Constraint "missing drivers" filtered 5 nodes

我检查了我的 nomad 客户端(所有 5 个)都安装了 python。有人可以帮助我吗?

最佳答案

输出中指定的驱动程序是 raw_exec,而不是 python。

您需要在客户端配置中启用它 ( nomad raw_exec docs )

client {
  options = {
    "driver.raw_exec.enable" = "1"
  }
}

关于python - 游牧者 : Unable to Run a python script,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47651999/

相关文章:

javascript - Rxjs:你想在什么场景下使用调度器

python - 当多个脚本同时运行时限制 Luigi worker 的数量

nomad - nomad 什么时候限制任务?

javascript - 默认参数和柯里化(Currying) : Python vs. Javascript

python django部分匹配正则表达式

timer - 有没有办法在特定时间或间隔安排任务?

docker - 关于docker的管弦乐队工具,可以最大程度地利用服务器资源

docker - Kafka Connect- worker 是否需要彼此直接沟通

python - Networkx 绘图标签部分在框外

python - 从 python 作为 google 组发送电子邮件