diff --git a/packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh b/packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh index 2d34d4d75..59f62a2fb 100755 --- a/packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh +++ b/packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh @@ -13,9 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -source ~/.nvm/nvm.sh - -nvm install 8 set -ex cd $(dirname $0) @@ -24,6 +21,7 @@ cd $tool_dir/../../.. base_dir=$(pwd) export ARTIFACTS_OUT=$base_dir/artifacts +export JOBS=8 rm -rf build || true @@ -35,4 +33,4 @@ $tool_dir/build_artifact_node.sh $tool_dir/build_artifact_node_arm.sh -docker run -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact bash -c /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine +docker run -e JOBS=8 -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine diff --git a/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.bat b/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.bat index a33236844..41177f907 100644 --- a/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.bat +++ b/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.bat @@ -20,6 +20,8 @@ set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm +set JOBS=8 + del /f /q BUILD || rmdir build /s /q call npm update || goto :error diff --git a/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh b/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh index d8128863e..e00eb6a06 100755 --- a/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh +++ b/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -NODE_ALPINE_BUILD=false + +set -ex + +arch_list=( ia32 x64 ) +node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 9.0.0 ) +electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 ) while true ; do case $1 in --with-alpine) - NODE_ALPINE_BUILD=true + arch_list=( x64 ) + electron_versions=( ) ;; "") ;; @@ -30,8 +36,6 @@ while true ; do shift || break done -NODE_ALPINE_BUILD=$1 - umask 022 cd $(dirname $0)/../../.. @@ -42,17 +46,11 @@ mkdir -p "${ARTIFACTS_OUT}" npm update -arch_list=( ia32 x64 ) - -node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 9.0.0 ) - -electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 ) - for arch in ${arch_list[@]} do for version in ${node_versions[@]} do - ./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$arch --grpc_alpine=$NODE_ALPINE_BUILD + ./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$arch cp -r build/stage/* "${ARTIFACTS_OUT}"/ done diff --git a/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node_arm.sh b/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node_arm.sh index b33f8decf..8c0202ca1 100755 --- a/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node_arm.sh +++ b/packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node_arm.sh @@ -13,9 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -source ~/.nvm/nvm.sh - -nvm use 8 set -ex cd $(dirname $0)/../../.. diff --git a/packages/grpc-native-core/tools/run_tests/artifacts/build_package_node.sh b/packages/grpc-native-core/tools/run_tests/artifacts/build_package_node.sh index 2860f68bc..412d0be23 100755 --- a/packages/grpc-native-core/tools/run_tests/artifacts/build_package_node.sh +++ b/packages/grpc-native-core/tools/run_tests/artifacts/build_package_node.sh @@ -13,9 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -source ~/.nvm/nvm.sh - -nvm use 8 set -ex cd $(dirname $0)/../../.. diff --git a/run-tests.bat b/run-tests.bat index 92c2b2993..bd9a83a99 100644 --- a/run-tests.bat +++ b/run-tests.bat @@ -20,6 +20,7 @@ PowerShell -Command .\install-nvm-windows.ps1 SET NVM_HOME=%ROOT%nvm SET NVM_SYMLINK=%ROOT%nvm\nodejs SET PATH=%NVM_HOME%;%NVM_SYMLINK%;%PATH% +SET JOBS=8 nvm version diff --git a/run-tests.sh b/run-tests.sh index c1a76889d..5df881864 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -38,6 +38,7 @@ set -ex npm install --unsafe-perm mkdir -p reports +export JOBS=8 # TODO(mlumish): Add electron tests diff --git a/kokoro.bat b/test/kokoro.bat similarity index 99% rename from kokoro.bat rename to test/kokoro.bat index fc5fd8b22..1f0fabfcf 100644 --- a/kokoro.bat +++ b/test/kokoro.bat @@ -15,6 +15,7 @@ @echo "Starting Windows test" cd /d %~dp0 +cd .. git submodule update --init git submodule foreach --recursive git submodule update --init diff --git a/kokoro.sh b/test/kokoro.sh similarity index 89% rename from kokoro.sh rename to test/kokoro.sh index 3e51749c1..c4b9373b4 100755 --- a/kokoro.sh +++ b/test/kokoro.sh @@ -14,10 +14,12 @@ # limitations under the License. set -e -cd $(dirname $0) +cd $(dirname $0)/.. # Install gRPC and its submodules. git submodule update --init git submodule foreach --recursive git submodule update --init +./packages/grpc-native-core/tools/buildgen/generate_projects.sh + ./run-tests.sh diff --git a/test/kokoro/linux-build.cfg b/test/kokoro/linux-build.cfg new file mode 100644 index 000000000..b5e6d6e63 --- /dev/null +++ b/test/kokoro/linux-build.cfg @@ -0,0 +1,19 @@ +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for Kokoro (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc-node/tools/release/kokoro.sh" +timeout_mins: 60 diff --git a/test/kokoro/linux.cfg b/test/kokoro/linux.cfg index c6b2c88f6..f40e6db43 100644 --- a/test/kokoro/linux.cfg +++ b/test/kokoro/linux.cfg @@ -15,7 +15,7 @@ # Config file for Kokoro (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc-node/kokoro.sh" +build_file: "grpc-node/test/kokoro.sh" timeout_mins: 60 action { define_artifacts { diff --git a/test/kokoro/macos-build.cfg b/test/kokoro/macos-build.cfg new file mode 100644 index 000000000..b5e6d6e63 --- /dev/null +++ b/test/kokoro/macos-build.cfg @@ -0,0 +1,19 @@ +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for Kokoro (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc-node/tools/release/kokoro.sh" +timeout_mins: 60 diff --git a/test/kokoro/macos.cfg b/test/kokoro/macos.cfg index c6b2c88f6..f40e6db43 100644 --- a/test/kokoro/macos.cfg +++ b/test/kokoro/macos.cfg @@ -15,7 +15,7 @@ # Config file for Kokoro (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc-node/kokoro.sh" +build_file: "grpc-node/test/kokoro.sh" timeout_mins: 60 action { define_artifacts { diff --git a/test/kokoro/windows-build.cfg b/test/kokoro/windows-build.cfg new file mode 100644 index 000000000..1885ef39f --- /dev/null +++ b/test/kokoro/windows-build.cfg @@ -0,0 +1,19 @@ +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for Kokoro (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc-node/tools/release/kokoro.bat" +timeout_mins: 60 diff --git a/test/kokoro/windows.cfg b/test/kokoro/windows.cfg index e4a4524bd..2b9d09060 100644 --- a/test/kokoro/windows.cfg +++ b/test/kokoro/windows.cfg @@ -15,5 +15,5 @@ # Config file for Kokoro (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc-node/kokoro.bat" +build_file: "grpc-node/test/kokoro.bat" timeout_mins: 60 diff --git a/tools/release/kokoro.bat b/tools/release/kokoro.bat new file mode 100644 index 000000000..e86e01bd7 --- /dev/null +++ b/tools/release/kokoro.bat @@ -0,0 +1,28 @@ +@rem Copyright 2018 gRPC authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo "Starting Windows build" + +cd /d %~dp0 +cd ..\.. + +git submodule update --init +git submodule foreach --recursive git submodule update --init + +set ARTIFACTS_OUT=artifacts +cd packages\grpc-native-core +call tools\run_tests\artifacts\build_artifact_node.bat +cd ..\.. + +move packages\grpc-native-core\artifacts . diff --git a/tools/release/kokoro.sh b/tools/release/kokoro.sh new file mode 100755 index 000000000..e5b578f72 --- /dev/null +++ b/tools/release/kokoro.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex +cd $(dirname $0)/../.. +base_dir=$(pwd) + +# Install gRPC and its submodules. +git submodule update --init +git submodule foreach --recursive git submodule update --init + +pip install mako +./packages/grpc-native-core/tools/buildgen/generate_projects.sh + +OS=`uname` + +case $OS in +Linux) + sudo apt-get update + sudo apt-get install -y linux-libc-dev:i386 g++-aarch64-linux-gnu g++-arm-linux-gnueabihf + ./packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh + mv packages/grpc-native-core/artifacts . + ;; +Darwin) + JOBS=8 ARTIFACTS_OUT=$base_dir/artifacts ./packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh + ;; +esac diff --git a/tools/release/kokoro/linux.cfg b/tools/release/kokoro/linux.cfg new file mode 100644 index 000000000..b3348f8d3 --- /dev/null +++ b/tools/release/kokoro/linux.cfg @@ -0,0 +1,25 @@ +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for Kokoro (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc-node/tools/release/kokoro.sh" +timeout_mins: 180 +action { + define_artifacts { + regex: "github/grpc-node/artifacts/**", + strip_prefix: "github/grpc-node/artifacts" + } +} diff --git a/tools/release/kokoro/macos.cfg b/tools/release/kokoro/macos.cfg new file mode 100644 index 000000000..73a539fae --- /dev/null +++ b/tools/release/kokoro/macos.cfg @@ -0,0 +1,25 @@ +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for Kokoro (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc-node/tools/release/kokoro.sh" +timeout_mins: 120 +action { + define_artifacts { + regex: "github/grpc-node/artifacts/**", + strip_prefix: "github/grpc-node/artifacts" + } +} diff --git a/tools/release/kokoro/windows.cfg b/tools/release/kokoro/windows.cfg new file mode 100644 index 000000000..1ba6123f3 --- /dev/null +++ b/tools/release/kokoro/windows.cfg @@ -0,0 +1,25 @@ +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for Kokoro (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc-node/tools/release/kokoro.bat" +timeout_mins: 120 +action { + define_artifacts { + regex: "github/grpc-node/artifacts/**", + strip_prefix: "github/grpc-node/artifacts" + } +}