From 22b6bed4835ebc044c6b7ce415ea4c62196dd9d6 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Thu, 15 Oct 2015 16:54:52 -0700 Subject: [PATCH 1/2] revert global_env usage for build_interop_image --- tools/run_tests/run_interop_tests.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index a4b6a747ed1..fe8050d1bc1 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -230,10 +230,7 @@ class PHPLanguage: return _SSL_CERT_ENV def global_env(self): - # need to manually copy to each jenkins machine if we run into github - # rate limit when running `composer install` - return {"BUILD_INTEROP_DOCKER_EXTRA_ARGS": - "-v /var/local/.composer/auth.json:/root/.composer/auth.json:ro"} + return {} def __str__(self): return 'php' @@ -475,16 +472,21 @@ def server_jobspec(language, docker_image): def build_interop_image_jobspec(language, tag=None): """Creates jobspec for building interop docker image for a language""" - environ = language.global_env() if not tag: tag = 'grpc_interop_%s:%s' % (language.safename, uuid.uuid4()) - environ['INTEROP_IMAGE'] = tag - environ['BASE_NAME'] = 'grpc_interop_%s' % language.safename + env = {'INTEROP_IMAGE': tag, + 'BASE_NAME': 'grpc_interop_%s' % language.safename} if not args.travis: - environ['TTY_FLAG'] = '-t' + env['TTY_FLAG'] = '-t' + # This env variable is used to get around the github rate limit + # error when running the PHP `composer install` command + # TODO(stanleycheung): find a more elegant way to do this + if language.safename == 'php': + env['BUILD_INTEROP_DOCKER_EXTRA_ARGS'] = \ + "-v /var/local/.composer/auth.json:/root/.composer/auth.json:ro" build_job = jobset.JobSpec( cmdline=['tools/jenkins/build_interop_image.sh'], - environ=environ, + environ=env, shortname="build_docker_%s" % (language), timeout_seconds=30*60) build_job.tag = tag From f565dfb46ada281acb7faffaa407d2904684cf57 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Thu, 15 Oct 2015 17:57:09 -0700 Subject: [PATCH 2/2] add check to see if file exists --- tools/run_tests/run_interop_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index fe8050d1bc1..cecb73de71b 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -481,7 +481,7 @@ def build_interop_image_jobspec(language, tag=None): # This env variable is used to get around the github rate limit # error when running the PHP `composer install` command # TODO(stanleycheung): find a more elegant way to do this - if language.safename == 'php': + if language.safename == 'php' and os.path.exists('/var/local/.composer/auth.json'): env['BUILD_INTEROP_DOCKER_EXTRA_ARGS'] = \ "-v /var/local/.composer/auth.json:/root/.composer/auth.json:ro" build_job = jobset.JobSpec(