From 1e3351f3f46b348015ebe846b1f2975d54eb60c1 Mon Sep 17 00:00:00 2001 From: Colin Hom Date: Thu, 7 Jul 2016 14:25:16 -0700 Subject: [PATCH] local-docker.sh now accepts env vars --- buildman/manager/executor.py | 9 ++++----- local-docker.sh | 10 +++++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/buildman/manager/executor.py b/buildman/manager/executor.py index 82a6efe06..664ff6535 100644 --- a/buildman/manager/executor.py +++ b/buildman/manager/executor.py @@ -322,18 +322,18 @@ class KubernetesExecutor(BuilderExecutor): 'labels': { 'build': build_uuid, 'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'), - 'worker': socket.gethostname(), + 'manager': socket.gethostname(), 'quay-sha': release.GIT_HEAD or 'none', }, }, 'spec' : { - 'activeDeadlineSeconds' : 7200, - 'template' : { + 'activeDeadlineSeconds': self.executor_config.get('MAXIMUM_JOB_TIME', 7200), + 'template': { 'metadata': { 'labels': { 'build': build_uuid, 'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'), - 'worker': socket.gethostname(), + 'manager': socket.gethostname(), 'quay-sha': release.GIT_HEAD or 'none', }, }, @@ -378,7 +378,6 @@ class KubernetesExecutor(BuilderExecutor): @coroutine def stop_builder(self, builder_id): - pods_path = '/api/v1/namespaces/%s/pods' % self.namespace selectorString = "job-name=%s" % builder_id diff --git a/local-docker.sh b/local-docker.sh index 4545331a7..884346ec3 100755 --- a/local-docker.sh +++ b/local-docker.sh @@ -7,7 +7,15 @@ REPO=quay.io/quay/quay-dev d () { docker build -t $REPO -f dev.df --build-arg src_subdir=$(basename `pwd`) . - docker -- run --rm -v /var/run/docker.sock:/run/docker.sock -it --net=host -v $(pwd)/..:/src $REPO $* + + #ENV_VARS="foo=bar key=value name=joe" + local envStr="" + if [[ "$ENV_VARS" != "" ]];then + for envVar in $ENV_VARS;do + envStr="${envStr} -e \"${envVar}\"" + done + fi + docker -- run --rm $envStr -v /var/run/docker.sock:/run/docker.sock -it --net=host -v $(pwd)/..:/src $REPO $* } case $1 in