-
Notifications
You must be signed in to change notification settings - Fork 15
/
config.py
61 lines (56 loc) · 2.32 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
import sys
from utils.host_utils import get_os_and_arch
os_name, arch = get_os_and_arch()
if os_name == "macOS":
repo_root = os.path.dirname(__file__)
elif os_name == "Windows":
# Run as bundled executable if condition is met, else run as regular Python script
repo_root = sys._MEIPASS if getattr(sys, 'frozen', False) else os.path.dirname(__file__)
elif os_name == "Linux":
repo_root = os.path.dirname(__file__)
else:
raise RuntimeError(f"Unsupported OS: {os_name}")
class AgentDockerConfig:
MACOS_APPLE_IMAGE_NAMES = [
"lachsbagel/moragents_dockers-nginx:apple-0.2.0",
"lachsbagel/moragents_dockers-agents:apple-0.2.0"
]
MACOS_INTEL_IMAGE_NAMES = [
"lachsbagel/moragents_dockers-nginx:amd64-0.2.0",
"lachsbagel/moragents_dockers-agents:amd64-0.2.0"
]
WINDOWS_IMAGE_NAMES = [
"lachsbagel/moragents_dockers-nginx:amd64-0.2.0",
"lachsbagel/moragents_dockers-agents:amd64-0.2.0"
]
LINUX_IMAGE_NAMES = [ # TODO, may need linux specific tagged images
"lachsbagel/moragents_dockers-nginx:amd64-0.2.0",
"lachsbagel/moragents_dockers-agents:amd64-0.2.0"
]
@staticmethod
def get_current_image_names():
if os_name == "macOS" and arch == "ARM64":
return AgentDockerConfig.MACOS_APPLE_IMAGE_NAMES
elif os_name == "macOS" and arch == "x86_64":
return AgentDockerConfig.MACOS_INTEL_IMAGE_NAMES
elif os_name == "Windows":
return AgentDockerConfig.WINDOWS_IMAGE_NAMES
elif os_name == "Linux":
return AgentDockerConfig.LINUX_IMAGE_NAMES
else:
raise RuntimeError(f"Unsupported OS: {os_name}")
class AgentDockerConfigDeprecate:
OLD_IMAGE_NAMES = [
"morpheus/price_fetcher_agent:latest",
"moragents_dockers-nginx:latest",
"moragents_dockers-agents:latest",
"lachsbagel/moragents_dockers-nginx:apple-0.0.9",
"lachsbagel/moragents_dockers-agents:apple-0.0.9",
"lachsbagel/moragents_dockers-nginx:amd64-0.0.9",
"lachsbagel/moragents_dockers-agents:amd64-0.0.9",
"lachsbagel/moragents_dockers-nginx:apple-0.1.0",
"lachsbagel/moragents_dockers-agents:apple-0.1.0",
"lachsbagel/moragents_dockers-nginx:amd64-0.1.0",
"lachsbagel/moragents_dockers-agents:amd64-0.1.0"
]