Return-Path: X-Original-To: apmail-mesos-user-archive@www.apache.org Delivered-To: apmail-mesos-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9000E17F78 for ; Tue, 30 Sep 2014 18:03:20 +0000 (UTC) Received: (qmail 47591 invoked by uid 500); 30 Sep 2014 18:03:19 -0000 Delivered-To: apmail-mesos-user-archive@mesos.apache.org Received: (qmail 47539 invoked by uid 500); 30 Sep 2014 18:03:19 -0000 Mailing-List: contact user-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@mesos.apache.org Delivered-To: mailing list user@mesos.apache.org Received: (qmail 47529 invoked by uid 99); 30 Sep 2014 18:03:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2014 18:03:19 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.214.172] (HELO mail-ob0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2014 18:03:15 +0000 Received: by mail-ob0-f172.google.com with SMTP id wo20so21091obc.3 for ; Tue, 30 Sep 2014 11:02:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=xGQ8J2mBjrVvaVblaAYd26MX9Gm5g0f4OktIgYcSYlI=; b=Yg0+8bAdedbCgsheSiy0O4tlWkdFXJhB0O0K7QjKqFQrfzkUQyzDYOiftm0898wfaQ AnuRVM2KTNfj/jZvnfrLzm0sNAF8iapF73a7OfWO8s5gC4BmVw9ba5JKutOlYU4UMdYk W/7roAKrfTVnnVQ2TmAMysJcaItkILRU2ru+VgSIfgno0WUVIqxl0EVPlR3iQCPH8BQH t9EECxEbssY3SmqWrduNkD+xyqFc6vzlt5rEgOWIp83KSxIftGRefdhnP7Fo5WkOYGKk DkUlNZI11PBaASp67FGBOobnClMrbMIynzQG7EvsanJz4Pe7cY7bPquLLEGokl/GOhoA u9Yw== X-Gm-Message-State: ALoCoQkWn4RETCm7nhChQWnYrIjee+bRYMW7Iw6e0Xzi1wII/mixxEg88/lcJxB13QwUxts3mpPw MIME-Version: 1.0 X-Received: by 10.182.232.229 with SMTP id tr5mr5777025obc.83.1412100174716; Tue, 30 Sep 2014 11:02:54 -0700 (PDT) Received: by 10.202.14.204 with HTTP; Tue, 30 Sep 2014 11:02:54 -0700 (PDT) In-Reply-To: References: Date: Tue, 30 Sep 2014 12:02:54 -0600 Message-ID: Subject: Re: Docker executor issue From: Andy Grove To: user@mesos.apache.org Content-Type: multipart/alternative; boundary=001a11c32f944d385905044c31c2 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c32f944d385905044c31c2 Content-Type: text/plain; charset=UTF-8 OK. So I figured out the issue with this and it was my misunderstanding of executors and tasks. My task info had: .setExecutor(Protos.ExecutorInfo.newBuilder(executor)) I should have had this: .setContainer(containerInfoBuilder) .setCommand(Protos.CommandInfo.newBuilder().setShell(false)) I didn't have a mesos executor deployed inside my container which explains the timeout issue. Thanks again for the support. Thanks, Andy. -- Andy Grove VP Engineering CodeFutures Corporation On Tue, Sep 30, 2014 at 10:20 AM, Andy Grove wrote: > Hi Tim, > > Thanks for helping with this. I am running mesos-master and mesos-slave > natively on the same host (my desktop). The only container in use is the > one being launched by the mesos-slave. > > I will try your suggestion of running a simple command next. > > Here is the output from the slave from this issue though: > > I0930 10:13:52.053177 30722 main.cpp:126] Build: 2014-09-29 15:35:37 by > andy > I0930 10:13:52.053228 30722 main.cpp:128] Version: 0.20.1 > I0930 10:13:53.055480 30722 containerizer.cpp:89] Using isolation: > posix/cpu,posix/mem > I0930 10:13:53.058353 30722 main.cpp:149] Starting Mesos slave > I0930 10:13:53.059651 30722 slave.cpp:167] Slave started on 1)@ > 127.0.1.1:5051 > I0930 10:13:53.060072 30722 slave.cpp:278] Slave resources: cpus(*):8; > mem(*):14963; disk(*):1.85648e+06; ports(*):[31000-32000] > I0930 10:13:53.060226 30722 slave.cpp:306] Slave hostname: davros > I0930 10:13:53.060253 30722 slave.cpp:307] Slave checkpoint: true > I0930 10:13:53.064975 30729 state.cpp:33] Recovering state from > '/tmp/mesos/meta' > I0930 10:13:53.065352 30725 status_update_manager.cpp:193] Recovering > status update manager > I0930 10:13:53.065626 30729 docker.cpp:577] Recovering Docker containers > I0930 10:13:53.065690 30724 containerizer.cpp:252] Recovering containerizer > I0930 10:13:54.055233 30723 slave.cpp:3198] Finished recovery > I0930 10:13:54.055448 30723 slave.cpp:589] New master detected at > master@127.0.0.1:5050 > I0930 10:13:54.055532 30723 slave.cpp:625] No credentials provided. > Attempting to register without authentication > I0930 10:13:54.055537 30730 status_update_manager.cpp:167] New master > detected at master@127.0.0.1:5050 > I0930 10:13:54.055552 30723 slave.cpp:636] Detecting new master > I0930 10:13:54.928225 30724 slave.cpp:754] Registered with master > master@127.0.0.1:5050; given slave ID > 20140930-101303-16777343-5050-30690-0 > I0930 10:13:54.928598 30724 slave.cpp:767] Checkpointing SlaveInfo to > '/tmp/mesos/meta/slaves/20140930-101303-16777343-5050-30690-0/slave.info' > I0930 10:14:17.330390 30725 slave.cpp:1002] Got assigned task 0 for > framework 20140930-101303-16777343-5050-30690-0000 > I0930 10:14:17.330557 30725 slave.cpp:1112] Launching task 0 for framework > 20140930-101303-16777343-5050-30690-0000 > I0930 10:14:17.331296 30725 slave.cpp:1222] Queuing task '0' for executor > default of framework '20140930-101303-16777343-5050-30690-0000 > *I0930 10:14:17.333109 30730 docker.cpp:984] Starting container > 'ebb1dca6-cc9d-427f-8faa-f3f723f6ab81' for executor 'default' and framework > '20140930-101303-16777343-5050-30690-0000'* > I0930 10:14:20.062705 30730 slave.cpp:2538] Monitoring executor 'default' > of framework '20140930-101303-16777343-5050-30690-0000' in container > 'ebb1dca6-cc9d-427f-8faa-f3f723f6ab81' > > The container is running quite happily at this point. > > I0930 10:14:53.061337 30724 slave.cpp:3053] Current usage 0.76%. Max > allowed age: 6.247043850997720days > *I0930 10:15:17.331712 30730 slave.cpp:3010] Terminating executor default > of framework 20140930-101303-16777343-5050-30690-0000 because it did not > register within 1mins* > I0930 10:15:17.332221 30728 docker.cpp:1473] Destroying container > 'ebb1dca6-cc9d-427f-8faa-f3f723f6ab81' > I0930 10:15:17.332308 30728 docker.cpp:1568] Running docker kill on > container 'ebb1dca6-cc9d-427f-8faa-f3f723f6ab81' > I0930 10:15:18.109361 30730 docker.cpp:1646] Executor for container > 'ebb1dca6-cc9d-427f-8faa-f3f723f6ab81' has exited > > > Thanks, > > Andy. > > -- > Andy Grove > VP Engineering > CodeFutures Corporation > > > > On Mon, Sep 29, 2014 at 6:25 PM, Tim Chen wrote: > >> Hi Andy, >> >> You don't need to specifiy -d as the docker containerizer will set it for >> you since we run all docker images detached. >> >> It seems like the executor just simply can't register with the slave. Can >> you try just running a simple command without Docker that takes longer than >> the executor registration timeout to see if you see the same error? >> >> Also do you run the mesos slave in a docker container as well? >> >> Will be great if you can share the slave log as Vinod suggested too. >> >> Tim >> >> >> >> >> >> >> On Mon, Sep 29, 2014 at 5:15 PM, Vinod Kone wrote: >> >>> I'll let Tim Chen help you out here since he has more context. Some >>> slave logs around the failed container launch would be helpful. >>> >>> >>> On Mon, Sep 29, 2014 at 5:03 PM, Andy Grove >>> wrote: >>> >>>> Ignore my comment about docker run not returning. That is incorrect. >>>> >>>> Thanks, >>>> >>>> Andy. >>>> >>>> -- >>>> Andy Grove >>>> VP Engineering >>>> CodeFutures Corporation >>>> >>>> >>>> >>>> On Mon, Sep 29, 2014 at 5:59 PM, Andy Grove >>> > wrote: >>>> >>>>> Hi Vinod, >>>>> >>>>> Thanks for the quick response but the image is already on the slave >>>>> and I see the container being launched almost immediately when my framework >>>>> starts (within 1-2 seconds). If I keep running docker ps, this is the last >>>>> output I see before the container is killed: >>>>> >>>>> $ docker ps >>>>> CONTAINER ID IMAGE COMMAND >>>>> CREATED STATUS PORTS >>>>> NAMES >>>>> 45f992c2781f codefutures/dbshards_zookeeper:latest "/bin/sh >>>>> -c '/opt/zo 59 seconds ago Up 58 seconds >>>>> >>>>> I am using mesos 0.20.1 and docker 1.2.0 on Ubuntu 14.04. >>>>> >>>>> So the container is running fine. It is a long running service i.e. >>>>> the docker run command will never return. Should I be providing some option >>>>> so that the docker executor passed the -d flag to the docker run command? I >>>>> guess I should start looking through the mesos source so I can see how this >>>>> works. >>>>> >>>>> Thanks, >>>>> >>>>> Andy. >>>>> >>>>> -- >>>>> Andy Grove >>>>> VP Engineering >>>>> CodeFutures Corporation >>>>> >>>>> >>>>> >>>>> On Mon, Sep 29, 2014 at 5:49 PM, Vinod Kone >>>>> wrote: >>>>> >>>>>> Trying increasing the executor registration timeout on the slave >>>>>> (--executor_registration_timeout) to give docker more time to do a pull of >>>>>> the image. >>>>>> >>>>>> On Mon, Sep 29, 2014 at 4:41 PM, Andy Grove < >>>>>> andy.grove@codefutures.com> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I've working on a prototype Mesos framework to launch docker >>>>>>> containers. I'm getting as far as seeing my container start up but after >>>>>>> one minute if gets killed due to: >>>>>>> >>>>>>> Terminating executor default of framework >>>>>>> 20140929-155916-16777343-5050-2708-0004 because it did not register within >>>>>>> 1mins >>>>>>> >>>>>>> Here is the code I am using in my scheduler, which was based on one >>>>>>> of the examples: >>>>>>> >>>>>>> @Override >>>>>>> public void resourceOffers(SchedulerDriver schedulerDriver, >>>>>>> List offers) { >>>>>>> logger.info("resourceOffers() with {} offers", offers.size()); >>>>>>> >>>>>>> for (Protos.Offer offer : offers) { >>>>>>> >>>>>>> List tasks = new ArrayList(); >>>>>>> if (launchedTasks < totalTasks) { >>>>>>> Protos.TaskID taskId = Protos.TaskID.newBuilder() >>>>>>> .setValue(Integer.toString(launchedTasks++)).build(); >>>>>>> >>>>>>> logger.info("Launching task " + taskId.getValue()); >>>>>>> >>>>>>> // docker image info >>>>>>> Protos.ContainerInfo.DockerInfo.Builder dockerInfoBuilder = >>>>>>> Protos.ContainerInfo.DockerInfo.newBuilder(); >>>>>>> dockerInfoBuilder.setImage("codefutures/dbshards_zookeeper"); >>>>>>> >>>>>>> // container info >>>>>>> Protos.ContainerInfo.Builder containerInfoBuilder = >>>>>>> Protos.ContainerInfo.newBuilder(); >>>>>>> >>>>>>> containerInfoBuilder.setType(Protos.ContainerInfo.Type.DOCKER); >>>>>>> containerInfoBuilder.setDocker(dockerInfoBuilder.build()); >>>>>>> >>>>>>> // create executor for the container >>>>>>> Protos.ExecutorInfo executor = >>>>>>> Protos.ExecutorInfo.newBuilder() >>>>>>> >>>>>>> .setExecutorId(Protos.ExecutorID.newBuilder().setValue("default")) >>>>>>> >>>>>>> .setCommand(Protos.CommandInfo.newBuilder().setShell(false)) >>>>>>> .setContainer(containerInfoBuilder) >>>>>>> .setName("Test Executor (Docker)") >>>>>>> .setSource("docker_test") >>>>>>> .build(); >>>>>>> >>>>>>> // create task to run >>>>>>> Protos.TaskInfo task = Protos.TaskInfo.newBuilder() >>>>>>> .setName("task " + taskId.getValue()) >>>>>>> .setTaskId(taskId) >>>>>>> .setSlaveId(offer.getSlaveId()) >>>>>>> .addResources(Protos.Resource.newBuilder() >>>>>>> .setName("cpus") >>>>>>> .setType(Protos.Value.Type.SCALAR) >>>>>>> >>>>>>> .setScalar(Protos.Value.Scalar.newBuilder().setValue(1))) >>>>>>> .addResources(Protos.Resource.newBuilder() >>>>>>> .setName("mem") >>>>>>> .setType(Protos.Value.Type.SCALAR) >>>>>>> >>>>>>> .setScalar(Protos.Value.Scalar.newBuilder().setValue(128))) >>>>>>> .setExecutor(Protos.ExecutorInfo.newBuilder(executor)) >>>>>>> .build(); >>>>>>> >>>>>>> tasks.add(task); >>>>>>> } >>>>>>> Protos.Filters filters = >>>>>>> Protos.Filters.newBuilder().setRefuseSeconds(1).build(); >>>>>>> >>>>>>> schedulerDriver.launchTasks(offer.getId(), tasks, filters); >>>>>>> } >>>>>>> >>>>>>> } >>>>>>> >>>>>>> Am I missing some steps with this approach? >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Andy. >>>>>>> >>>>>>> -- >>>>>>> Andy Grove >>>>>>> VP Engineering >>>>>>> CodeFutures Corporation >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > --001a11c32f944d385905044c31c2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
OK. So I figured out the issue with this and it was my mis= understanding of executors and tasks.

My task info had:<= /div>

.setExecutor(Protos.ExecutorInfo.newBuilder(execut= or))

I should have had this:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setContainer(contai= nerInfoBuilder)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setCom= mand(Protos.CommandInfo.newBuilder().setShell(false))

<= /div>
I didn't have a mesos executor deployed inside my container w= hich explains the timeout issue.

Thanks again for = the support.


Thanks,

Andy.
<= br>
--
Andy Grove
VP Engineering
CodeFutu= res Corporation



On Tue, Sep 30, 2014 at 10:20 AM, Andy Grove= <andy.grove@codefutures.com> wrote:
Hi Tim,

Thanks for = helping with this. I am running mesos-master and mesos-slave natively on th= e same host (my desktop). The only container in use is the one being launch= ed by the mesos-slave.

I will try your suggestion = of running a simple command next.

Here is the outp= ut from the slave from this issue though:

I09= 30 10:13:52.053177 30722 main.cpp:126] Build: 2014-09-29 15:35:37 by andy
I0930 10:13:52.053228 30722 main.cpp:128] Version: 0.20.1
I0930 10:13:53.055480 30722 containerizer.cpp:89] Using isolation: posix/= cpu,posix/mem
I0930 10:13:53.058353 30722 main.cpp:149] Starting = Mesos slave
I0930 10:13:53.059651 30722 slave.cpp:167] Slave star= ted on 1)@127.0.1.1:505= 1
I0930 10:13:53.060072 30722 slave.cpp:278] Slave resources:= cpus(*):8; mem(*):14963; disk(*):1.85648e+06; ports(*):[31000-32000]
=
I0930 10:13:53.060226 30722 slave.cpp:306] Slave hostname: davros
I0930 10:13:53.060253 30722 slave.cpp:307] Slave checkpoint: true
I0930 10:13:53.064975 30729 state.cpp:33] Recovering state from '= ;/tmp/mesos/meta'
I0930 10:13:53.065352 30725 status_update_m= anager.cpp:193] Recovering status update manager
I0930 10:13:53.0= 65626 30729 docker.cpp:577] Recovering Docker containers
I0930 10= :13:53.065690 30724 containerizer.cpp:252] Recovering containerizer
I0930 10:13:54.055233 30723 slave.cpp:3198] Finished recovery
= I0930 10:13:54.055448 30723 slave.cpp:589] New master detected at master@127.0.0.1:5050
I0930 10:13:54.928598 30724 slave.cpp:767] Checkpointing SlaveInfo to &#= 39;/tmp/mesos/meta/slaves/20140930-101303-16777343-5050-30690-0/slave.info'
I0930 10= :14:17.330390 30725 slave.cpp:1002] Got assigned task 0 for framework 20140= 930-101303-16777343-5050-30690-0000
I0930 10:14:17.330= 557 30725 slave.cpp:1112] Launching task 0 for framework 20140930-101303-16= 777343-5050-30690-0000
I0930 10:14:17.331296 30725 slave.cpp:1222= ] Queuing task '0' for executor default of framework '20140930-= 101303-16777343-5050-30690-0000
I0930 10:14:17.333109 30730 do= cker.cpp:984] Starting container 'ebb1dca6-cc9d-427f-8faa-f3f723f6ab81&= #39; for executor 'default' and framework '20140930-101303-1677= 7343-5050-30690-0000'
I0930 10:14:20.062705 30730 slave.c= pp:2538] Monitoring executor 'default' of framework '20140930-1= 01303-16777343-5050-30690-0000' in container 'ebb1dca6-cc9d-427f-8f= aa-f3f723f6ab81'

