rtems-proxy 1.0.1__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.gitignore +3 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/PKG-INFO +3 -2
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/__main__.py +4 -1
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/_version.py +16 -3
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/configure.py +27 -4
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/copy.py +0 -11
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/globals.py +12 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/telnet.py +15 -5
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy.egg-info/PKG-INFO +3 -2
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.copier-answers.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.devcontainer/devcontainer.json +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/CONTRIBUTING.md +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/ISSUE_TEMPLATE/issue.md +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/actions/install_requirements/action.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/dependabot.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/pages/index.html +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/pages/make_switcher.py +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/workflows/_check.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/workflows/_dist.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/workflows/_pypi.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/workflows/_release.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/workflows/_test.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/workflows/_tox.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/workflows/ci.yml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.pre-commit-config.yaml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.vscode/extensions.json +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.vscode/launch.json +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.vscode/settings.json +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.vscode/tasks.json +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/Dockerfile +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/LICENSE +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/README.md +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/pyproject.toml +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/requirements.txt +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/setup.cfg +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/__init__.py +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/rsync.sh.jinja +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/trace.py +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy/utils.py +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy.egg-info/SOURCES.txt +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy.egg-info/requires.txt +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/src/rtems_proxy.egg-info/top_level.txt +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/tests/conftest.py +0 -0
- {rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: rtems-proxy
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
5
5
|
Author-email: Giles Knap <giles.knap@diamond.ac.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -229,6 +229,7 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
229
229
|
Requires-Dist: ruff; extra == "dev"
|
|
230
230
|
Requires-Dist: tox-direct; extra == "dev"
|
|
231
231
|
Requires-Dist: types-mock; extra == "dev"
|
|
232
|
+
Dynamic: license-file
|
|
232
233
|
|
|
233
234
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
234
235
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
@@ -172,13 +172,16 @@ def configure(
|
|
|
172
172
|
attach: bool = typer.Option(
|
|
173
173
|
False, help="attach to the IOC console after configuration"
|
|
174
174
|
),
|
|
175
|
+
use_console: bool = typer.Option(
|
|
176
|
+
False, help="use conserver console instead of telnet"
|
|
177
|
+
),
|
|
175
178
|
):
|
|
176
179
|
"""
|
|
177
180
|
Configure the RTEMS IOC boot parameters
|
|
178
181
|
"""
|
|
179
182
|
|
|
180
183
|
assert GLOBALS.RTEMS_CONSOLE, "No RTEMS console defined"
|
|
181
|
-
telnet = motboot_connect(GLOBALS.RTEMS_CONSOLE)
|
|
184
|
+
telnet = motboot_connect(GLOBALS.RTEMS_CONSOLE, use_console=use_console)
|
|
182
185
|
config = Configure(telnet, debug)
|
|
183
186
|
config.apply_settings()
|
|
184
187
|
telnet.close()
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
3
|
|
|
4
|
-
__all__ = [
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
5
12
|
|
|
6
13
|
TYPE_CHECKING = False
|
|
7
14
|
if TYPE_CHECKING:
|
|
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
|
|
|
9
16
|
from typing import Union
|
|
10
17
|
|
|
11
18
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
12
20
|
else:
|
|
13
21
|
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
14
23
|
|
|
15
24
|
version: str
|
|
16
25
|
__version__: str
|
|
17
26
|
__version_tuple__: VERSION_TUPLE
|
|
18
27
|
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
19
30
|
|
|
20
|
-
__version__ = version = '1.0
|
|
21
|
-
__version_tuple__ = version_tuple = (1,
|
|
31
|
+
__version__ = version = '1.2.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 2, 0)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = 'ge82ac2b34'
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Class to apply MOTBoot configuration to a VME crate.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
from time import sleep
|
|
6
|
+
|
|
5
7
|
from .globals import GLOBALS
|
|
6
8
|
from .telnet import TelnetRTEMS
|
|
7
9
|
|
|
@@ -32,21 +34,40 @@ class Configure:
|
|
|
32
34
|
"RTEMS_IOC_NETMASK, RTEMS_IOC_GATEWAY, RTEMS_IOC_IP, "
|
|
33
35
|
"RTEMS_NFS_IP, and RTEMS_TFTP_IP must be set"
|
|
34
36
|
)
|
|
35
|
-
|
|
37
|
+
|
|
36
38
|
ioc_bin = "ioc" if self.debug else "ioc.boot"
|
|
39
|
+
|
|
40
|
+
if GLOBALS.RTEMS_EPICS_NFS_MOUNT:
|
|
41
|
+
nfs_mount = GLOBALS.RTEMS_EPICS_NFS_MOUNT
|
|
42
|
+
else:
|
|
43
|
+
epics_script = f"{GLOBALS.RTEMS_NFS_IP}:/iocs/{GLOBALS.IOC_NAME}:/epics"
|
|
44
|
+
|
|
45
|
+
if GLOBALS.RTEMS_EPICS_SCRIPT:
|
|
46
|
+
epics_script = GLOBALS.RTEMS_EPICS_SCRIPT
|
|
47
|
+
else:
|
|
48
|
+
epics_script = "/epics/runtime/st.cmd"
|
|
49
|
+
|
|
50
|
+
if GLOBALS.RTEMS_EPICS_BINARY:
|
|
51
|
+
epics_binary = GLOBALS.RTEMS_EPICS_BINARY
|
|
52
|
+
else:
|
|
53
|
+
epics_binary = f"{GLOBALS.IOC_NAME.lower()}/ioc/bin/RTEMS-beatnik/{ioc_bin}"
|
|
54
|
+
|
|
37
55
|
mot_boot = (
|
|
38
56
|
f"dla=malloc 0x4000000\r"
|
|
39
57
|
f"tftpGet -d/dev/enet1"
|
|
40
|
-
f" -f{
|
|
58
|
+
f" -f{epics_binary}"
|
|
41
59
|
f" -m{GLOBALS.RTEMS_IOC_NETMASK}"
|
|
42
60
|
f" -g{GLOBALS.RTEMS_IOC_GATEWAY}"
|
|
43
61
|
f" -s{GLOBALS.RTEMS_TFTP_IP}"
|
|
44
62
|
f" -c{GLOBALS.RTEMS_IOC_IP}"
|
|
45
|
-
f" -adla -
|
|
63
|
+
f" -adla -r3 -v\r"
|
|
46
64
|
f"go -a04000000\r"
|
|
47
65
|
f"reset"
|
|
48
66
|
)
|
|
49
67
|
|
|
68
|
+
if GLOBALS.RTEMS_EPICS_NTP_SERVER:
|
|
69
|
+
self.apply_nvm("epics-ntpserver", GLOBALS.RTEMS_EPICS_NTP_SERVER)
|
|
70
|
+
|
|
50
71
|
self.apply_nvm("mot-/dev/enet0-snma", GLOBALS.RTEMS_IOC_NETMASK)
|
|
51
72
|
self.apply_nvm("mot-/dev/enet0-gipa", GLOBALS.RTEMS_IOC_GATEWAY)
|
|
52
73
|
self.apply_nvm("mot-/dev/enet0-sipa", GLOBALS.RTEMS_NFS_IP)
|
|
@@ -54,7 +75,9 @@ class Configure:
|
|
|
54
75
|
self.apply_nvm("mot-boot-device", "/dev/em1")
|
|
55
76
|
self.apply_nvm("mot-script-boot", mot_boot)
|
|
56
77
|
self.apply_nvm("rtems-client-name", GLOBALS.IOC_NAME)
|
|
57
|
-
self.apply_nvm("epics-script",
|
|
78
|
+
self.apply_nvm("epics-script", epics_script)
|
|
58
79
|
self.apply_nvm("epics-nfsmount", nfs_mount)
|
|
59
80
|
# self.apply_nvm_variable("epics-ntpserver", "EPICS_TS_NTP_INET")
|
|
60
81
|
self.apply_nvm("mot-/dev/enet0-snma", GLOBALS.RTEMS_IOC_NETMASK)
|
|
82
|
+
|
|
83
|
+
sleep(1)
|
|
@@ -30,17 +30,6 @@ def copy_rtems():
|
|
|
30
30
|
# st.cmd and ioc.db
|
|
31
31
|
dest_runtime = local_root / "runtime"
|
|
32
32
|
|
|
33
|
-
protocol_folder = GLOBALS.RUNTIME / "protocol"
|
|
34
|
-
protocol_folder.mkdir(parents=True, exist_ok=True)
|
|
35
|
-
|
|
36
|
-
# TODO - perhaps do protocol files in this fashion for linux IOCs too,
|
|
37
|
-
# in which case this needs to go somewhere generic
|
|
38
|
-
dest_ioc.mkdir(parents=True, exist_ok=True)
|
|
39
|
-
protocol_files = GLOBALS.SUPPORT.glob("**/*.proto*")
|
|
40
|
-
for proto_file in protocol_files:
|
|
41
|
-
dest = protocol_folder / proto_file.name
|
|
42
|
-
shutil.copy(proto_file, dest)
|
|
43
|
-
|
|
44
33
|
# make sure all files are writable - by default some products are read-only
|
|
45
34
|
for folder in [dest_ioc, dest_runtime]:
|
|
46
35
|
for file in folder.glob("**/*"):
|
|
@@ -59,5 +59,17 @@ class _Globals:
|
|
|
59
59
|
self.IOC_GROUP = os.getenv("IOC_GROUP", "NO_IOC_GROUP")
|
|
60
60
|
""" the name of the repository that this IOC is grouped into """
|
|
61
61
|
|
|
62
|
+
self.RTEMS_EPICS_SCRIPT = os.getenv("RTEMS_EPICS_SCRIPT")
|
|
63
|
+
""" override for the EPICS startup script """
|
|
64
|
+
|
|
65
|
+
self.RTEMS_EPICS_BINARY = os.getenv("RTEMS_EPICS_BINARY")
|
|
66
|
+
""" override for the EPICS binary """
|
|
67
|
+
|
|
68
|
+
self.RTEMS_EPICS_NTP_SERVER = os.getenv("RTEMS_EPICS_NTP_SERVER")
|
|
69
|
+
""" ip address for the ntp server """
|
|
70
|
+
|
|
71
|
+
self.RTEMS_EPICS_NFS_MOUNT = os.getenv("RTEMS_EPICS_NFS_MOUNT")
|
|
72
|
+
""" NFS mount point for the EPICS IOC """
|
|
73
|
+
|
|
62
74
|
|
|
63
75
|
GLOBALS = _Globals()
|
|
@@ -38,13 +38,21 @@ class TelnetRTEMS:
|
|
|
38
38
|
NO_CONNECTION = "Connection closed by foreign host"
|
|
39
39
|
FAIL_STRINGS = ["Exception", "exception", "RTEMS_FATAL_SOURCE_EXCEPTION"]
|
|
40
40
|
|
|
41
|
-
def __init__(
|
|
42
|
-
self
|
|
41
|
+
def __init__(
|
|
42
|
+
self, host_and_port: str, ioc_reboot: bool = False, use_console: bool = False
|
|
43
|
+
):
|
|
43
44
|
self._ioc_reboot = ioc_reboot
|
|
44
45
|
self._child = None
|
|
46
|
+
self._port = ""
|
|
45
47
|
|
|
46
48
|
self.ioc_rebooted = False
|
|
47
|
-
|
|
49
|
+
if use_console:
|
|
50
|
+
# console needs no port
|
|
51
|
+
self._hostname = host_and_port
|
|
52
|
+
self.command = f"console {self._hostname}"
|
|
53
|
+
else:
|
|
54
|
+
self._hostname, self._port = host_and_port.split(":")
|
|
55
|
+
self.command = f"telnet {self._hostname} {self._port}"
|
|
48
56
|
|
|
49
57
|
signal.signal(signal.SIGINT, self.terminate)
|
|
50
58
|
signal.signal(signal.SIGTERM, self.terminate)
|
|
@@ -256,13 +264,15 @@ def ioc_connect(
|
|
|
256
264
|
run_command(telnet.command)
|
|
257
265
|
|
|
258
266
|
|
|
259
|
-
def motboot_connect(
|
|
267
|
+
def motboot_connect(
|
|
268
|
+
host_and_port: str, reboot: bool = False, use_console: bool = False
|
|
269
|
+
) -> TelnetRTEMS:
|
|
260
270
|
"""
|
|
261
271
|
Connect to the MOTBoot bootloader prompt, rebooting if needed.
|
|
262
272
|
|
|
263
273
|
Returns a TelnetRTEMS object that is connected to the MOTBoot bootloader
|
|
264
274
|
"""
|
|
265
|
-
telnet = TelnetRTEMS(host_and_port)
|
|
275
|
+
telnet = TelnetRTEMS(host_and_port, ioc_reboot=reboot, use_console=use_console)
|
|
266
276
|
telnet.connect()
|
|
267
277
|
|
|
268
278
|
# this will untangle a partially executed gevEdit command
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: rtems-proxy
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
5
5
|
Author-email: Giles Knap <giles.knap@diamond.ac.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -229,6 +229,7 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
229
229
|
Requires-Dist: ruff; extra == "dev"
|
|
230
230
|
Requires-Dist: tox-direct; extra == "dev"
|
|
231
231
|
Requires-Dist: types-mock; extra == "dev"
|
|
232
|
+
Dynamic: license-file
|
|
232
233
|
|
|
233
234
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
234
235
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rtems_proxy-1.0.1 → rtems_proxy-1.2.0}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|