Closed jplock closed 10 years ago
A daemon container like that should "just work". The integration tests cover a similar use case:
class PGScheduler(Scheduler):
def __init__(self, sleep=10,
container="docker:///zaiste/postgresql",
trials=10):
Scheduler.__init__(self, trials)
self.container = container
self.sleep = sleep
def statusUpdate(self, driver, update):
super(type(self), self).statusUpdate(driver, update)
if update.state == mesos_pb2.TASK_RUNNING:
def end_task():
time.sleep(self.sleep)
driver.killTask(update.task_id)
thread = threading.Thread(target=end_task)
thread.daemon = True
thread.start()
if self.all_tasks_done():
self.sum_up()
driver.stop()
def resourceOffers(self, driver, offers):
for offer in offers:
if len(self.tasks) >= self.trials: break
tid = self.next_task_id()
sid = offer.slave_id
task = task_with_daemon(tid, sid, self.container)
self.tasks += [task]
self.loggers[tid].info(present_task(task))
driver.launchTasks(offer.id, [task])
https://github.com/mesosphere/deimos/blob/master/integration-test/deimos-test.py#L93
@jplock, did you have any problems running other Docker images? We use Deimos internally and run images not based off "libmesos/ubuntu". The container needs to have no knowledge it is being run on top of Mesos.
I think this was solved in a later deimos release so I think it can be closed.
Is it possible to run any docker container available in the registry or only containers based upon
libmesos/ubuntu
?For example, I have some containers that start their single internal process as soon as they are launched, so I'd like to do something like:
with no
cmd
specified and nooptions
provided. Should that work or what is the significance oflibmesos/ubuntu
? This container exists in the Docker registry at https://hub.docker.com/u/jplock/rabbitmq/ and I am able to rundocker pull jplock/rabbitmq
to download it. Thanks.