a1c00l commited on
Commit
4dab6d1
·
verified ·
1 Parent(s): a2d357b

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +22 -15
entrypoint.sh CHANGED
@@ -11,20 +11,27 @@ if [ -z "$AIBOM_INFERENCE_URL" ]; then
11
  fi
12
 
13
  # Check if command is provided
14
- if [ "$1" = "server" ]; then
15
- # Start the API server
16
- echo "Starting AIBOM Generator API server..."
17
- exec uvicorn src.aibom_generator.api:app --host 0.0.0.0 --port ${PORT:-5000}
18
- elif [ "$1" = "worker" ]; then
19
- # Start the background worker
20
- echo "Starting AIBOM Generator background worker..."
21
- exec python -m src.aibom_generator.worker
22
- elif [ "$1" = "inference" ]; then
23
- # Start the inference model server
24
- echo "Starting AIBOM Generator inference model server..."
25
- exec python -m src.aibom_generator.inference_model --host 0.0.0.0 --port ${PORT:-8000}
 
 
 
 
 
 
 
26
  else
27
- # Default: run as CLI
28
- echo "Running AIBOM Generator CLI..."
29
- exec python -m src.aibom_generator.cli "$@"
30
  fi
 
11
  fi
12
 
13
  # Check if command is provided
14
+ if [ -n "$1" ]; then
15
+ # If arguments are provided, use them
16
+ if [ "$1" = "server" ]; then
17
+ # Start the API server
18
+ echo "Starting AIBOM Generator API server..."
19
+ exec uvicorn src.aibom_generator.api:app --host 0.0.0.0 --port ${PORT:-5000}
20
+ elif [ "$1" = "worker" ]; then
21
+ # Start the background worker
22
+ echo "Starting AIBOM Generator background worker..."
23
+ exec python -m src.aibom_generator.worker
24
+ elif [ "$1" = "inference" ]; then
25
+ # Start the inference model server
26
+ echo "Starting AIBOM Generator inference model server..."
27
+ exec python -m src.aibom_generator.inference_model --host 0.0.0.0 --port ${PORT:-8000}
28
+ else
29
+ # Run as CLI with provided arguments
30
+ echo "Running AIBOM Generator CLI..."
31
+ exec python -m src.aibom_generator.cli "$@"
32
+ fi
33
  else
34
+ # Default: run as API server (web UI)
35
+ echo "Starting AIBOM Generator API server (web UI)..."
36
+ exec uvicorn src.aibom_generator.api:app --host 0.0.0.0 --port ${PORT:-5000}
37
  fi