Skip to content

Commit

Permalink
remove docker status check in launch.py for now
Browse files Browse the repository at this point in the history
  • Loading branch information
sebovzeoueb committed Mar 14, 2024
1 parent c68930e commit e2e4b9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
30 changes: 16 additions & 14 deletions launch.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import subprocess
import os
from script_builder.util import get_venv_dir
from concierge_backend_lib.status import get_status
from concierge_installer.functions import docker_compose_helper
from script_builder.util import get_venv_executable

print("Checking Docker container status...\n")
status = get_status()
# TODO: these imports seem to mess up the venv
# from concierge_backend_lib.status import get_status
# from concierge_installer.functions import docker_compose_helper

if not status["ollama"] or not status["milvus"]:
print("Docker container dependencies don't appear to be running properly.")
compute_method = input("Start docker containers with CPU or GPU? [CPU] or GPU:") or "CPU"
if compute_method == 'GPU':
docker_compose_helper('GPU')
else:
docker_compose_helper('CPU')
# print("Checking Docker container status...\n")
# status = get_status()

subprocess.run([os.path.join(get_venv_dir(), 'streamlit'), 'run', 'Concierge.py'])
# if not status["ollama"] or not status["milvus"]:
# print("Docker container dependencies don't appear to be running properly.")
# compute_method = input("Start docker containers with CPU or GPU? [CPU] or GPU:") or "CPU"
# if compute_method == 'GPU':
# docker_compose_helper('GPU')
# else:
# docker_compose_helper('CPU')


subprocess.run([get_venv_executable(), '-m', 'streamlit', 'run', 'Concierge.py'])
9 changes: 5 additions & 4 deletions script_builder/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ def get_default_directory(is_standalone: bool):
return r"C:\ProgramData"
# TODO: macOS

def get_venv_dir():
def get_venv_executable():
if my_platform == "Linux":
return "bin"
path="bin"
else:
return "Scripts"
path="Scripts"
# TODO: macOS
return os.path.join(path, "python")

def pip_loader():
working_dir = os.getcwd()
venv.create(working_dir, with_pip=True)
# pip install command
subprocess.run([os.path.join(get_venv_dir(), "python"), "-m", "pip", "install", "-r", os.path.abspath("requirements.txt")], cwd=working_dir)
subprocess.run([os.path.join(get_venv_executable(), "python"), "-m", "pip", "install", "-r", os.path.abspath("requirements.txt")], cwd=working_dir)

0 comments on commit e2e4b9c

Please sign in to comment.