The container is running= quite happily at this point.

I0930 10:14:53= .061337 30724 slave.cpp:3053] Current usage 0.76%. Max allowed age: 6.24704= 3850997720days
I0930 10:15:17.331712 30730 slave.cpp:3010] Ter= minating executor default of framework 20140930-101303-16777343-5050-30690-= 0000 because it did not register within 1mins
I0930 10:15= :17.332221 30728 docker.cpp:1473] Destroying container 'ebb1dca6-cc9d-4= 27f-8faa-f3f723f6ab81'
I0930 10:15:17.332308 30728 docker.cpp= :1568] Running docker kill on container 'ebb1dca6-cc9d-427f-8faa-f3f723= f6ab81'
I0930 10:15:18.109361 30730 docker.cpp:1646] Executor= for container 'ebb1dca6-cc9d-427f-8faa-f3f723f6ab81' has exited


<= div dir=3D"ltr">Thanks,

Andy.

-= -
Andy Grove
VP Engineering
CodeFutures Corporation=



On Mon, Sep 29, 2014 at 6:25 PM, Tim Chen <= tim@mesosphere.io> wrote:
<= div dir=3D"ltr">Hi Andy,

You don't need to specifiy = -d as the docker containerizer will set it for you since we run all docker = images detached.

It seems like the executor just s= imply can't register with the slave. Can you try just running a simple = command without Docker that takes longer than the executor registration tim= eout to see if you see the same error?

