Closed shakthimaan closed 9 years ago
The task is run with mesos containerizer that runs docker. You can read about running docker containers here: http://mesos.github.io/chronos/docs/api.html#adding-a-docker-job.
I used to run docker with "command": "docker run --rm ..."
I got it working using the following:
---
- name: Test
hosts: mesos_master[0]
gather_facts: yes
roles:
- role: chronos_task
chronos_url: "http://{{ inventory_hostname }}:4400"
chronos_tasks:
- type: iso8601
app:
name: dockerjob
owner: user@foo.com
container:
type: DOCKER
image: libmesos/ubuntu
command: for i in 1 2 3 4 5; do date; sleep 1; done
epsilon: PT30M
retries: 1
async: true
schedule: R/2015-07-29T17:20:00.000Z/PT24H
I have the following Ansible task running:
This runs fine and exists in Chronos successfully. Is the command run on Chronos host or inside a Docker container?
How should the task be defined if a command need to be executing inside a Docker container? I have created the following JSON input:
When I try to create the job in Chronos using curl:
the job gets created, but, I see the following error in mesos-slave.ERROR when the job gets scheduled to run:
What could I be missing?