From 673f65be1430c609a29a9310d71929f79184d97e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 1 Feb 2016 11:19:07 -0800 Subject: Add working Node artifact builder for all platforms --- tools/run_tests/artifact_targets.py | 47 +++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'tools/run_tests/artifact_targets.py') diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index a34fa8e4fa..1061dccc9c 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -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) @@ -126,12 +126,45 @@ class CSharpExtArtifact: def __str__(self): return self.name +node_gyp_arch_map = { + 'x86': 'ia32', + 'x64': 'x64' +} + +class NodeExtArtifact: + """Builds Node native extension""" + + def __init__(self, platform, arch): + self.name = 'node_ext_{0}_{1}'.format(platform, arch) + self.platform = platform + self.arch = arch + self.gyp_arch = node_gyp_arch_map[arch] + self.labels = ['artifact', 'node', platform, arch] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + if self.platform == 'windows': + return create_jobspec(self.name, + ['tools\\run_tests\\build_artifact_node.bat', + self.gyp_arch], + shell=True) + else: + if self.platform == 'linux': + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), + 'tools/run_tests/build_artifact_node.sh {}'.format(self.gyp_arch)) + else: + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_node.sh', + self.gyp_arch]) + def targets(): """Gets list of supported targets""" - return [CSharpExtArtifact('linux', 'x86'), - CSharpExtArtifact('linux', 'x64'), - CSharpExtArtifact('macos', 'x86'), - CSharpExtArtifact('macos', 'x64'), - CSharpExtArtifact('windows', 'x86'), - CSharpExtArtifact('windows', 'x64')] + return [Cls(platform, arch) + for Cls in (CSharpExtArtifact, NodeExtArtifact) + for platform in ('linux', 'macos', 'windows') + for arch in ('x86', 'x64')] -- cgit v1.2.3