aurora-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Sirois <jsir...@apache.org>
Subject Re: Review Request 44745: Allow for a pure docker executor.
Date Sun, 13 Mar 2016 02:48:37 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44745/
-----------------------------------------------------------

(Updated March 12, 2016, 7:48 p.m.)


Review request for Aurora, Joshua Cohen and Bill Farner.


Changes
-------

Default Task.processes to [].

Now that a Task need not have processes in the case when its
containing job declares a container, default to the empty list.

 src/main/python/apache/aurora/config/__init__.py     | 2 +-
 src/main/python/apache/thermos/config/schema_base.py | 2 +-
 src/test/python/apache/aurora/client/test_config.py  | 6 ++----
 3 files changed, 4 insertions(+), 6 deletions(-)


Repository: aurora


Description
-------

This allows for a job config with no processes defined IFF there is also
a Docker container defined.  In this case it is assumed that the process
to run is the Docker container's ENTRYPOINT via the Mesos Docker
containerizer.

 src/main/python/apache/aurora/config/__init__.py    | 26 +++++++++++++++++++++++---
 src/main/python/apache/aurora/config/thrift.py      |  9 +++++----
 src/test/python/apache/aurora/client/test_config.py | 41 +++++++++++++++++++++++++++++++++++------
 src/test/python/apache/aurora/config/test_thrift.py |  5 +++++
 4 files changed, 68 insertions(+), 13 deletions(-)


Diffs (updated)
-----

  src/main/python/apache/aurora/config/__init__.py 65923be1cb8b88139b8eab0ac5b75428972d3cb1

  src/main/python/apache/aurora/config/thrift.py be0cd68674a71bd4baadf276f40a4bc0223ce4be

  src/main/python/apache/thermos/config/schema_base.py a6768e67189b0560afef844d6b269bed8ada5f2f

  src/test/python/apache/aurora/client/test_config.py b1a3c1865819899ef19173be0f861783a2631d0a

  src/test/python/apache/aurora/config/test_thrift.py 88292d3c4423c0555088a0adaee3c0e62ed0567e


Diff: https://reviews.apache.org/r/44745/diff/


Testing
-------

Locally green `./build-support/jenkins/build.sh`

I also patched in https://reviews.apache.org/r/44685/ which this change
depends on and was able to run scheduler with
`-allow_docker_parameters -require_docker_use_executor` and successfully
run this job:
```
import getpass

jobs=[
  Service(
    cluster = 'devcluster',
    role = getpass.getuser(),
    environment = 'test',
    name = 'http_example_docker_executor',
    contact = '{{role}}@localhost',
    instances = 1,
    task = Task(
      name = 'http_docker_example',
      resources = Resources(cpu=0.4, ram=32*MB, disk=64*MB),
      processes = []
    ),
    container = Container(
      docker = Docker(
        image = 'http_example',
        parameters = [
          Parameter(name = 'env', value = 'HTTP_PORT=8888'),
          Parameter(name = 'expose', value = '8888'),
          Parameter(name = 'publish', value = '8888:8888/tcp'),
        ],
      ),
    ),
  )
]
```

Using the image created with
`docker build -t http_example src/test/sh/org/apache/aurora/e2e` from:
```
FROM python:2.7

# mesos.native requires libcurl-nss to initialize MesosExecutorDriver
RUN apt-get update && apt-get -y install libcurl4-nss-dev

COPY http_example.py /tmp/
ENTRYPOINT python /tmp/http_example.py $HTTP_PORT
```

I could connect to http://aurora.local:8888 and get `Hello!` back.


Thanks,

John Sirois


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message