rtems-proxy 0.5.2__tar.gz → 0.6.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.
Files changed (48) hide show
  1. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/PKG-INFO +1 -1
  2. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/__main__.py +10 -5
  3. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/_version.py +2 -2
  4. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/copy.py +9 -6
  5. rtems_proxy-0.6.0/src/rtems_proxy/rsync.sh.jinja +53 -0
  6. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/PKG-INFO +1 -1
  7. rtems_proxy-0.5.2/src/rtems_proxy/rsync.sh.jinja +0 -30
  8. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.copier-answers.yml +0 -0
  9. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.devcontainer/devcontainer.json +0 -0
  10. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/CONTRIBUTING.md +0 -0
  11. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  12. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/ISSUE_TEMPLATE/issue.md +0 -0
  13. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -0
  14. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/actions/install_requirements/action.yml +0 -0
  15. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/dependabot.yml +0 -0
  16. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/pages/index.html +0 -0
  17. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/pages/make_switcher.py +0 -0
  18. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_check.yml +0 -0
  19. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_dist.yml +0 -0
  20. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_pypi.yml +0 -0
  21. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_release.yml +0 -0
  22. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_test.yml +0 -0
  23. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_tox.yml +0 -0
  24. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/ci.yml +0 -0
  25. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.gitignore +0 -0
  26. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.pre-commit-config.yaml +0 -0
  27. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/extensions.json +0 -0
  28. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/launch.json +0 -0
  29. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/settings.json +0 -0
  30. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/tasks.json +0 -0
  31. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/Dockerfile +0 -0
  32. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/LICENSE +0 -0
  33. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/README.md +0 -0
  34. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/proxy-start.sh +0 -0
  35. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/pyproject.toml +0 -0
  36. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/requirements.txt +0 -0
  37. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/setup.cfg +0 -0
  38. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/__init__.py +0 -0
  39. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/globals.py +0 -0
  40. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/telnet.py +0 -0
  41. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/utils.py +0 -0
  42. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/SOURCES.txt +0 -0
  43. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
  44. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
  45. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/requires.txt +0 -0
  46. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/top_level.txt +0 -0
  47. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/tests/conftest.py +0 -0
  48. {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/tests/test_cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rtems-proxy
3
- Version: 0.5.2
3
+ Version: 0.6.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
@@ -91,7 +91,7 @@ def dev(
91
91
 
92
92
  ioc_path = ioc_repo / "services" / ioc_name
93
93
 
94
- values = ioc_repo / "helm/shared/values.yaml"
94
+ values = ioc_repo / "services" / "values.yaml"
95
95
  if not values.exists():
96
96
  typer.echo(f"Global settings file {values} not found. Exiting")
97
97
  raise typer.Exit(1)
@@ -106,20 +106,25 @@ def dev(
106
106
  with open(values) as fp:
107
107
  yaml = YAML(typ="safe").load(fp)
108
108
  try:
109
- ioc_group = yaml["ioc-instance"]["ioc_group"]
109
+ ioc_group = yaml["global"]["ioc_group"]
110
+ except KeyError:
111
+ typer.echo(f"{values} global.ioc_group key missing")
112
+ raise typer.Exit(1) from None
113
+ try:
114
+ ioc_group = yaml["global"]["ioc_group"]
110
115
  for item in yaml["ioc-instance"]["globalEnv"]:
111
116
  env_vars[item["name"]] = item["value"]
112
117
  except KeyError:
113
- typer.echo(f"{values} not in expected format")
118
+ typer.echo(f"{values} globalEnv key missing")
114
119
  raise typer.Exit(1) from None
115
120
 
116
121
  with open(ioc_values) as fp:
117
122
  yaml = YAML(typ="safe").load(fp)
118
123
  try:
119
- for item in yaml["shared"]["ioc-instance"]["iocEnv"]:
124
+ for item in yaml["ioc-instance"]["iocEnv"]:
120
125
  env_vars[item["name"]] = item["value"]
121
126
  except KeyError:
122
- typer.echo(f"{ioc_values} not in expected format")
127
+ typer.echo(f"{ioc_values} iocEnv key missing")
123
128
  raise typer.Exit(1) from None
124
129
 
125
130
  this_dir = Path(__file__).parent
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.5.2'
16
- __version_tuple__ = version_tuple = (0, 5, 2)
15
+ __version__ = version = '0.6.0'
16
+ __version_tuple__ = version_tuple = (0, 6, 0)
@@ -22,6 +22,15 @@ def copy_rtems():
22
22
  # where to copy the generated runtime assets to (st.cmd and ioc.db)
23
23
  dest_runtime = root / "runtime"
24
24
 
25
+ # TODO - perhaps do this for linux IOCs too - in which case this needs
26
+ # to go somewhere generic
27
+ protocol_folder = GLOBALS.RUNTIME / "protocol"
28
+ protocol_folder.mkdir(parents=True, exist_ok=True)
29
+ protocol_files = GLOBALS.SUPPORT.glob("**/*.proto*")
30
+ for proto_file in protocol_files:
31
+ dest = protocol_folder / proto_file.name
32
+ shutil.copy(proto_file, dest)
33
+
25
34
  # move all the files needed for runtime into the PVC that is being shared
26
35
  # over nfs/tftp by the nfsv2-tftp service
27
36
  ioc_src = GLOBALS.IOC.readlink()
@@ -36,12 +45,6 @@ def copy_rtems():
36
45
  shutil.copy(bin_rtems_src, bin_rtems_dest)
37
46
  shutil.copytree(GLOBALS.RUNTIME, dest_runtime, dirs_exist_ok=True)
38
47
 
39
- protocol_folder = RTEMS_TFTP_PATH / "protocol"
40
- protocol_files = GLOBALS.SUPPORT.glob("**/*.proto*")
41
- for proto_file in protocol_files:
42
- dest = protocol_folder / proto_file.name
43
- shutil.copy(proto_file, dest)
44
-
45
48
  # because we moved the ioc files we need to fix up startup script paths
46
49
  startup = dest_runtime / "st.cmd"
47
50
  cmd_txt = startup.read_text()
@@ -0,0 +1,53 @@
1
+ #!/bin/bash
2
+
3
+ {% for name,value in env_vars.items() -%}
4
+ export {{ name }}={{ value }}
5
+ {% endfor -%}
6
+ export IOC_GROUP={{ ioc_group }}
7
+ export IOC_NAME={{ ioc_name }}
8
+ export IOC_PATH={{ ioc_path }}
9
+
10
+ if [[ "${BASH_SOURCE[0]}" == "${0}" ]] ; then
11
+ echo "This script must be sourced"
12
+ exit 1
13
+ fi
14
+
15
+ # validate we have the essential environment variables
16
+ if [[ -z "$RTEMS_TFTP_PATH" || -z "$RTEMS_TFTP_IP" || -z "$IOC_NAME" || -z "$RTEMS_TFTP_IP" ]]; then
17
+ echo "RTEMS_TFTP_PATH,RTEMS_TFTP_IP,IOC_NAME must all be set"
18
+ return 1
19
+ fi
20
+
21
+ if [[ $RTEMS_TFTP_PATH != "/"* ]]; then
22
+ echo "RTEMS_TFTP_PATH must be an absolute path"
23
+ return 1
24
+ fi
25
+
26
+ # remove previoud rsync-background process if it exists
27
+ pkill -f rsync-background &>/dev/null
28
+
29
+ ibek dev instance $IOC_PATH
30
+ bash /epics/ioc/install.sh
31
+
32
+ mkdir -p $RTEMS_TFTP_PATH
33
+
34
+ # get previous contents
35
+ echo "getting existing contents of the IOC nfs2-tftp folder"
36
+ (
37
+ set -x
38
+ rsync -rt "rsync://$RTEMS_TFTP_IP:12002/files/$IOC_NAME/" $RTEMS_TFTP_PATH 2>/dev/null
39
+ )
40
+
41
+ echo "
42
+ #!/bin/bash
43
+
44
+ while true; do
45
+ inotifywait -e modify,create,delete,move -r $RTEMS_TFTP_PATH
46
+ rsync -rt --delete /$RTEMS_TFTP_PATH/ \
47
+ "rsync://$RTEMS_TFTP_IP:12002/files/$IOC_NAME/"
48
+ done
49
+ " > /tmp/rsync-background.sh
50
+ chmod +x /tmp/rsync-background.sh
51
+
52
+ echo "launching rsync-background.sh"
53
+ nohup /tmp/rsync-background.sh &> /tmp/rsync-background.log &
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rtems-proxy
3
- Version: 0.5.2
3
+ Version: 0.6.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
@@ -1,30 +0,0 @@
1
- #!/bin/bash
2
-
3
- {% for name,value in env_vars.items() -%}
4
- export {{ name }}={{ value }}
5
- {% endfor -%}
6
- export IOC_GROUP={{ ioc_group }}
7
- export IOC_NAME={{ ioc_name }}
8
- export IOC_PATH={{ ioc_path }}
9
-
10
- pkill -f rsync-background &>/dev/null
11
-
12
- ibek dev instance $IOC_PATH
13
- bash /epics/ioc/install.sh
14
-
15
- mkdir -p $RTEMS_TFTP_PATH
16
-
17
- # get previous contents
18
- rsync -rt "rsync://$RTEMS_TFTP_IP:12002/files/$IOC_GROUP/$IOC_NAME/" $RTEMS_TFTP_PATH 2>/dev/null
19
-
20
- echo "
21
- #!/bin/bash
22
-
23
- while true; do
24
- inotifywait -e modify,create,delete,move -r $RTEMS_TFTP_PATH
25
- rsync -rt --delete /$RTEMS_TFTP_PATH/ \
26
- "rsync://$RTEMS_TFTP_IP:12002/files/$IOC_GROUP/$IOC_NAME/" &> /tmp/rsync.log
27
- done
28
- " > /tmp/rsync-background.sh
29
-
30
- nohup bash /tmp/rsync-background.sh &> /tmp/rsync-background.log &
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes