elungky commited on
Commit
4ad0a28
·
1 Parent(s): 5114a95

Attempt to fix conda path by adding /opt/conda/bin to PATH

Browse files
Files changed (1) hide show
  1. start.sh +6 -7
start.sh CHANGED
@@ -6,20 +6,22 @@ export CUDA_HOME="/usr/local/cuda"
6
 
7
  echo "Attempting to locate and activate Conda environment..."
8
 
 
 
 
 
9
  # 1. Try to find the 'conda' executable in the system's PATH
10
  CONDA_EXEC=$(which conda)
11
 
12
  if [ -z "$CONDA_EXEC" ]; then
13
- echo "ERROR: 'conda' executable not found in PATH."
14
- echo "This means Conda might not be installed in the base image, or it's not configured in the system's PATH."
15
- echo "Please check if 'elungky/gen3c:latest' image actually contains a working Conda installation."
16
  exit 1
17
  fi
18
 
19
  echo "Found 'conda' executable at: $CONDA_EXEC"
20
 
21
  # 2. Derive the base Conda installation path from the executable's location.
22
- # For example, if CONDA_EXEC is /opt/conda/bin/conda, CONDA_BASE_PATH will be /opt/conda.
23
  CONDA_BASE_PATH=$(dirname $(dirname "$CONDA_EXEC"))
24
  echo "Derived Conda base path: $CONDA_BASE_PATH"
25
 
@@ -28,11 +30,9 @@ CONDA_SH_PATH="$CONDA_BASE_PATH/etc/profile.d/conda.sh"
28
 
29
  if [ -f "$CONDA_SH_PATH" ]; then
30
  echo "Found conda.sh at: $CONDA_SH_PATH"
31
- # Attempt to source it. Capture potential errors from sourcing itself.
32
  source "$CONDA_SH_PATH" || { echo "ERROR: Failed to source conda.sh script at $CONDA_SH_PATH. Check permissions."; exit 1; }
33
  else
34
  echo "ERROR: conda.sh not found at expected location derived from 'conda' executable: $CONDA_SH_PATH"
35
- echo "This indicates an unusual Conda installation or structure within the base image."
36
  exit 1
37
  fi
38
 
@@ -49,5 +49,4 @@ echo "Starting GEN3C FastAPI inference server..."
49
  export GEN3C_CKPT_PATH="/app/checkpoints"
50
  export GEN3C_GPU_COUNT=1
51
 
52
- # Start the FastAPI server
53
  exec uvicorn gui.api.server:app --host 0.0.0.0 --port 7860 --proxy-headers
 
6
 
7
  echo "Attempting to locate and activate Conda environment..."
8
 
9
+ # Add a common Conda binary path to PATH *before* trying to find 'conda'
10
+ # This is crucial if conda is installed but not in the default PATH
11
+ export PATH="/opt/conda/bin:$PATH"
12
+
13
  # 1. Try to find the 'conda' executable in the system's PATH
14
  CONDA_EXEC=$(which conda)
15
 
16
  if [ -z "$CONDA_EXEC" ]; then
17
+ echo "ERROR: 'conda' executable still not found in PATH even after adding /opt/conda/bin."
18
+ echo "This indicates that Conda might be installed in a different location, or not at all."
 
19
  exit 1
20
  fi
21
 
22
  echo "Found 'conda' executable at: $CONDA_EXEC"
23
 
24
  # 2. Derive the base Conda installation path from the executable's location.
 
25
  CONDA_BASE_PATH=$(dirname $(dirname "$CONDA_EXEC"))
26
  echo "Derived Conda base path: $CONDA_BASE_PATH"
27
 
 
30
 
31
  if [ -f "$CONDA_SH_PATH" ]; then
32
  echo "Found conda.sh at: $CONDA_SH_PATH"
 
33
  source "$CONDA_SH_PATH" || { echo "ERROR: Failed to source conda.sh script at $CONDA_SH_PATH. Check permissions."; exit 1; }
34
  else
35
  echo "ERROR: conda.sh not found at expected location derived from 'conda' executable: $CONDA_SH_PATH"
 
36
  exit 1
37
  fi
38
 
 
49
  export GEN3C_CKPT_PATH="/app/checkpoints"
50
  export GEN3C_GPU_COUNT=1
51
 
 
52
  exec uvicorn gui.api.server:app --host 0.0.0.0 --port 7860 --proxy-headers