mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-15 05:09:44 +08:00
26 lines
910 B
Bash
Executable File
26 lines
910 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Unified cluster entrypoint: bootstrap if no cluster is running, then
|
|
# incremental deploy.
|
|
|
|
set -euo pipefail
|
|
|
|
CLUSTER_NAME=${CLUSTER_NAME:-$(basename "$PWD")}
|
|
CONTAINER_NAME="navigator-cluster-${CLUSTER_NAME}"
|
|
|
|
if ! docker ps -q --filter "name=${CONTAINER_NAME}" | grep -q .; then
|
|
echo "No running cluster found. Bootstrapping..."
|
|
exec tasks/scripts/cluster-bootstrap.sh fast
|
|
fi
|
|
|
|
# Container is running but not healthy — tear it down and re-bootstrap.
|
|
if ! docker ps -q --filter "name=^${CONTAINER_NAME}$" --filter "health=healthy" | grep -q .; then
|
|
echo "Cluster container '${CONTAINER_NAME}' is running but not healthy. Recreating..."
|
|
exec tasks/scripts/cluster-bootstrap.sh fast
|
|
fi
|
|
|
|
exec tasks/scripts/cluster-deploy-fast.sh "$@"
|