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.
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/PKG-INFO +1 -1
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/__main__.py +10 -5
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/_version.py +2 -2
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/copy.py +9 -6
- rtems_proxy-0.6.0/src/rtems_proxy/rsync.sh.jinja +53 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/PKG-INFO +1 -1
- rtems_proxy-0.5.2/src/rtems_proxy/rsync.sh.jinja +0 -30
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.copier-answers.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.devcontainer/devcontainer.json +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/CONTRIBUTING.md +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/ISSUE_TEMPLATE/issue.md +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/actions/install_requirements/action.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/dependabot.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/pages/index.html +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/pages/make_switcher.py +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_check.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_dist.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_pypi.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_release.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_test.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/_tox.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.github/workflows/ci.yml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.gitignore +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.pre-commit-config.yaml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/extensions.json +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/launch.json +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/settings.json +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/.vscode/tasks.json +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/Dockerfile +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/LICENSE +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/README.md +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/proxy-start.sh +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/pyproject.toml +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/requirements.txt +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/setup.cfg +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/__init__.py +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/globals.py +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/telnet.py +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy/utils.py +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/SOURCES.txt +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/requires.txt +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/src/rtems_proxy.egg-info/top_level.txt +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/tests/conftest.py +0 -0
- {rtems_proxy-0.5.2 → rtems_proxy-0.6.0}/tests/test_cli.py +0 -0
|
@@ -91,7 +91,7 @@ def dev(
|
|
|
91
91
|
|
|
92
92
|
ioc_path = ioc_repo / "services" / ioc_name
|
|
93
93
|
|
|
94
|
-
values = ioc_repo / "
|
|
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["
|
|
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}
|
|
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["
|
|
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}
|
|
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
|
|
@@ -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,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
|
{rtems_proxy-0.5.2 → rtems_proxy-0.6.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
|
|
File without changes
|
|
File without changes
|