github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/deploy/dev/ansible/deploy.sh (about)

     1  #!/bin/bash
     2  
     3  export PATH=$PATH:/usr/local/go/bin
     4  
     5  if [ "$#" -ne 6 ]; then
     6    echo "Usage: $0 <source_root> <directory> <fs_paths> <primary_host> <proxy_cnt> <port>"
     7    exit 1
     8  fi
     9  
    10  source_root="$1"
    11  directory="$2"
    12  fs_paths="$3"
    13  primary_host="$4"
    14  proxy_cnt="$5"
    15  port="$6"
    16  
    17  # Convert the comma-separated paths to an array
    18  IFS=',' read -r -a fs_paths_array <<< "$fs_paths"
    19  
    20  # Create the AIS_FS_PATHS config entry
    21  FSP=()
    22  for disk in "${fs_paths_array[@]}"; do
    23    FSP+=("\"$directory/$disk\": {}")
    24  done
    25  
    26  FSP=$(printf ", %s" "${FSP[@]}")
    27  # Remove the leading comma and space
    28  FSP=${FSP:2}
    29  
    30  # Set the env variables
    31  export AIS_PRIMARY_HOST="$primary_host"
    32  export AIS_FS_PATHS="$FSP"
    33  export PORT="$port"
    34  export GOPATH=~/go
    35  
    36  echo "Run config:"
    37  echo "FS paths: $AIS_FS_PATHS"
    38  echo "Port: $PORT"
    39  echo "Primary host: $AIS_PRIMARY_HOST"
    40  
    41  cd "$source_root"
    42  
    43  # Kill old and deploy new
    44  make cli && make kill
    45  echo -e "1\n$proxy_cnt\n0\nn\nn\nn\nn\n" | make deploy