You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/08/23 07:04:31 UTC
[GitHub] [incubator-pinot] saileshnankani opened a new pull request #5911: Add compatibility verifier scripts (#4854)
saileshnankani opened a new pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911
## Description
Adds 3 scripts to take 2 commit hashes and does rolling upgrade on the components to verify compatibility between commits.
- comp-verifier.sh (main script that does rolling upgrades)
command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
- build-release.sh (helper script that builds Pinot given a specific commit hash and target directory )
command syntax: ./build-release.sh commit_hash target_dir
- control-service.sh (helper script that starts/stops given component for a given build of Pinot)
command syntax: ./control-service.sh command component target_dir pinot_version
Starts all components in v1 version. Afterwards, it does a rolling upgrade - controller first, then the broker, and finally the server to v2.
See #4854 for design documents
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r479399437
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
+ usage stopService
+ fi
+ serviceName=$1
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ if [ -f /tmp/"${serviceName}".pid ]; then
+ servicePid=$(</tmp/"${serviceName}".pid)
+ rm /tmp/"${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
+ fi
+ else
+ echo "Can't stop component ${serviceName} since can't component ${serviceName} is not known to have been started."
Review comment:
add the full path name to pid file in this message. "Pid file {} not found. Failed to stop component {}"
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
Review comment:
dont need this check
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
Review comment:
dont need usage check
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
Review comment:
remove
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
+ usage stopService
+ fi
+ serviceName=$1
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ if [ -f /tmp/"${serviceName}".pid ]; then
+ servicePid=$(</tmp/"${serviceName}".pid)
+ rm /tmp/"${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
+ fi
+ else
+ echo "Can't stop component ${serviceName} since can't component ${serviceName} is not known to have been started."
+ fi
+}
+
+# Starts a Pinot cluster given a specific target directory
+function startServices() {
+ dirName=$1
+ startService zookeeper "$dirName"
+ startService controller "$dirName"
+ startService broker "$dirName"
+ startService server "$dirName"
+ echo "Cluster started."
+}
+
+# Stops the currently running Pinot cluster
+function stopServices() {
+ stopService controller
+ stopService broker
+ stopService server
+ stopService zookeeper
+ echo "Cluster stopped."
+}
+
+# upgrades the cluster by upgrading components one by one (Controller -> Broker -> Server)
+function switchComponents() {
+ dirName=$1
+ stopService controller
+ startService controller "$dirName"
+ stopService broker
+ startService broker "$dirName"
+ stopService server
+ startService server "$dirName"
+}
+
+# Do rolling upgrade from olderCommit to newerCommit
+function upgradeAndTest() {
+ switchComponents "$newTargetDir"
+ echo "Rolling upgrade complete."
+}
+
+# Do rolling upgrade from newerCommit to olderCommit
+function downgradeAndTest() {
+ switchComponents "$oldTargetDir"
+ echo "Rolling downgrade complete."
+}
+
+# create subdirectories for given commits
+oldTargetDir="$workingDir"/oldTargetDir
+newTargetDir="$workingDir"/newTargetDir
+
+if ! mkdir -p "$oldTargetDir" "$newTargetDir"; then
+ echo "Failed to create target directory"
+ exit 1
+fi
+
+# Building targets
+echo "Building the first target ... "
Review comment:
```suggestion
echo "Building old version "
```
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
+ usage stopService
+ fi
+ serviceName=$1
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ if [ -f /tmp/"${serviceName}".pid ]; then
+ servicePid=$(</tmp/"${serviceName}".pid)
+ rm /tmp/"${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
+ fi
+ else
+ echo "Can't stop component ${serviceName} since can't component ${serviceName} is not known to have been started."
+ fi
+}
+
+# Starts a Pinot cluster given a specific target directory
+function startServices() {
+ dirName=$1
+ startService zookeeper "$dirName"
+ startService controller "$dirName"
+ startService broker "$dirName"
+ startService server "$dirName"
+ echo "Cluster started."
+}
+
+# Stops the currently running Pinot cluster
+function stopServices() {
+ stopService controller
+ stopService broker
+ stopService server
+ stopService zookeeper
+ echo "Cluster stopped."
+}
+
+# upgrades the cluster by upgrading components one by one (Controller -> Broker -> Server)
+function switchComponents() {
+ dirName=$1
+ stopService controller
+ startService controller "$dirName"
+ stopService broker
+ startService broker "$dirName"
+ stopService server
+ startService server "$dirName"
+}
+
+# Do rolling upgrade from olderCommit to newerCommit
+function upgradeAndTest() {
+ switchComponents "$newTargetDir"
+ echo "Rolling upgrade complete."
+}
+
+# Do rolling upgrade from newerCommit to olderCommit
+function downgradeAndTest() {
+ switchComponents "$oldTargetDir"
+ echo "Rolling downgrade complete."
+}
+
+# create subdirectories for given commits
+oldTargetDir="$workingDir"/oldTargetDir
+newTargetDir="$workingDir"/newTargetDir
+
+if ! mkdir -p "$oldTargetDir" "$newTargetDir"; then
+ echo "Failed to create target directory"
+ exit 1
+fi
+
+# Building targets
+echo "Building the first target ... "
+checkoutAndBuild "$olderCommit" "$oldTargetDir"
+echo "Building the second target ..."
+checkoutAndBuild "$newerCommit" "$newTargetDir"
+
+# check that the default ports are open
+if [ "$(lsof -t -i:8097 -s TCP:LISTEN)" ] || [ "$(lsof -t -i:8098 -sTCP:LISTEN)" ] || [ "$(lsof -t -i:8099 -sTCP:LISTEN)" ] ||
+ [ "$(lsof -t -i:9000 -sTCP:LISTEN)" ] || [ "$(lsof -t -i:2181 -sTCP:LISTEN)" ]; then
+ echo "Cannot start the components since the default ports are not open. Check any existing process that may be using the default ports."
+ exit 1
+fi
+
+# Setup initial cluster with olderCommit and do rolling upgrade
+startServices "$oldTargetDir"
Review comment:
unroll the switchcomponents function here
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
Review comment:
Since these are internal function calls, you don't need to check for usage here
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
Review comment:
Please move all the functions to the top and main code below the function defintions
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
+ usage stopService
+ fi
+ serviceName=$1
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
Review comment:
remove
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
Review comment:
create the pid file inside $dirName for the release that we are working with.
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
+ usage stopService
+ fi
+ serviceName=$1
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ if [ -f /tmp/"${serviceName}".pid ]; then
+ servicePid=$(</tmp/"${serviceName}".pid)
+ rm /tmp/"${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
+ fi
+ else
+ echo "Can't stop component ${serviceName} since can't component ${serviceName} is not known to have been started."
+ fi
+}
+
+# Starts a Pinot cluster given a specific target directory
+function startServices() {
+ dirName=$1
+ startService zookeeper "$dirName"
+ startService controller "$dirName"
+ startService broker "$dirName"
+ startService server "$dirName"
+ echo "Cluster started."
+}
+
+# Stops the currently running Pinot cluster
+function stopServices() {
+ stopService controller
+ stopService broker
+ stopService server
+ stopService zookeeper
+ echo "Cluster stopped."
+}
+
+# upgrades the cluster by upgrading components one by one (Controller -> Broker -> Server)
Review comment:
We need to run tests before/after each step, so there will be a lot of code between each stop and start. Don't put this as a function as yet.. It can be in the main code for now.
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
+ usage stopService
+ fi
+ serviceName=$1
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ if [ -f /tmp/"${serviceName}".pid ]; then
+ servicePid=$(</tmp/"${serviceName}".pid)
+ rm /tmp/"${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
+ fi
+ else
+ echo "Can't stop component ${serviceName} since can't component ${serviceName} is not known to have been started."
+ fi
+}
+
+# Starts a Pinot cluster given a specific target directory
+function startServices() {
+ dirName=$1
+ startService zookeeper "$dirName"
+ startService controller "$dirName"
+ startService broker "$dirName"
+ startService server "$dirName"
+ echo "Cluster started."
+}
+
+# Stops the currently running Pinot cluster
+function stopServices() {
+ stopService controller
+ stopService broker
+ stopService server
+ stopService zookeeper
+ echo "Cluster stopped."
+}
+
+# upgrades the cluster by upgrading components one by one (Controller -> Broker -> Server)
+function switchComponents() {
+ dirName=$1
+ stopService controller
+ startService controller "$dirName"
+ stopService broker
+ startService broker "$dirName"
+ stopService server
+ startService server "$dirName"
+}
+
+# Do rolling upgrade from olderCommit to newerCommit
Review comment:
remove lines 167 to 171 for now, we will add tests later
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,210 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ elif [[ "$command" =~ checkoutAndBuild$ ]]; then
+ echo "Usage: $command commitHash dirName"
+ elif [[ "$command" =~ startService$ ]]; then
+ echo "Usage: $command serviceName dirName"
+ elif [[ "$command" =~ stopService$ ]]; then
+ echo "Usage: $command serviceName"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ if [ $# -ne 2 ]; then
+ usage checkoutAndBuild
+ fi
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ if [ $# -ne 2 ]; then
+ usage startService
+ fi
+ serviceName=$1
+ dirName=$2
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > /tmp/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController' &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > /tmp/broker.pid; exec ./pinot-admin.sh StartBroker' &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > /tmp/server.pid; exec ./pinot-admin.sh StartServer' &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ if [ $# -ne 1 ]; then
+ usage stopService
+ fi
+ serviceName=$1
+ if [[ ! " ${components[*]} " =~ $serviceName ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+ fi
+ if [ -f /tmp/"${serviceName}".pid ]; then
+ servicePid=$(</tmp/"${serviceName}".pid)
+ rm /tmp/"${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
+ fi
+ else
+ echo "Can't stop component ${serviceName} since can't component ${serviceName} is not known to have been started."
+ fi
+}
+
+# Starts a Pinot cluster given a specific target directory
+function startServices() {
+ dirName=$1
+ startService zookeeper "$dirName"
+ startService controller "$dirName"
+ startService broker "$dirName"
+ startService server "$dirName"
+ echo "Cluster started."
+}
+
+# Stops the currently running Pinot cluster
+function stopServices() {
+ stopService controller
+ stopService broker
+ stopService server
+ stopService zookeeper
+ echo "Cluster stopped."
+}
+
+# upgrades the cluster by upgrading components one by one (Controller -> Broker -> Server)
+function switchComponents() {
+ dirName=$1
+ stopService controller
+ startService controller "$dirName"
+ stopService broker
+ startService broker "$dirName"
+ stopService server
+ startService server "$dirName"
+}
+
+# Do rolling upgrade from olderCommit to newerCommit
+function upgradeAndTest() {
+ switchComponents "$newTargetDir"
+ echo "Rolling upgrade complete."
+}
+
+# Do rolling upgrade from newerCommit to olderCommit
+function downgradeAndTest() {
+ switchComponents "$oldTargetDir"
+ echo "Rolling downgrade complete."
+}
+
+# create subdirectories for given commits
+oldTargetDir="$workingDir"/oldTargetDir
+newTargetDir="$workingDir"/newTargetDir
+
+if ! mkdir -p "$oldTargetDir" "$newTargetDir"; then
+ echo "Failed to create target directory"
+ exit 1
+fi
+
+# Building targets
+echo "Building the first target ... "
+checkoutAndBuild "$olderCommit" "$oldTargetDir"
+echo "Building the second target ..."
Review comment:
```suggestion
echo "Building new version"
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r482243451
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,173 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
Review comment:
Since I set the result of mktemp to tmpDir, do you mean just renaming tmpDir to TMP_DIR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani edited a comment on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani edited a comment on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-682280899
I have implemented most of the changes you've requested. There's an additional change I made:
- Since providing a working directory is optional, I added code for building Pinot in temporary directory and handling the cleanup at exit.
- https://github.com/apache/incubator-pinot/pull/5911#discussion_r479319009
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r476107660
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
Review comment:
I required it because I'm using pinot-admin.sh to start the components and the path to pinot-admin.sh file is dependent on the Pinot version for e.g., `pinot-distribution/target/apache-pinot-incubating-0.5.0-SNAPSHOT-bin/apache-pinot-incubating-0.5.0-SNAPSHOT-bin/bin/StartZookeeper`. I'm not sure if I can get the Pinot version from the hash.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r482224630
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,173 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
Review comment:
For now, let us just echo that this needs to be cleaned up.
In some cases, we would want to keep the dir to see the logs/results, so it may be useful to keep it.
Also, I would prefer that we set a variable called TMP_DIR up front to the results of mktemp. The use of `TMP_DIR` indicates that we don't modify it -- just a convention.
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,173 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ serviceName=$1
+ dirName=$2
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > $0/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' "${dirName}" &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > $0/controller.pid; exec ./pinot-admin.sh StartController' "${dirName}" &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > $0/broker.pid; exec ./pinot-admin.sh StartBroker' "${dirName}" &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > $0/server.pid; exec ./pinot-admin.sh StartServer' "${dirName}" &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ serviceName=$1
+ dirName=$2
+ if [ -f "${dirName}/${serviceName}".pid ]; then
+ servicePid=$(<"${dirName}/${serviceName}".pid)
+ rm "${dirName}/${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
Review comment:
Unfortunate, we need a better way to stop a service gracefully. For now, that is ok
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,173 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
Review comment:
Let us remove this if
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,173 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
+ rm -rf "$tmpDir"
+ fi
+}
+
+# This function builds Pinot given a specific commit hash and target directory
+function checkoutAndBuild() {
+ commitHash=$1
+ targetDir=$2
+
+ pushd "$targetDir" || exit 1
+ git init
+ git remote add origin https://github.com/apache/incubator-pinot
+ git fetch --depth 1 origin "$commitHash"
+ git checkout FETCH_HEAD
+ mvn install package -DskipTests -Pbin-dist
+ popd || exit 1
+}
+
+# Given a component and directory, start that version of the specific component
+function startService() {
+ serviceName=$1
+ dirName=$2
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ pushd "$dirName"/pinot-tools/target/pinot-tools-pkg/bin || exit 1
+ if [ "$serviceName" = "zookeeper" ]; then
+ sh -c 'echo $$ > $0/zookeeper.pid; exec ./pinot-admin.sh StartZookeeper' "${dirName}" &
+ elif [ "$serviceName" = "controller" ]; then
+ sh -c 'echo $$ > $0/controller.pid; exec ./pinot-admin.sh StartController' "${dirName}" &
+ elif [ "$serviceName" = "broker" ]; then
+ sh -c 'echo $$ > $0/broker.pid; exec ./pinot-admin.sh StartBroker' "${dirName}" &
+ elif [ "$serviceName" = "server" ]; then
+ sh -c 'echo $$ > $0/server.pid; exec ./pinot-admin.sh StartServer' "${dirName}" &
+ fi
+ popd || exit 1
+}
+
+# Given a component, check if it known to be running and stop that specific component
+function stopService() {
+ serviceName=$1
+ dirName=$2
+ if [ -f "${dirName}/${serviceName}".pid ]; then
+ servicePid=$(<"${dirName}/${serviceName}".pid)
+ rm "${dirName}/${serviceName}".pid
+ if [ -n "$servicePid" ]; then
+ kill -9 "$servicePid"
+ fi
+ else
+ echo "Pid file ${dirName}/${serviceName}.pid not found. Failed to stop component ${serviceName}"
+ fi
+}
+
+# Starts a Pinot cluster given a specific target directory
+function startServices() {
+ dirName=$1
+ startService zookeeper "$dirName"
+ startService controller "$dirName"
+ startService broker "$dirName"
+ startService server "$dirName"
+ echo "Cluster started."
+}
+
+# Stops the currently running Pinot cluster
+function stopServices() {
+ dirName=$1
+ stopService controller "$dirName"
+ stopService broker "$dirName"
+ stopService server "$dirName"
+ stopService zookeeper "$dirName"
+ echo "Cluster stopped."
+}
+
+# cleanp the temporary directory when the bash script exits
+trap cleanup EXIT
+
+if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
+ usage compCheck
+fi
+
+# get arguments
+olderCommit=$1
+newerCommit=$2
+
+if [ -n "$3" ]; then
+ workingDir=$3
+ if [ -d "$workingDir" ]; then
+ echo "Directory ${workingDir} already exists. Use a new directory."
+ exit 1
+ fi
+else
+ # use a temp directory in case workingDir is not provided
+ tmpDir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+ workingDir=$tmpDir
+fi
+
+# create subdirectories for given commits
+oldTargetDir="$workingDir"/oldTargetDir
+newTargetDir="$workingDir"/newTargetDir
+
+if ! mkdir -p "$oldTargetDir" "$newTargetDir"; then
+ echo "Failed to create target directory"
Review comment:
include the name of the directory that failed to create
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-680122655
I fixed my comment. Hope that makes it clearer. Here is the general outline (as of now, and we can always refine it as we go along).
`compatCheck.sh` does the following:
1. Checkout and build in old-version
2. checkout and build in new version.
3. start zookeeper in any one version (old or new, does not matter)
4. Start all services in old version (controller first, broker/server in any order).
5. upgradeAnd Test()
6. dowgradeAndTest()
`upgradeAndTest()` does the following:
1. Stop controller in old version
2. Start controller in new version.
2a. More code here later
3. Stop broker in old version
4. Start broker in new version.
4a. More code in later
5. Stop server in old version
6. Start server in new version
6a. More code here later.
`downgradeAndTest()` does the folllowing:
1. Stop server in new version
2. Start server in old version
2a. More code to add here later
3. Stop broker in new version
4. Start broker in old version
4a. More code here later
5. Stop controller in new version
6. Start controlller in new version
6a. More code here later.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r475728734
##########
File path: compatibility-verifier/build-release.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that builds Pinot given a specific commit hash and target directory
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
Review comment:
Let us use this script to build one release, and invoke it as many times as needed
##########
File path: compatibility-verifier/build-release.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that builds Pinot given a specific commit hash and target directory
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
+
+# verify correct usage of this script
+if [[ $# -ne 2 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./build-release.sh commit_hash target_dir \n"
Review comment:
Introduce a function called usage() and print the usage in it. We can call that function from multiple points as necessary
##########
File path: compatibility-verifier/build-release.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that builds Pinot given a specific commit hash and target directory
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
+
+# verify correct usage of this script
+if [[ $# -ne 2 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./build-release.sh commit_hash target_dir \n"
+ exit 1
+fi
+
+# get arguments
+commit_hash=$1
+target_dir=$2
+
+# check if directory already exists and checkout
Review comment:
exit if the directory exists. We can add a -f argument later or force
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
Review comment:
Mention clearly that the script assumes the first hash is the earlier one and the second is the later one. Change your variable names to indicate so
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_1=$REPLY
+fi
+read -rep $'\n' -p "What is the Pinot version for second commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_2=$REPLY
+fi
+
+# Building targets
+read -rep $'\n' -p "Do you want to build the first target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the first target ... \n"
+ ./build-release.sh "$commitHash1" "$target_dir_1"
+fi
+
+read -rep $'\n' -p "Do you want to build the second target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the second target ... \n"
+ ./build-release.sh "$commitHash2" "$target_dir_2"
+fi
+
+if [[ $(lsof -t -i:7001 -s TCP:LISTEN) || $(lsof -t -i:8001 -sTCP:LISTEN) || $(lsof -t -i:9001 -sTCP:LISTEN) ||
Review comment:
Not sure if lsof returns all ports even if you don't have permissions
##########
File path: compatibility-verifier/control-service.sh
##########
@@ -0,0 +1,104 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that starts/stops given component for a given build of Pinot
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./control-service.sh command component target_dir pinot_version
Review comment:
You don't need pinot version
##########
File path: compatibility-verifier/build-release.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that builds Pinot given a specific commit hash and target directory
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
+
+# verify correct usage of this script
+if [[ $# -ne 2 ]]; then
Review comment:
Please use '[' instead of '[['. Won't repeat for other instances further down in this file and other files
##########
File path: compatibility-verifier/build-release.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that builds Pinot given a specific commit hash and target directory
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
+
+# verify correct usage of this script
+if [[ $# -ne 2 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./build-release.sh commit_hash target_dir \n"
Review comment:
```suggestion
echo "Usage:$0 commit_hash target_dir "
```
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
Review comment:
```suggestion
echo "Usage: $0 earlierCommitHash laterCommitHash workingDir"
```
##########
File path: compatibility-verifier/build-release.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that builds Pinot given a specific commit hash and target directory
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
+
+# verify correct usage of this script
+if [[ $# -ne 2 ]]; then
+ printf "You used %s arguments \n" "$#"
Review comment:
Remove this line
##########
File path: compatibility-verifier/build-release.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that builds Pinot given a specific commit hash and target directory
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2
+
+# verify correct usage of this script
+if [[ $# -ne 2 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./build-release.sh commit_hash target_dir \n"
+ exit 1
+fi
+
+# get arguments
+commit_hash=$1
+target_dir=$2
+
+# check if directory already exists and checkout
+# using the given commit
+if [[ ! -d $target_dir ]]; then
+ mkdir -p "$target_dir"
Review comment:
You will need to check the exit status of mkdir in case there were permission issues
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
Review comment:
Why read pinot versions? We have the commit hash, pick up whatever version or hash that is.
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_1=$REPLY
+fi
+read -rep $'\n' -p "What is the Pinot version for second commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_2=$REPLY
+fi
+
+# Building targets
+read -rep $'\n' -p "Do you want to build the first target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the first target ... \n"
+ ./build-release.sh "$commitHash1" "$target_dir_1"
+fi
+
+read -rep $'\n' -p "Do you want to build the second target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the second target ... \n"
+ ./build-release.sh "$commitHash2" "$target_dir_2"
+fi
+
+if [[ $(lsof -t -i:7001 -s TCP:LISTEN) || $(lsof -t -i:8001 -sTCP:LISTEN) || $(lsof -t -i:9001 -sTCP:LISTEN) ||
+ $(lsof -t -i:2181 -sTCP:LISTEN) || $(lsof -t -i:8011 -sTCP:LISTEN) ]]; then
+ read -rep $'\n' -p "The ports need to be open. Do you want to kill existing processes on these ports? " -n 1 -r
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
+ ## Clean up the ports and kill any processes running on them
+ if [[ $(lsof -t -i:7001 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:7001 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:8001 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:8001 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:9001 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:9001 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:2181 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:2181 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:8011 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:8011 -s TCP:LISTEN)"
+ fi
+ fi
+fi
+
+read -rep $'\n' -p "Do you want to build the cluster with first commit? [default: no] " -n 1 -r
+if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+ exit 0;
+fi
+
+
+# Setup initial cluster (with commit in target_dir_1)
+
+printf "\n\nStarting Zookeeper ...\n"
Review comment:
You don't need these prompts.
##########
File path: compatibility-verifier/control-service.sh
##########
@@ -0,0 +1,104 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that starts/stops given component for a given build of Pinot
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./control-service.sh command component target_dir pinot_version
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./control-service.sh command component target_dir pinot_version \n"
+ exit 1
+fi
+
+# get arguments
+command=$1
+component=$2
+target_dir=$3
+pinot_version=$4
+
+declare -a commands=("start" "stop")
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+if [[ ! -d "$target_dir"/incubator-pinot ]]; then
+ printf "%s/incubator-pinot does not exist \n " "$target_dir"
+ exit 1
+fi
+
+# Handle invalid arguments
+if [[ ! " ${commands[*]} " =~ $command ]]; then
+ printf "%s is not a valid command. Command must be one of: start and stop\n" "$command"
+ printf "Usage: \n ./controlService.sh command component target_dir \n"
+ exit 1
+fi
+if [[ ! " ${components[*]} " =~ $component ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+fi
+
+# Define ports for the test
+zkPort=2181
Review comment:
For now, just use the default ports on the service. Let us get a basic framework working. and then we can add the bells and whistles.
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_1=$REPLY
+fi
+read -rep $'\n' -p "What is the Pinot version for second commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_2=$REPLY
+fi
+
+# Building targets
+read -rep $'\n' -p "Do you want to build the first target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the first target ... \n"
+ ./build-release.sh "$commitHash1" "$target_dir_1"
+fi
+
+read -rep $'\n' -p "Do you want to build the second target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the second target ... \n"
+ ./build-release.sh "$commitHash2" "$target_dir_2"
+fi
+
+if [[ $(lsof -t -i:7001 -s TCP:LISTEN) || $(lsof -t -i:8001 -sTCP:LISTEN) || $(lsof -t -i:9001 -sTCP:LISTEN) ||
+ $(lsof -t -i:2181 -sTCP:LISTEN) || $(lsof -t -i:8011 -sTCP:LISTEN) ]]; then
+ read -rep $'\n' -p "The ports need to be open. Do you want to kill existing processes on these ports? " -n 1 -r
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
+ ## Clean up the ports and kill any processes running on them
+ if [[ $(lsof -t -i:7001 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:7001 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:8001 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:8001 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:9001 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:9001 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:2181 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:2181 -s TCP:LISTEN)"
+ fi
+ if [[ $(lsof -t -i:8011 -s TCP:LISTEN) ]]; then
+ kill -9 "$(lsof -t -i:8011 -s TCP:LISTEN)"
+ fi
+ fi
+fi
+
+read -rep $'\n' -p "Do you want to build the cluster with first commit? [default: no] " -n 1 -r
Review comment:
remove this prompt. The user has entered the command, and is therefore ready to build the cluster.
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_1=$REPLY
+fi
+read -rep $'\n' -p "What is the Pinot version for second commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_2=$REPLY
+fi
+
+# Building targets
+read -rep $'\n' -p "Do you want to build the first target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the first target ... \n"
+ ./build-release.sh "$commitHash1" "$target_dir_1"
+fi
+
+read -rep $'\n' -p "Do you want to build the second target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the second target ... \n"
+ ./build-release.sh "$commitHash2" "$target_dir_2"
+fi
+
+if [[ $(lsof -t -i:7001 -s TCP:LISTEN) || $(lsof -t -i:8001 -sTCP:LISTEN) || $(lsof -t -i:9001 -sTCP:LISTEN) ||
Review comment:
Do not kill existing processes. If the ports are not open, exit with an error saying so
We will add additional a config file for each component to fine-tune things. For now,
default configs and ports are good enough to get things going.
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
Review comment:
Take a working dir as argument and mkdir two subdirs in it, one for each commit hash.
##########
File path: compatibility-verifier/control-service.sh
##########
@@ -0,0 +1,104 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A helper script that starts/stops given component for a given build of Pinot
+# This script is intended to be called stand-alone or from comp-verifier.sh
+# command syntax: ./control-service.sh command component target_dir pinot_version
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./control-service.sh command component target_dir pinot_version \n"
+ exit 1
+fi
+
+# get arguments
+command=$1
+component=$2
+target_dir=$3
+pinot_version=$4
+
+declare -a commands=("start" "stop")
+declare -a components=("controller" "broker" "server" "zookeeper")
+
+if [[ ! -d "$target_dir"/incubator-pinot ]]; then
+ printf "%s/incubator-pinot does not exist \n " "$target_dir"
+ exit 1
+fi
+
+# Handle invalid arguments
+if [[ ! " ${commands[*]} " =~ $command ]]; then
+ printf "%s is not a valid command. Command must be one of: start and stop\n" "$command"
+ printf "Usage: \n ./controlService.sh command component target_dir \n"
+ exit 1
+fi
+if [[ ! " ${components[*]} " =~ $component ]]; then
+ printf "Not a valid component. Needs to be one of: %s \n" "${components[*]}"
+ exit 1
+fi
+
+# Define ports for the test
+zkPort=2181
+localhost=2181
+controllerPort=9001
+brokerPort=7001
+serverPort=8001
+serverAdminPort=8011
+
+if [[ "$command" == "start" ]]; then
+ # Navigate to the directory containing the scripts
+ if [[ $pinot_version == "0.3.0" ]]; then
+ pushd "$target_dir"/incubator-pinot/pinot-distribution/target/apache-pinot-incubating-"$pinot_version"-SNAPSHOT-bin/apache-pinot-incubating-"$pinot_version"-SNAPSHOT-bin/bin || exit 1
+ elif [[ $pinot_version == "0.4.0" ]]; then
+ pushd "$target_dir"/incubator-pinot/pinot-distribution/target/apache-pinot-incubating-"$pinot_version"-SNAPSHOT-bin/apache-pinot-incubating-"$pinot_version"-SNAPSHOT-bin/bin || exit 1
+ else
+ pushd "$target_dir"/incubator-pinot/pinot-distribution/target/apache-pinot-incubating-"$pinot_version"-SNAPSHOT-bin/apache-pinot-incubating-"$pinot_version"-SNAPSHOT-bin/bin || exit 1
+ fi
+
+ # Start the desired component
+ # Upon start, save the pid of the process for a component into a file in /tmp/{component}.pid, which is then used to stop it
+ if [[ "$component" == "controller" ]]; then
+ sh -c 'echo $$ > /tmp/controller.pid; exec ./pinot-admin.sh StartController -zkAddress localhost:$0 -clusterName PinotCluster -controllerPort $1 > /tmp/pinot-controller.log' ${localhost} "${controllerPort}"
Review comment:
Just start with default ports for now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r482252386
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,173 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
Review comment:
just move the assignment to `tmpDir` to be an assignment to `TMP_DIR` and move it to the top of the file. It does not create the dir anyway, only assigns a dir name. We can create the dir if needed (if working dir is not supplied)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r479319009
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_1=$REPLY
+fi
+read -rep $'\n' -p "What is the Pinot version for second commitHash? [default: 0.5.0] " -r
+if [[ ! $REPLY == "" ]]; then
+ pinot_version_2=$REPLY
+fi
+
+# Building targets
+read -rep $'\n' -p "Do you want to build the first target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the first target ... \n"
+ ./build-release.sh "$commitHash1" "$target_dir_1"
+fi
+
+read -rep $'\n' -p "Do you want to build the second target? [default: no] " -n 1 -r
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ printf "Building the second target ... \n"
+ ./build-release.sh "$commitHash2" "$target_dir_2"
+fi
+
+if [[ $(lsof -t -i:7001 -s TCP:LISTEN) || $(lsof -t -i:8001 -sTCP:LISTEN) || $(lsof -t -i:9001 -sTCP:LISTEN) ||
Review comment:
I'm currently not sure how to circumvent this issue. I could try adding sudo, but that would prompt users with password.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-679499350
> Overall: Thanks for getting this started.
>
> 1. You don't need to use version
> 2. Remove all prompts. The test should be push-button. Top-level goal is to enter a single command with two commit hashes (and maybe a working dir) and it should run all the tests we have.
> 3. Please use camel case instead of underscores
> 4. Use shell functions when possible. Adding a function for usage() has often been useful for me, to be invoked from anywhere we see discrepancies that we think are user errors.
>
> High-Level command:
> `compatCheck.sh olderCommit newerCommit [workingDir]`
> Sub-commands that you will find useful to develop, either as functions or separate commands:
> `checkoutAndBuild commitHash dirName`
> `startServices dirName`
> `stopServices dirName`
>
> For now, functions should be enough, we can split the files as needed later.
Do you suggest that startServices/stopServices functions should be available along with control-service subcommand or is it supposed to replace it? In the case it replaces the control-service file entirely, its command syntax suggests that we lose the ability to do a rolling upgrade as we don't have control over a specific component anymore.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani edited a comment on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani edited a comment on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-679499350
> Overall: Thanks for getting this started.
>
> 1. You don't need to use version
> 2. Remove all prompts. The test should be push-button. Top-level goal is to enter a single command with two commit hashes (and maybe a working dir) and it should run all the tests we have.
> 3. Please use camel case instead of underscores
> 4. Use shell functions when possible. Adding a function for usage() has often been useful for me, to be invoked from anywhere we see discrepancies that we think are user errors.
>
> High-Level command:
> `compatCheck.sh olderCommit newerCommit [workingDir]`
> Sub-commands that you will find useful to develop, either as functions or separate commands:
> `checkoutAndBuild commitHash dirName`
> `startServices dirName`
> `stopServices dirName`
>
> For now, functions should be enough, we can split the files as needed later.
Do you suggest that startServices/stopServices functions should be available along with control-service subcommand or is it supposed to replace it? In the case it replaces the control-service.sh file entirely, its command syntax suggests that we can't do rolling upgrade using startService/stopService as we don't pass in a specific component unlike control-service.sh
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu merged pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
mcvsubbu merged pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani edited a comment on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani edited a comment on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-679499350
> Overall: Thanks for getting this started.
>
> 1. You don't need to use version
> 2. Remove all prompts. The test should be push-button. Top-level goal is to enter a single command with two commit hashes (and maybe a working dir) and it should run all the tests we have.
> 3. Please use camel case instead of underscores
> 4. Use shell functions when possible. Adding a function for usage() has often been useful for me, to be invoked from anywhere we see discrepancies that we think are user errors.
>
> High-Level command:
> `compatCheck.sh olderCommit newerCommit [workingDir]`
> Sub-commands that you will find useful to develop, either as functions or separate commands:
> `checkoutAndBuild commitHash dirName`
> `startService serviceName dirName`
> `stopService serviceName dirName`
>
> For now, functions should be enough, we can split the files as needed later.
Do you suggest that startServices/stopServices functions should be available along with control-service subcommand or is it supposed to replace it? In the case it replaces the control-service.sh file entirely, its command syntax suggests that we can't do rolling upgrade using startService/stopService as we don't pass in a specific component unlike control-service.sh
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-commenter commented on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-678741190
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5911?src=pr&el=h1) Report
> Merging [#5911](https://codecov.io/gh/apache/incubator-pinot/pull/5911?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) will **increase** coverage by `0.81%`.
> The diff coverage is `68.95%`.
[](https://codecov.io/gh/apache/incubator-pinot/pull/5911?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5911 +/- ##
==========================================
+ Coverage 66.44% 67.26% +0.81%
==========================================
Files 1075 1184 +109
Lines 54773 62044 +7271
Branches 8168 9479 +1311
==========================================
+ Hits 36396 41735 +5339
- Misses 15700 17228 +1528
- Partials 2677 3081 +404
```
| Flag | Coverage Δ | |
|---|---|---|
| #integration | `43.95% <48.81%> (?)` | |
| #unittests | `58.66% <56.27%> (?)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/5911?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `100.00% <ø> (ø)` | |
| [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `52.83% <0.00%> (-13.84%)` | :arrow_down: |
| [...ava/org/apache/pinot/client/AbstractResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Fic3RyYWN0UmVzdWx0U2V0LmphdmE=) | `53.33% <0.00%> (-3.81%)` | :arrow_down: |
| [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `44.44% <0.00%> (-4.40%)` | :arrow_down: |
| [.../org/apache/pinot/client/ResultTableResultSet.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L1Jlc3VsdFRhYmxlUmVzdWx0U2V0LmphdmE=) | `24.00% <0.00%> (-10.29%)` | :arrow_down: |
| [...ot/common/messages/RoutingTableRebuildMessage.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWVzc2FnZXMvUm91dGluZ1RhYmxlUmVidWlsZE1lc3NhZ2UuamF2YQ==) | `54.54% <ø> (ø)` | |
| [...ache/pinot/common/metadata/ZKMetadataProvider.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0YWRhdGEvWktNZXRhZGF0YVByb3ZpZGVyLmphdmE=) | `72.22% <ø> (+5.36%)` | :arrow_up: |
| [...metadata/segment/LLCRealtimeSegmentZKMetadata.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0YWRhdGEvc2VnbWVudC9MTENSZWFsdGltZVNlZ21lbnRaS01ldGFkYXRhLmphdmE=) | `47.61% <ø> (+3.35%)` | :arrow_up: |
| [...g/apache/pinot/common/metrics/AbstractMetrics.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9BYnN0cmFjdE1ldHJpY3MuamF2YQ==) | `82.57% <ø> (+7.90%)` | :arrow_up: |
| [...a/org/apache/pinot/common/metrics/BrokerGauge.java](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJHYXVnZS5qYXZh) | `91.66% <ø> (+1.66%)` | :arrow_up: |
| ... and [852 more](https://codecov.io/gh/apache/incubator-pinot/pull/5911/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5911?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5911?src=pr&el=footer). Last update [331b874...21f2542](https://codecov.io/gh/apache/incubator-pinot/pull/5911?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r476113557
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
Review comment:
Never mind. I noticed there is also `./pinot-tools/target/pinot-tools-pkg/bin/pinot-admin.sh` that I can use.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-682280899
I have implemented most of the changes you've requested. There's an additional change I made:
- Since providing a working directory is optional, I added code for building Pinot in temporary directory and handling the cleanup at exit.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r482243451
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -0,0 +1,173 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# get usage of the script
+function usage() {
+ command=$1
+ if [[ "$command" =~ compCheck.sh$ ]] ; then
+ echo "Usage: $command olderCommit newerCommit [workingDir]"
+ fi
+ exit 1
+}
+
+# cleanup the temporary directory when exiting the script
+function cleanup() {
+ if [ -n "$tmpDir" ] && [ -d "$tmpDir" ]; then
Review comment:
So do you mean just renaming tmpDir to TMP_DIR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani commented on a change in pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani commented on a change in pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#discussion_r476107660
##########
File path: compatibility-verifier/comp-verifier.sh
##########
@@ -0,0 +1,145 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+# A script that does rolling upgrade of Pinot components
+# from one version to the other given 2 commit hashes. It first builds
+# Pinot in the 2 given directories and then upgrades in the following order:
+# Controller -> Broker -> Server
+
+# verify correct usage of this script
+if [[ $# -ne 4 ]]; then
+ printf "You used %s arguments \n" "$#"
+ printf "Usage: \n ./comp-verifier.sh commitHash1 target_dir_1 commitHash2 target_dir_2 \n"
+ exit 1
+fi
+
+# get arguments
+commitHash1=$1
+target_dir_1=$2
+commitHash2=$3
+target_dir_2=$4
+pinot_version_1="0.5.0"
+pinot_version_2="0.5.0"
+
+read -rep $'\n' -p "What is the Pinot version for first commitHash? [default: 0.5.0] " -r
Review comment:
I required it because I'm using pinot-admin.sh to start the components and the path to pinot-admin.sh file is dependent on the Pinot version for e.g., `pinot-distribution/target/apache-pinot-incubating-0.5.0-SNAPSHOT-bin/apache-pinot-incubating-0.5.0-SNAPSHOT-bin/`. I'm not sure if I can get the Pinot version from the hash.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] saileshnankani edited a comment on pull request #5911: Add compatibility verifier scripts (#4854)
Posted by GitBox <gi...@apache.org>.
saileshnankani edited a comment on pull request #5911:
URL: https://github.com/apache/incubator-pinot/pull/5911#issuecomment-679499350
> Overall: Thanks for getting this started.
>
> 1. You don't need to use version
> 2. Remove all prompts. The test should be push-button. Top-level goal is to enter a single command with two commit hashes (and maybe a working dir) and it should run all the tests we have.
> 3. Please use camel case instead of underscores
> 4. Use shell functions when possible. Adding a function for usage() has often been useful for me, to be invoked from anywhere we see discrepancies that we think are user errors.
>
> High-Level command:
> `compatCheck.sh olderCommit newerCommit [workingDir]`
> Sub-commands that you will find useful to develop, either as functions or separate commands:
> `checkoutAndBuild commitHash dirName`
> `startServices dirName`
> `stopServices dirName`
>
> For now, functions should be enough, we can split the files as needed later.
Do you suggest that startServices/stopServices functions should be available along with control-service subcommand or is it supposed to replace it? In the case it replaces the control-service file entirely, its command syntax suggests that we can't do rolling upgrade using startService/stopService as we don't pass in a specific component.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org