diff --git a/concierge_installer/launcher.py b/concierge_installer/launcher.py new file mode 100644 index 0000000..8fcfcf0 --- /dev/null +++ b/concierge_installer/launcher.py @@ -0,0 +1,20 @@ +import subprocess +from script_builder.util import get_venv_executable + +# 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 + +print("Checking Docker container status...\n") +status = get_status() + +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']) \ No newline at end of file diff --git a/launch.py b/launch.py index 4dc32ef..d52cbbc 100644 --- a/launch.py +++ b/launch.py @@ -1,20 +1,4 @@ import subprocess from script_builder.util import get_venv_executable -# 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 - -# print("Checking Docker container status...\n") -# status = get_status() - -# 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']) \ No newline at end of file +subprocess.run([get_venv_executable(), 'concierge_installer/launcher.py']) \ No newline at end of file diff --git a/script_builder/util.py b/script_builder/util.py index 41ebd8c..28dff42 100644 --- a/script_builder/util.py +++ b/script_builder/util.py @@ -53,4 +53,4 @@ def pip_loader(): working_dir = os.getcwd() venv.create(working_dir, with_pip=True) # pip install command - subprocess.run([os.path.join(get_venv_executable(), "python"), "-m", "pip", "install", "-r", os.path.abspath("requirements.txt")], cwd=working_dir) \ No newline at end of file + subprocess.run([get_venv_executable(), "-m", "pip", "install", "-r", os.path.abspath("requirements.txt")], cwd=working_dir) \ No newline at end of file