Also do you= run the mesos slave in a docker container as well?

Will be great if you can share the slave log as Vinod suggested too.

Tim



=



On Mon, Sep 29, 2014 at 5:15 PM, Vinod Kone <vinodkon= e@gmail.com> wrote:
I'll let Tim Chen help you out her= e since he has more context. Some slave logs around the failed container la= unch would be helpful.

=

On Mon, Sep 29, 2= 014 at 5:03 PM, Andy Grove <andy.grove@codefutures.com> wrote:
Ignore my co= mment about docker run not returning. That is incorrect.

Thanks,
Andy.

--
Andy Grove
VP E= ngineering
CodeFutures Corporation


<= /div>

On Mon, Sep 29, 2014 at 5:5= 9 PM, Andy Grove <andy.grove@codefutures.com> wrote= :
Hi Vinod,

Thanks for the quick response but the image is already on the slave = and I see the container being launched almost immediately when my framework= starts (within 1-2 seconds). If I keep running docker ps, this is the last= output I see before the container is killed:

$ docker ps
CONTAINER ID =C2=A0 =C2=A0 =C2=A0 =C2=A0IMAGE =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 COMMAND =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0CREATED =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 STATUS =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PORTS =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NAMES
45f992c2781f =C2=A0 = =C2=A0 =C2=A0 =C2=A0codefutures/dbshards_zookeeper:latest =C2=A0 "/bin= /sh -c '/opt/zo =C2=A0 59 seconds ago =C2=A0 =C2=A0 =C2=A0Up 58 seconds= =C2=A0

