unknowntpo commented on code in PR #56:
URL:
https://github.com/apache/gravitino-playground/pull/56#discussion_r1833588200
##########
playground.sh:
##########
@@ -55,50 +94,95 @@ checkPortInUse() {
openPort=$(sudo lsof -i :$port -sTCP:LISTEN)
fi
if [ -z "${openPort}" ]; then
- echo "Port $port is ok."
+ echo "INFO: Port $port is ok."
else
- echo "Port $port is in use. Please check it."
+ echo "ERROR: Port $port is in use. Please check it."
exit 1
fi
}
start() {
- echo "Starting the playground..."
- testDocker
- checkCompose
+ echo "INFO: Starting the playground..."
- ports=(8090 9001 3307 19000 19083 60070 13306 15342 18080 18888 19090 13000)
- for port in "${ports[@]}"; do
- checkPortInUse ${port}
- done
+ case "$runtime" in
+ k8s)
+ testK8s
+ checkHelm
+ ;;
+ docker)
+ testDocker
+ checkCompose
+ ports=(8090 9001 3307 19000 19083 60070 13306 15342 18080 18888 19090
13000)
+ for port in "${ports[@]}"; do
+ checkPortInUse ${port}
+ done
+ ;;
+ esac
cd ${playground_dir}
echo "Preparing packages..."
./init/spark/spark-dependency.sh
./init/gravitino/gravitino-dependency.sh
./init/jupyter/jupyter-dependency.sh
- logSuffix=$(date +%Y%m%d%H%m%s)
- docker-compose up --detach
- docker compose logs -f >${playground_dir}/playground-${logSuffix}.log 2>&1 &
- echo "Check log details: ${playground_dir}/playground-${logSuffix}.log"
+ case "$runtime" in
+ k8s)
+ helm upgrade --install gravitino-playground ./helm-chart/ \
+ --create-namespace --namespace gravitino-playground \
+ --set projectRoot=$(pwd)
+ ;;
+ docker)
+ logSuffix=$(date +%Y%m%d%H%m%s)
+ docker-compose up --detach
+ docker compose logs -f >${playground_dir}/playground-${logSuffix}.log 2>&1
&
+ echo "Check log details: ${playground_dir}/playground-${logSuffix}.log"
+ ;;
+ esac
}
status() {
- docker-compose ps -a
+ case "$runtime" in
+ k8s)
+ kubectl -n gravitino-playground get pods -o wide
+ ;;
+ docker)
+ docker-compose ps -a
+ ;;
+ esac
}
stop() {
- echo "Stopping the playground..."
- docker-compose down
- if [ $? -eq 0 ]; then
- echo "Playground stopped!"
- fi
+ echo "INFO: Stopping the playground..."
+
+ case "$runtime" in
+ k8s)
+ helm uninstall gravitino-playground
Review Comment:
ok, done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]