mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
ops: added a check for docker-compose version in Nomad utility scripts
This commit is contained in:
parent
bb0c4d19d8
commit
6934e8b4d1
|
|
@ -199,6 +199,16 @@ ensure_docker_installed() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_docker_compose() {
|
||||||
|
# Check if 'docker compose' (v2 plugin) is available
|
||||||
|
if ! docker compose version &>/dev/null; then
|
||||||
|
echo -e "${RED}#${RESET} Docker Compose v2 is not installed or not available as a Docker plugin."
|
||||||
|
echo -e "${YELLOW}#${RESET} This script requires 'docker compose' (v2), not 'docker-compose' (v1)."
|
||||||
|
echo -e "${YELLOW}#${RESET} Please read the Docker documentation at https://docs.docker.com/compose/install/ for instructions on how to install Docker Compose v2."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
setup_nvidia_container_toolkit() {
|
setup_nvidia_container_toolkit() {
|
||||||
# This function attempts to set up NVIDIA GPU support but is non-blocking
|
# This function attempts to set up NVIDIA GPU support but is non-blocking
|
||||||
# Any failures will result in warnings but will NOT stop the installation process
|
# Any failures will result in warnings but will NOT stop the installation process
|
||||||
|
|
@ -550,6 +560,7 @@ check_is_debug_mode
|
||||||
get_install_confirmation
|
get_install_confirmation
|
||||||
accept_terms
|
accept_terms
|
||||||
ensure_docker_installed
|
ensure_docker_installed
|
||||||
|
check_docker_compose
|
||||||
setup_nvidia_container_toolkit
|
setup_nvidia_container_toolkit
|
||||||
get_local_ip
|
get_local_ip
|
||||||
create_nomad_directory
|
create_nomad_directory
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,16 @@ ensure_docker_installed() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_docker_compose() {
|
||||||
|
# Check if 'docker compose' (v2 plugin) is available
|
||||||
|
if ! docker compose version &>/dev/null; then
|
||||||
|
echo -e "${RED}#${RESET} Docker Compose v2 is not installed or not available as a Docker plugin."
|
||||||
|
echo -e "${YELLOW}#${RESET} This script requires 'docker compose' (v2), not 'docker-compose' (v1)."
|
||||||
|
echo -e "${YELLOW}#${RESET} Please read the Docker documentation at https://docs.docker.com/compose/install/ for instructions on how to install Docker Compose v2."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
storage_cleanup() {
|
storage_cleanup() {
|
||||||
read -p "Do you want to delete the Project N.O.M.A.D. storage directory (${NOMAD_DIR})? This is best if you want to start a completely fresh install. This will PERMANENTLY DELETE all stored Nomad data and can't be undone! (y/N): " delete_dir_choice
|
read -p "Do you want to delete the Project N.O.M.A.D. storage directory (${NOMAD_DIR})? This is best if you want to start a completely fresh install. This will PERMANENTLY DELETE all stored Nomad data and can't be undone! (y/N): " delete_dir_choice
|
||||||
case "$delete_dir_choice" in
|
case "$delete_dir_choice" in
|
||||||
|
|
@ -130,5 +140,6 @@ check_has_sudo
|
||||||
check_current_directory
|
check_current_directory
|
||||||
ensure_management_compose_file_exists
|
ensure_management_compose_file_exists
|
||||||
ensure_docker_installed
|
ensure_docker_installed
|
||||||
|
check_docker_compose
|
||||||
get_uninstall_confirmation
|
get_uninstall_confirmation
|
||||||
uninstall_nomad
|
uninstall_nomad
|
||||||
|
|
@ -94,6 +94,16 @@ ensure_docker_installed_and_running() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_docker_compose() {
|
||||||
|
# Check if 'docker compose' (v2 plugin) is available
|
||||||
|
if ! docker compose version &>/dev/null; then
|
||||||
|
echo -e "${RED}#${RESET} Docker Compose v2 is not installed or not available as a Docker plugin."
|
||||||
|
echo -e "${YELLOW}#${RESET} This script requires 'docker compose' (v2), not 'docker-compose' (v1)."
|
||||||
|
echo -e "${YELLOW}#${RESET} Please read the Docker documentation at https://docs.docker.com/compose/install/ for instructions on how to install Docker Compose v2."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
ensure_docker_compose_file_exists() {
|
ensure_docker_compose_file_exists() {
|
||||||
if [ ! -f "/opt/project-nomad/compose.yml" ]; then
|
if [ ! -f "/opt/project-nomad/compose.yml" ]; then
|
||||||
echo -e "${RED}#${RESET} compose.yml file not found. Please ensure it exists at /opt/project-nomad/compose.yml."
|
echo -e "${RED}#${RESET} compose.yml file not found. Please ensure it exists at /opt/project-nomad/compose.yml."
|
||||||
|
|
@ -145,6 +155,7 @@ check_has_sudo
|
||||||
# Main update
|
# Main update
|
||||||
get_update_confirmation
|
get_update_confirmation
|
||||||
ensure_docker_installed_and_running
|
ensure_docker_installed_and_running
|
||||||
|
check_docker_compose
|
||||||
ensure_docker_compose_file_exists
|
ensure_docker_compose_file_exists
|
||||||
force_recreate
|
force_recreate
|
||||||
get_local_ip
|
get_local_ip
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user