rtems-proxy 0.3.0__tar.gz → 0.5.1__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.3.0 → rtems_proxy-0.5.1}/.copier-answers.yml +1 -2
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.devcontainer/devcontainer.json +5 -5
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/CONTRIBUTING.md +1 -1
- rtems_proxy-0.5.1/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
- rtems_proxy-0.5.1/.github/ISSUE_TEMPLATE/issue.md +13 -0
- rtems_proxy-0.5.1/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +8 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/pages/index.html +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/pages/make_switcher.py +11 -7
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/workflows/_pypi.yml +3 -3
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/workflows/_release.yml +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/workflows/ci.yml +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.gitignore +1 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.pre-commit-config.yaml +1 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.vscode/extensions.json +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.vscode/settings.json +2 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.vscode/tasks.json +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/Dockerfile +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/PKG-INFO +5 -7
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/README.md +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/pyproject.toml +19 -14
- rtems_proxy-0.5.1/src/rtems_proxy/__init__.py +11 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy/__main__.py +2 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy/_version.py +2 -2
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy/copy.py +11 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy/rsync.sh.jinja +1 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy/telnet.py +9 -1
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy/utils.py +0 -2
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy.egg-info/PKG-INFO +5 -7
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy.egg-info/SOURCES.txt +3 -1
- rtems_proxy-0.5.1/tests/conftest.py +21 -0
- rtems-proxy-0.3.0/catalog-info.yaml +0 -10
- rtems-proxy-0.3.0/src/rtems_proxy/__init__.py +0 -3
- rtems-proxy-0.3.0/tests/conftest.py +0 -15
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/actions/install_requirements/action.yml +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/dependabot.yml +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/workflows/_check.yml +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/workflows/_dist.yml +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/workflows/_test.yml +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.github/workflows/_tox.yml +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/.vscode/launch.json +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/LICENSE +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/proxy-start.sh +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/requirements.txt +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/setup.cfg +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy/globals.py +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy.egg-info/requires.txt +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/src/rtems_proxy.egg-info/top_level.txt +0 -0
- {rtems-proxy-0.3.0 → rtems_proxy-0.5.1}/tests/test_cli.py +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Changes here will be overwritten by Copier
|
|
2
|
-
_commit: 2.0
|
|
2
|
+
_commit: 2.6.0
|
|
3
3
|
_src_path: gh:DiamondLightSource/python-copier-template
|
|
4
4
|
author_email: giles.knap@diamond.ac.uk
|
|
5
5
|
author_name: Giles Knap
|
|
6
|
-
component_owner: group:default/sscc
|
|
7
6
|
description: Support for a K8S proxy container in controlling and monitoring RTEMS
|
|
8
7
|
EPICS IOCs
|
|
9
8
|
distribution_name: rtems-proxy
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"features": {
|
|
30
|
-
//
|
|
31
|
-
"ghcr.io/
|
|
32
|
-
"upgradePackages": false
|
|
33
|
-
}
|
|
30
|
+
// add in eternal history and other bash features
|
|
31
|
+
"ghcr.io/diamondlightsource/devcontainer-features/bash-config:1.0.0": {}
|
|
34
32
|
},
|
|
33
|
+
// Create the config folder for the bash-config feature
|
|
34
|
+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/bash-config",
|
|
35
35
|
"runArgs": [
|
|
36
36
|
// Allow the container to access the host X11 display and EPICS CA
|
|
37
37
|
"--net=host",
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
|
|
43
43
|
// After the container is created, install the python project in editable form
|
|
44
44
|
"postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]' && pre-commit install"
|
|
45
|
-
}
|
|
45
|
+
}
|
|
@@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua
|
|
|
24
24
|
|
|
25
25
|
This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
|
|
26
26
|
|
|
27
|
-
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/2.0
|
|
27
|
+
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/2.6.0/how-to.html).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: The template to use for reporting bugs and usability issues
|
|
4
|
+
title: " "
|
|
5
|
+
labels: 'bug'
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Describe the bug, including a clear and concise description of the expected behavior, the actual behavior and the context in which you encountered it (ideally include details of your environment).
|
|
11
|
+
|
|
12
|
+
## Steps To Reproduce
|
|
13
|
+
Steps to reproduce the behavior:
|
|
14
|
+
1. Go to '...'
|
|
15
|
+
2. Click on '....'
|
|
16
|
+
3. Scroll down to '....'
|
|
17
|
+
4. See error
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Acceptance Criteria
|
|
21
|
+
- Specific criteria that will be used to judge if the issue is fixed
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Issue
|
|
3
|
+
about: The standard template to use for feature requests, design discussions and tasks
|
|
4
|
+
title: " "
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
A brief description of the issue, including specific stakeholders and the business case where appropriate
|
|
11
|
+
|
|
12
|
+
## Acceptance Criteria
|
|
13
|
+
- Specific criteria that will be used to judge if the issue is fixed
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
+
"""Make switcher.json to allow docs to switch between different versions."""
|
|
2
|
+
|
|
1
3
|
import json
|
|
2
4
|
import logging
|
|
3
5
|
from argparse import ArgumentParser
|
|
4
6
|
from pathlib import Path
|
|
5
7
|
from subprocess import CalledProcessError, check_output
|
|
6
|
-
from typing import List, Optional
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
def report_output(stdout: bytes, label: str) ->
|
|
10
|
+
def report_output(stdout: bytes, label: str) -> list[str]:
|
|
11
|
+
"""Print and return something received frm stdout."""
|
|
10
12
|
ret = stdout.decode().strip().split("\n")
|
|
11
13
|
print(f"{label}: {ret}")
|
|
12
14
|
return ret
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
def get_branch_contents(ref: str) ->
|
|
17
|
+
def get_branch_contents(ref: str) -> list[str]:
|
|
16
18
|
"""Get the list of directories in a branch."""
|
|
17
19
|
stdout = check_output(["git", "ls-tree", "-d", "--name-only", ref])
|
|
18
20
|
return report_output(stdout, "Branch contents")
|
|
19
21
|
|
|
20
22
|
|
|
21
|
-
def get_sorted_tags_list() ->
|
|
23
|
+
def get_sorted_tags_list() -> list[str]:
|
|
22
24
|
"""Get a list of sorted tags in descending order from the repository."""
|
|
23
25
|
stdout = check_output(["git", "tag", "-l", "--sort=-v:refname"])
|
|
24
26
|
return report_output(stdout, "Tags list")
|
|
25
27
|
|
|
26
28
|
|
|
27
|
-
def get_versions(ref: str, add:
|
|
29
|
+
def get_versions(ref: str, add: str | None) -> list[str]:
|
|
28
30
|
"""Generate the file containing the list of all GitHub Pages builds."""
|
|
29
31
|
# Get the directories (i.e. builds) from the GitHub Pages branch
|
|
30
32
|
try:
|
|
@@ -41,7 +43,7 @@ def get_versions(ref: str, add: Optional[str]) -> List[str]:
|
|
|
41
43
|
tags = get_sorted_tags_list()
|
|
42
44
|
|
|
43
45
|
# Make the sorted versions list from main branches and tags
|
|
44
|
-
versions:
|
|
46
|
+
versions: list[str] = []
|
|
45
47
|
for version in ["master", "main"] + tags:
|
|
46
48
|
if version in builds:
|
|
47
49
|
versions.append(version)
|
|
@@ -53,7 +55,8 @@ def get_versions(ref: str, add: Optional[str]) -> List[str]:
|
|
|
53
55
|
return versions
|
|
54
56
|
|
|
55
57
|
|
|
56
|
-
def write_json(path: Path, repository: str, versions: str):
|
|
58
|
+
def write_json(path: Path, repository: str, versions: list[str]):
|
|
59
|
+
"""Write the JSON switcher to path."""
|
|
57
60
|
org, repo_name = repository.split("/")
|
|
58
61
|
struct = [
|
|
59
62
|
{"version": version, "url": f"https://{org}.github.io/{repo_name}/{version}/"}
|
|
@@ -65,6 +68,7 @@ def write_json(path: Path, repository: str, versions: str):
|
|
|
65
68
|
|
|
66
69
|
|
|
67
70
|
def main(args=None):
|
|
71
|
+
"""Parse args and write switcher."""
|
|
68
72
|
parser = ArgumentParser(
|
|
69
73
|
description="Make a versions.json file from gh-pages directories"
|
|
70
74
|
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
on:
|
|
2
2
|
workflow_call:
|
|
3
3
|
secrets:
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
PYPI_TOKEN:
|
|
5
|
+
required: true
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
upload:
|
|
@@ -19,4 +19,4 @@ jobs:
|
|
|
19
19
|
- name: Publish to PyPI using trusted publishing
|
|
20
20
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
21
21
|
with:
|
|
22
|
-
|
|
22
|
+
attestations: false
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
- name: Create GitHub Release
|
|
24
24
|
# We pin to the SHA, not the tag, for security reasons.
|
|
25
25
|
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
|
|
26
|
-
uses: softprops/action-gh-release@
|
|
26
|
+
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
|
|
27
27
|
with:
|
|
28
28
|
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
|
|
29
29
|
files: "*"
|
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
strategy:
|
|
22
22
|
matrix:
|
|
23
23
|
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
|
|
24
|
-
python-version: ["3.
|
|
24
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
25
25
|
include:
|
|
26
26
|
# Include one that runs in the dev environment
|
|
27
27
|
- runs-on: "ubuntu-latest"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# The devcontainer should use the developer target and run as root with podman
|
|
2
2
|
# or docker with user namespaces.
|
|
3
3
|
ARG PYTHON_VERSION=3.11
|
|
4
|
-
FROM python:${PYTHON_VERSION}
|
|
4
|
+
FROM python:${PYTHON_VERSION} AS developer
|
|
5
5
|
|
|
6
6
|
# Add any system dependencies for the developer/build environment here
|
|
7
7
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: rtems-proxy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.1
|
|
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
|
|
@@ -208,12 +208,10 @@ License: Apache License
|
|
|
208
208
|
Project-URL: GitHub, https://github.com/epics-containers/rtems-proxy
|
|
209
209
|
Classifier: Development Status :: 3 - Alpha
|
|
210
210
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
212
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
213
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
214
211
|
Classifier: Programming Language :: Python :: 3.10
|
|
215
212
|
Classifier: Programming Language :: Python :: 3.11
|
|
216
|
-
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
214
|
+
Requires-Python: >=3.10
|
|
217
215
|
Description-Content-Type: text/markdown
|
|
218
216
|
License-File: LICENSE
|
|
219
217
|
Requires-Dist: jinja2
|
|
@@ -235,7 +233,7 @@ Requires-Dist: types-mock; extra == "dev"
|
|
|
235
233
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
236
234
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
237
235
|
[](https://pypi.org/project/rtems-proxy)
|
|
238
|
-
[](https://
|
|
236
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
239
237
|
|
|
240
238
|
# rtems_proxy
|
|
241
239
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
2
2
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
3
3
|
[](https://pypi.org/project/rtems-proxy)
|
|
4
|
-
[](https://
|
|
4
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
5
5
|
|
|
6
6
|
# rtems_proxy
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=64", "setuptools_scm[toml]>=
|
|
2
|
+
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -7,18 +7,16 @@ name = "rtems-proxy"
|
|
|
7
7
|
classifiers = [
|
|
8
8
|
"Development Status :: 3 - Alpha",
|
|
9
9
|
"License :: OSI Approved :: Apache Software License",
|
|
10
|
-
"Programming Language :: Python :: 3.7",
|
|
11
|
-
"Programming Language :: Python :: 3.8",
|
|
12
|
-
"Programming Language :: Python :: 3.9",
|
|
13
10
|
"Programming Language :: Python :: 3.10",
|
|
14
11
|
"Programming Language :: Python :: 3.11",
|
|
12
|
+
"Programming Language :: Python :: 3.12",
|
|
15
13
|
]
|
|
16
14
|
description = "Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs"
|
|
17
15
|
dependencies = ["jinja2", "pexpect", "ruamel.yaml", "telnetlib3", "typer"]
|
|
18
16
|
dynamic = ["version"]
|
|
19
17
|
license.file = "LICENSE"
|
|
20
18
|
readme = "README.md"
|
|
21
|
-
requires-python = ">=3.
|
|
19
|
+
requires-python = ">=3.10"
|
|
22
20
|
|
|
23
21
|
[project.optional-dependencies]
|
|
24
22
|
dev = [
|
|
@@ -45,7 +43,7 @@ name = "Giles Knap"
|
|
|
45
43
|
|
|
46
44
|
|
|
47
45
|
[tool.setuptools_scm]
|
|
48
|
-
|
|
46
|
+
version_file = "src/rtems_proxy/_version.py"
|
|
49
47
|
|
|
50
48
|
[tool.mypy]
|
|
51
49
|
ignore_missing_imports = true # Ignore missing stubs in imported modules
|
|
@@ -83,7 +81,7 @@ allowlist_externals =
|
|
|
83
81
|
pre-commit
|
|
84
82
|
mypy
|
|
85
83
|
commands =
|
|
86
|
-
pre-commit: pre-commit run --all-files {posargs}
|
|
84
|
+
pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs}
|
|
87
85
|
type-checking: mypy src tests {posargs}
|
|
88
86
|
tests: pytest --cov=rtems_proxy --cov-report term --cov-report xml:cov.xml {posargs}
|
|
89
87
|
"""
|
|
@@ -97,11 +95,18 @@ ignore = [
|
|
|
97
95
|
src = ["src", "tests"]
|
|
98
96
|
line-length = 88
|
|
99
97
|
lint.select = [
|
|
100
|
-
"B",
|
|
101
|
-
"C4",
|
|
102
|
-
"E",
|
|
103
|
-
"F",
|
|
104
|
-
"W",
|
|
105
|
-
"I",
|
|
106
|
-
"UP",
|
|
98
|
+
"B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
|
|
99
|
+
"C4", # flake8-comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
|
|
100
|
+
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
|
|
101
|
+
"F", # pyflakes rules - https://docs.astral.sh/ruff/rules/#pyflakes-f
|
|
102
|
+
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
|
|
103
|
+
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
|
|
104
|
+
"UP", # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
|
|
105
|
+
"SLF", # self - https://docs.astral.sh/ruff/settings/#lintflake8-self
|
|
107
106
|
]
|
|
107
|
+
|
|
108
|
+
[tool.ruff.lint.per-file-ignores]
|
|
109
|
+
# By default, private member access is allowed in tests
|
|
110
|
+
# See https://github.com/DiamondLightSource/python-copier-template/issues/154
|
|
111
|
+
# Remove this line to forbid private member access in tests
|
|
112
|
+
"tests/**/*" = ["SLF001"]
|
|
@@ -16,7 +16,7 @@ def copy_rtems():
|
|
|
16
16
|
# root of pvc mount into which we copy the IOC files for the RTEMS IOC to access
|
|
17
17
|
root = GLOBALS.RTEMS_TFTP_PATH
|
|
18
18
|
# root of the path that the RTEMS IOC expects to find the IOC files
|
|
19
|
-
RTEMS_TFTP_PATH = Path("/iocs") / GLOBALS.
|
|
19
|
+
RTEMS_TFTP_PATH = Path("/iocs") / GLOBALS.IOC_NAME
|
|
20
20
|
# where to copy the Generic IOC folder to (at present only holds the dbd folder)
|
|
21
21
|
ioc_dest = root / "ioc"
|
|
22
22
|
# where to copy the generated runtime assets to (st.cmd and ioc.db)
|
|
@@ -36,8 +36,18 @@ def copy_rtems():
|
|
|
36
36
|
shutil.copy(bin_rtems_src, bin_rtems_dest)
|
|
37
37
|
shutil.copytree(GLOBALS.RUNTIME, dest_runtime, dirs_exist_ok=True)
|
|
38
38
|
|
|
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
|
+
|
|
39
45
|
# because we moved the ioc files we need to fix up startup script paths
|
|
40
46
|
startup = dest_runtime / "st.cmd"
|
|
41
47
|
cmd_txt = startup.read_text()
|
|
42
48
|
cmd_txt = re.sub("/epics/", f"{str(RTEMS_TFTP_PATH)}/", cmd_txt)
|
|
49
|
+
# also fix up the protocol path to point to protocol_folder
|
|
50
|
+
cmd_txt = (
|
|
51
|
+
cmd_txt + f'\nepicsEnvSet("STREAM_PROTOCOL_PATH", "{str(protocol_folder)}")\n'
|
|
52
|
+
)
|
|
43
53
|
startup.write_text(cmd_txt)
|
|
@@ -10,9 +10,9 @@ export IOC_PATH={{ ioc_path }}
|
|
|
10
10
|
pkill -f rsync-background &>/dev/null
|
|
11
11
|
|
|
12
12
|
ibek dev instance $IOC_PATH
|
|
13
|
+
bash /epics/ioc/install.sh
|
|
13
14
|
|
|
14
15
|
mkdir -p $RTEMS_TFTP_PATH
|
|
15
|
-
cd $RTEMS_TFTP_PATH
|
|
16
16
|
|
|
17
17
|
# get previous contents
|
|
18
18
|
rsync -rt "rsync://$RTEMS_TFTP_IP:12002/files/$IOC_GROUP/$IOC_NAME/" $RTEMS_TFTP_PATH 2>/dev/null
|
|
@@ -92,6 +92,8 @@ class TelnetRTEMS:
|
|
|
92
92
|
bootloader. Because there is a possibility that we are in the middle
|
|
93
93
|
of a reboot, we will retry for one before giving up.
|
|
94
94
|
"""
|
|
95
|
+
assert self._child, "must call connect before check_prompt"
|
|
96
|
+
|
|
95
97
|
while retries > 0:
|
|
96
98
|
try:
|
|
97
99
|
# see if we are in the IOC shell
|
|
@@ -123,6 +125,8 @@ class TelnetRTEMS:
|
|
|
123
125
|
Reboot the board from IOC shell or bootloader and choose appropriate
|
|
124
126
|
options to get to the state requested by the into argument.
|
|
125
127
|
"""
|
|
128
|
+
assert self._child, "must call connect before reboot"
|
|
129
|
+
|
|
126
130
|
self.report(f"Rebooting into {into.name}")
|
|
127
131
|
current_state = self.check_prompt()
|
|
128
132
|
if current_state == RtemsState.MOT:
|
|
@@ -144,10 +148,12 @@ class TelnetRTEMS:
|
|
|
144
148
|
it into the IOC shell. If the IOC is running, do a reboot only if
|
|
145
149
|
requested (in order to pick up new binaries/startup/epics db)
|
|
146
150
|
"""
|
|
151
|
+
assert self._child, "must call connect before get_epics_prompt"
|
|
152
|
+
|
|
147
153
|
current = self.check_prompt()
|
|
148
154
|
if current != RtemsState.IOC:
|
|
149
155
|
sleep(0.2)
|
|
150
|
-
self.
|
|
156
|
+
self.reboot(RtemsState.IOC)
|
|
151
157
|
self.ioc_rebooted = True
|
|
152
158
|
self._child.expect(self.IOC_STARTED, timeout=50)
|
|
153
159
|
else:
|
|
@@ -163,6 +169,8 @@ class TelnetRTEMS:
|
|
|
163
169
|
Get to the bootloader prompt, if the IOC shell is running then exit
|
|
164
170
|
and send appropriate commands to get to the bootloader
|
|
165
171
|
"""
|
|
172
|
+
assert self._child, "must call connect before get_boot_prompt"
|
|
173
|
+
|
|
166
174
|
current = self.check_prompt()
|
|
167
175
|
if current != RtemsState.MOT:
|
|
168
176
|
# get out of the IOC and return to MOT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: rtems-proxy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.1
|
|
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
|
|
@@ -208,12 +208,10 @@ License: Apache License
|
|
|
208
208
|
Project-URL: GitHub, https://github.com/epics-containers/rtems-proxy
|
|
209
209
|
Classifier: Development Status :: 3 - Alpha
|
|
210
210
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
212
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
213
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
214
211
|
Classifier: Programming Language :: Python :: 3.10
|
|
215
212
|
Classifier: Programming Language :: Python :: 3.11
|
|
216
|
-
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
214
|
+
Requires-Python: >=3.10
|
|
217
215
|
Description-Content-Type: text/markdown
|
|
218
216
|
License-File: LICENSE
|
|
219
217
|
Requires-Dist: jinja2
|
|
@@ -235,7 +233,7 @@ Requires-Dist: types-mock; extra == "dev"
|
|
|
235
233
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
236
234
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
237
235
|
[](https://pypi.org/project/rtems-proxy)
|
|
238
|
-
[](https://
|
|
236
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
239
237
|
|
|
240
238
|
# rtems_proxy
|
|
241
239
|
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
Dockerfile
|
|
5
5
|
LICENSE
|
|
6
6
|
README.md
|
|
7
|
-
catalog-info.yaml
|
|
8
7
|
proxy-start.sh
|
|
9
8
|
pyproject.toml
|
|
10
9
|
requirements.txt
|
|
11
10
|
.devcontainer/devcontainer.json
|
|
12
11
|
.github/CONTRIBUTING.md
|
|
13
12
|
.github/dependabot.yml
|
|
13
|
+
.github/ISSUE_TEMPLATE/bug_report.md
|
|
14
|
+
.github/ISSUE_TEMPLATE/issue.md
|
|
15
|
+
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
|
|
14
16
|
.github/actions/install_requirements/action.yml
|
|
15
17
|
.github/pages/index.html
|
|
16
18
|
.github/pages/make_switcher.py
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
# Prevent pytest from catching exceptions when debugging in vscode so that break on
|
|
7
|
+
# exception works correctly (see: https://github.com/pytest-dev/pytest/issues/7409)
|
|
8
|
+
if os.getenv("PYTEST_RAISE", "0") == "1":
|
|
9
|
+
|
|
10
|
+
@pytest.hookimpl(tryfirst=True)
|
|
11
|
+
def pytest_exception_interact(call: pytest.CallInfo[Any]):
|
|
12
|
+
if call.excinfo is not None:
|
|
13
|
+
raise call.excinfo.value
|
|
14
|
+
else:
|
|
15
|
+
raise RuntimeError(
|
|
16
|
+
f"{call} has no exception data, an unknown error has occurred"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
@pytest.hookimpl(tryfirst=True)
|
|
20
|
+
def pytest_internalerror(excinfo: pytest.ExceptionInfo[Any]):
|
|
21
|
+
raise excinfo.value
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: Component
|
|
3
|
-
metadata:
|
|
4
|
-
name: rtems-proxy
|
|
5
|
-
title: rtems-proxy
|
|
6
|
-
description: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
7
|
-
spec:
|
|
8
|
-
type: documentation
|
|
9
|
-
lifecycle: experimental
|
|
10
|
-
owner: group:default/sscc
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
import pytest
|
|
4
|
-
|
|
5
|
-
# Prevent pytest from catching exceptions when debugging in vscode so that break on
|
|
6
|
-
# exception works correctly (see: https://github.com/pytest-dev/pytest/issues/7409)
|
|
7
|
-
if os.getenv("PYTEST_RAISE", "0") == "1":
|
|
8
|
-
|
|
9
|
-
@pytest.hookimpl(tryfirst=True)
|
|
10
|
-
def pytest_exception_interact(call):
|
|
11
|
-
raise call.excinfo.value
|
|
12
|
-
|
|
13
|
-
@pytest.hookimpl(tryfirst=True)
|
|
14
|
-
def pytest_internalerror(excinfo):
|
|
15
|
-
raise excinfo.value
|
|
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
|