diff options
author | 2016-02-03 09:02:46 -0800 | |
---|---|---|
committer | 2016-02-03 09:02:46 -0800 | |
commit | 6f2b8993fdf67aa59966c11f73f9d188a2717b42 (patch) | |
tree | 25a1f373b5ce62178135069151cfe30c29389ae9 /tools/run_tests/artifact_targets.py | |
parent | ddb163a0e43f9225be067e244b9f06f38a3313e7 (diff) | |
parent | 6b4ec07ec9028e6c4727a3f1b83a166087d44f11 (diff) |
merge
Diffstat (limited to 'tools/run_tests/artifact_targets.py')
-rw-r--r-- | tools/run_tests/artifact_targets.py | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index a34fa8e4fa..d0aee7dda3 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2.7 # Copyright 2016, Google Inc. # All rights reserved. # @@ -62,7 +62,7 @@ def create_jobspec(name, cmdline, environ=None, shell=False, cmdline=cmdline, environ=environ, shortname='build_artifact.%s' % (name), - timeout_seconds=5*60, + timeout_seconds=10*60, flake_retries=flake_retries, timeout_retries=timeout_retries, shell=shell) @@ -80,6 +80,63 @@ def macos_arch_env(arch): return {'CFLAGS': arch_arg, 'LDFLAGS': arch_arg} +class PythonArtifact: + """Builds Python artifacts.""" + + def __init__(self, platform, arch): + self.name = 'python_%s_%s' % (platform, arch) + self.platform = platform + self.arch = arch + self.labels = ['artifact', 'python', platform, arch] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + if self.platform == 'windows': + raise Exception('Not supported yet.') + else: + if self.platform == 'linux': + return create_docker_jobspec(self.name, + 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, + 'tools/run_tests/build_artifact_python.sh') + else: + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_python.sh']) + + def __str__(self): + return self.name + + +class RubyArtifact: + """Builds ruby native gem.""" + + def __init__(self, platform, arch): + self.name = 'ruby_native_gem_%s_%s' % (platform, arch) + self.platform = platform + self.arch = arch + self.labels = ['artifact', 'ruby', platform, arch] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + if self.platform == 'windows': + raise Exception("Not supported yet") + else: + if self.platform == 'linux': + environ = {} + if self.arch == 'x86': + environ['SETARCH_CMD'] = 'i386' + return create_docker_jobspec(self.name, + 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, + 'tools/run_tests/build_artifact_ruby.sh', + environ=environ) + else: + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_ruby.sh']) + + class CSharpExtArtifact: """Builds C# native extension library""" @@ -134,4 +191,8 @@ def targets(): CSharpExtArtifact('macos', 'x86'), CSharpExtArtifact('macos', 'x64'), CSharpExtArtifact('windows', 'x86'), - CSharpExtArtifact('windows', 'x64')] + CSharpExtArtifact('windows', 'x64'), + PythonArtifact('linux', 'x86'), + PythonArtifact('linux', 'x64'), + RubyArtifact('linux', 'x86'), + RubyArtifact('linux', 'x64')] |