I am using mesos 0.20.1 and docker 1= .2.0 on Ubuntu 14.04.

So the container is running = fine. It is a long running service i.e. the docker run command will never r= eturn. Should I be providing some option so that the docker executor passed= the -d flag to the docker run command? I guess I should start looking thro= ugh the mesos source so I can see how this works.

Thanks,

Andy= .

--
Andy Grove
VP Engineering
=
CodeFutures Corporation



On Mon, Sep 29, 2014 at 5:49 PM, Vinod Kone = <vinodkone@gmail.com> wrote:
Trying increasing the executor registration timeout o= n the slave (--executor_registration_timeout) to give docker more time to d= o a pull of the image.

On Mon, Sep 29, 2014 at 4:41 PM, Andy Grove &l= t;andy.grov= e@codefutures.com> wrote:
<= div dir=3D"ltr">Hi,

I've working on a prototype Meso= s framework to launch docker containers. I'm getting as far as seeing m= y container start up but after one minute if gets killed due to:
=
Terminating executor default of framework 20140929-1559= 16-16777343-5050-2708-0004 because it did not register within 1mins

Here is the code I am using in my scheduler, which was ba= sed on one of the examples:

=C2=A0 @Overr= ide
=C2=A0 public void resourceOffers(SchedulerDriver schedulerDr= iver, List<Protos.Offer> offers) {
=C2=A0 =C2=A0 logger.info("resourceOffers= () with {} offers", offers.size());

=C2=A0 = =C2=A0 for (Protos.Offer offer : offers) {

=C2=A0 = =C2=A0 =C2=A0 List<Protos.TaskInfo> tasks =3D new ArrayList<Protos= .TaskInfo>();
=C2=A0 =C2=A0 =C2=A0 if (launchedTasks < tota= lTasks) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Protos.TaskID taskId =3D Pr= otos.TaskID.newBuilder()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 .setValue(Integer.toString(launchedTasks++)).build();

=C2=A0 =C2=A0 =C2=A0 =C2=A0 logger.info("Launching task " + taskId.getValue()= );

=C2=A0 =C2=A0 =C2=A0 =C2=A0 // docker image inf= o
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Protos.ContainerInfo.DockerInfo.Bui= lder dockerInfoBuilder =3D Protos.ContainerInfo.DockerInfo.newBuilder();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 dockerInfoBuilder.setImage("codefu= tures/dbshards_zookeeper");

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 // container info
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Protos.C= ontainerInfo.Builder containerInfoBuilder =3D Protos.ContainerInfo.newBuild= er();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 containerInfoBuilder.setType(Pr= otos.ContainerInfo.Type.DOCKER);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cont= ainerInfoBuilder.setDocker(dockerInfoBuilder.build());

=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 // create executor for the container
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Protos.ExecutorInfo executor =3D Protos.Ex= ecutorInfo.newBuilder()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= .setExecutorId(Protos.ExecutorID.newBuilder().setValue("default"= ))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setCommand(Protos.C= ommandInfo.newBuilder().setShell(false))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 .setContainer(containerInfoBuilder)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setName("Test Executor (Docker)"= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setSource("dock= er_test")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .build()= ;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 // create task to ru= n
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Protos.TaskInfo task =3D Protos.Tas= kInfo.newBuilder()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .set= Name("task " + taskId.getValue())
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 .setTaskId(taskId)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 .setSlaveId(offer.getSlaveId())
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 .addResources(Protos.Resource.newBuilder()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setName(&quo= t;cpus")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 .setType(Protos.Value.Type.SCALAR)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setScalar(Protos.Value.Scalar.newBuilde= r().setValue(1)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .addR= esources(Protos.Resource.newBuilder()
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setName("mem")
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setType(Protos.Value.Type.SC= ALAR)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .se= tScalar(Protos.Value.Scalar.newBuilder().setValue(128)))
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setExecutor(Protos.ExecutorInfo.newBuil= der(executor))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .build()= ;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 tasks.add(task);
=C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 Protos.Filters= filters =3D Protos.Filters.newBuilder().setRefuseSeconds(1).build();
=

=C2=A0 =C2=A0 =C2=A0 schedulerDriver.launchTasks(offer.= getId(), tasks, filters);
=C2=A0 =C2=A0 }

=C2=A0 }

Am I missing some steps with this= approach?

Thanks,

=
Andy.

--
Andy Grove
VP Engineering
CodeFutures Corporation




<= /span>

<= /span>

<= /span>



--001a11c32f944d385905044c31c2--