Repository: incubator-impala Updated Branches: refs/heads/master 381a0f54b -> 5f27ae0c2
IMPALA-4427: leopard: make DOCKER_IMAGE_NAME required This patch now requires users of the Leopard framework to supply a DOCKER_IMAGE_NAME. The cloudera/impala image isn't being maintained, and until Apache Impala (incubating) decides to publish its own image, no default image name is possible. It is still possible to run the Leopard framework against a homegrown Docker image that has Apache Impala (incubating) and PostgreSQL installed: simply build such an image and export the DOCKER_IMAGE_NAME environment variable before running the controller. While here, fix some flake8 non-indent problems. Testing: short Leopard controller / query generator run. Change-Id: Ic1cb96cb5c9a894f40e0892f3bdd3f3d0158e887 Reviewed-on: http://gerrit.cloudera.org:8080/4936 Reviewed-by: Matthew Jacobs <[email protected]> Reviewed-by: Jim Apple <[email protected]> Reviewed-by: Taras Bobrovytsky <[email protected]> Tested-by: Jim Apple <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/1cfe77db Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/1cfe77db Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/1cfe77db Branch: refs/heads/master Commit: 1cfe77dbaaf6186ea4c355520c983a16644773a8 Parents: 381a0f5 Author: Michael Brown <[email protected]> Authored: Thu Nov 3 10:05:45 2016 -0700 Committer: Jim Apple <[email protected]> Committed: Fri Nov 4 20:35:17 2016 +0000 ---------------------------------------------------------------------- tests/comparison/leopard/controller.py | 5 ++--- tests/comparison/leopard/impala_docker_env.py | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/1cfe77db/tests/comparison/leopard/controller.py ---------------------------------------------------------------------- diff --git a/tests/comparison/leopard/controller.py b/tests/comparison/leopard/controller.py index 52660f5..5ac041d 100755 --- a/tests/comparison/leopard/controller.py +++ b/tests/comparison/leopard/controller.py @@ -20,7 +20,6 @@ from time import sleep, localtime, strftime from tests.comparison.query_profile import DefaultProfile, ImpalaNestedTypesProfile from schedule_item import ScheduleItem -from fabric.api import sudo, settings from threading import Thread import os import pickle @@ -47,6 +46,7 @@ POSTGRES_DATABASE_NAME = 'randomness' LOG = logging.getLogger('Controller') + class Controller(object): '''This class controls the query generator. Generates new schedule_items regularly and places them into the schedule directory. Schedule_items can also be generated by other @@ -103,14 +103,13 @@ class Controller(object): if 'TARGET_HOST_USERNAME' not in os.environ: exit('TARGET_HOST_USERNAME environment variable not set') if 'DOCKER_IMAGE_NAME' not in os.environ: - print 'DOCKER_IMAGE_NAME environment variable not set' + exit('DOCKER_IMAGE_NAME environment variable not set') def start_new_jobs(self): '''Check the schedule directory for new items. If a new item is present, start a new job (if maximum concurrency level has not been reached). Each job gets it's own thread. ''' - from job import Job finished_jobs = set(os.listdir(PATH_TO_FINISHED_JOBS)) for job_id in os.listdir(PATH_TO_SCHEDULE): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/1cfe77db/tests/comparison/leopard/impala_docker_env.py ---------------------------------------------------------------------- diff --git a/tests/comparison/leopard/impala_docker_env.py b/tests/comparison/leopard/impala_docker_env.py index 4ce12d8..38555a4 100755 --- a/tests/comparison/leopard/impala_docker_env.py +++ b/tests/comparison/leopard/impala_docker_env.py @@ -34,7 +34,6 @@ import os IMPALA_HOME = '/home/dev/Impala' CORE_PATH = '/tmp/core_files' DEFAULT_BRANCH_NAME = os.environ.get('DEFAULT_BRANCH_NAME', 'origin/master') -DEFAULT_DOCKER_IMAGE_NAME = 'cloudera/impala-dev' DOCKER_USER_NAME = os.environ.get('DOCKER_USER_NAME', 'dev') # Needed for ensuring the testdata volume is properly owned. The UID/GID from the @@ -104,8 +103,7 @@ class ImpalaDockerEnv(object): self.git_command = git_command self.host = os.environ['TARGET_HOST'] self.host_username = os.environ['TARGET_HOST_USERNAME'] - self.docker_image_name = os.environ.get( - 'DOCKER_IMAGE_NAME', DEFAULT_DOCKER_IMAGE_NAME) + self.docker_image_name = os.environ['DOCKER_IMAGE_NAME'] def stop_docker(self): with settings(warn_only=True, host_string=self.host, user=self.host_username):
