Skip to content

Commit 8a4f40d

Browse files
committed
fix globals.py ordering issue
1 parent c3c30a5 commit 8a4f40d

File tree

1 file changed

+33
-37
lines changed

1 file changed

+33
-37
lines changed

src/rtems_proxy/globals.py

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import os
66
from pathlib import Path
77

8-
DEFAULT_ARCH = "linux-x86_64"
9-
108

119
class _Globals:
1210
"""Helper class for accessing global constants."""
@@ -24,6 +22,24 @@ def __init__(self) -> None:
2422
self.RTEMS_NFS_ROOT_PATH = Path("/ioc_nfs")
2523
""" root folder of a mounted NFS folder in which to place IOC runtime files """
2624

25+
########################################################################
26+
## Values relating to IOCs built inside containers using ioc-template
27+
########################################################################
28+
29+
self.EPICS_ROOT = Path(os.getenv("EPICS_ROOT", "/epics/"))
30+
"""Root of epics directory tree"""
31+
32+
self.SUPPORT = Path(os.getenv("SUPPORT", self.EPICS_ROOT / "support"))
33+
""" The root folder for support modules """
34+
35+
self.RUNTIME = self.EPICS_ROOT / "runtime"
36+
37+
self.EPICS_HOST_ARCH = os.getenv("EPICS_HOST_ARCH", "linux-x86_64")
38+
""" Host architecture """
39+
40+
self.EPICS_TARGET_ARCH = os.getenv("EPICS_TARGET_ARCH", "RTEMS-beatnik")
41+
""" Cross compilation target architecture """
42+
2743
########################################################################
2844
## Beamline level config from global.env in services/values.yaml
2945
########################################################################
@@ -47,7 +63,9 @@ def __init__(self) -> None:
4763
""" NFS mount point for the EPICS IOC """
4864

4965
########################################################################
50-
## IOC config from ioc-instance.env in services/ioc_name/values.yaml
66+
## IOC instance config from ioc-instance.env in
67+
## services/ioc_name/values.yaml
68+
## these MUST be set for each RTEMS IOC instance
5169
########################################################################
5270

5371
self.RTEMS_IOC_IP = os.getenv("RTEMS_IOC_IP")
@@ -56,51 +74,29 @@ def __init__(self) -> None:
5674
self.RTEMS_CONSOLE = os.getenv("RTEMS_CONSOLE")
5775
""" address:port to connect to the IOC console """
5876

77+
self.IOC_ORIGINAL_LOCATION = Path(
78+
os.getenv("IOC_ORIGINAL_LOCATION", self.EPICS_ROOT / "ioc")
79+
)
80+
""" The root folder to get IOC source and binaries from
81+
for legacy built IOCs, set to an IOC folder in prod or work
82+
for in-container (ibek) built IOCs /epics/ioc is the default
83+
"""
84+
5985
########################################################################
60-
## IOC config with defaults supplied by the helm chart
86+
## IOC instance config (defaults are normally sufficient)
6187
########################################################################
6288

6389
self.IOC_NAME = os.getenv("IOC_NAME", "NO_IOC_NAME")
64-
""" the lowercase name of this IOC """
65-
66-
self.IOC_GROUP = os.getenv("IOC_GROUP", "NO_IOC_GROUP")
67-
""" the name of the repository that this IOC is grouped into """
68-
69-
########################################################################
70-
## IOC config with defaults supplied here
71-
########################################################################
90+
""" the lowercase name of this IOC (derived from the instance folder name) """
7291

7392
self.RTEMS_EPICS_SCRIPT = os.getenv("RTEMS_EPICS_SCRIPT", "/ioc_nfs/st.cmd")
74-
""" override for the EPICS startup script """
93+
""" override for the standard EPICS startup script filename """
7594

7695
self.RTEMS_EPICS_BINARY = os.getenv(
7796
"RTEMS_EPICS_BINARY",
7897
f"/iocs/{self.IOC_NAME.lower()}/{self.RTEMS_BINARY_DEFAULT_NAME}",
7998
)
80-
""" override for the EPICS binary TFTP path """
81-
82-
self.IOC_ORIGINAL_LOCATION = Path(
83-
os.getenv("IOC_ORIGINAL_LOCATION", self.EPICS_ROOT / "ioc")
84-
)
85-
""" The root folder to get IOC source and binaries from """
86-
87-
########################################################################
88-
## The remaining values relate to IOCs built inside containers
89-
########################################################################
90-
91-
self.EPICS_ROOT = Path(os.getenv("EPICS_ROOT", "/epics/"))
92-
"""Root of epics directory tree"""
93-
94-
self.SUPPORT = Path(os.getenv("SUPPORT", self.EPICS_ROOT / "support"))
95-
""" The root folder for support modules """
96-
97-
self.RUNTIME = self.EPICS_ROOT / "runtime"
98-
99-
self.EPICS_HOST_ARCH = os.getenv("EPICS_HOST_ARCH", DEFAULT_ARCH)
100-
""" Host architecture """
101-
102-
self.EPICS_TARGET_ARCH = os.getenv("EPICS_TARGET_ARCH", DEFAULT_ARCH)
103-
""" Cross compilation target architecture """
99+
""" override for the standard EPICS RTEMS binary TFTP file path """
104100

105101

106102
GLOBALS = _Globals()

0 commit comments

Comments
 (0)