edge-containers-cli 4.4.5__tar.gz → 5.0.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.
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.copier-answers.yml +3 -1
- edge_containers_cli-5.0.0/.devcontainer/devcontainer.json +73 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/CONTRIBUTING.md +1 -1
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/dependabot.yml +4 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/workflows/_container.yml +5 -1
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/workflows/_dist.yml +6 -5
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/workflows/_release.yml +1 -1
- edge_containers_cli-5.0.0/.github/workflows/_test.yml +44 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/workflows/_tox.yml +3 -3
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/workflows/ci.yml +11 -17
- edge_containers_cli-5.0.0/.gitleaks.toml +19 -0
- edge_containers_cli-5.0.0/.pre-commit-config.yaml +40 -0
- edge_containers_cli-5.0.0/.python-version +1 -0
- edge_containers_cli-5.0.0/Dockerfile +43 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/PKG-INFO +3 -14
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/pyproject.toml +57 -23
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/__main__.py +1 -2
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/_version.py +3 -3
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/argo_commands.py +60 -17
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/demo_commands.py +3 -3
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/helm.py +2 -3
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/monitor.py +48 -13
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/definitions.py +2 -1
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli.egg-info/PKG-INFO +3 -14
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli.egg-info/SOURCES.txt +3 -2
- edge_containers_cli-5.0.0/src/edge_containers_cli.egg-info/requires.txt +8 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/argocd.yaml +55 -10
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-deployment/apps/values.yaml +1 -1
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/bl01t-ea-test-01/templates/configmap.yaml +1 -1
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/dls-aravis/templates/configmap.yaml +1 -1
- edge_containers_cli-5.0.0/uv.lock +1234 -0
- edge_containers_cli-4.4.5/.devcontainer/devcontainer.json +0 -46
- edge_containers_cli-4.4.5/.github/actions/install_requirements/action.yml +0 -34
- edge_containers_cli-4.4.5/.github/workflows/_check.yml +0 -27
- edge_containers_cli-4.4.5/.github/workflows/_test.yml +0 -62
- edge_containers_cli-4.4.5/.pre-commit-config.yaml +0 -25
- edge_containers_cli-4.4.5/Dockerfile +0 -17
- edge_containers_cli-4.4.5/src/edge_containers_cli.egg-info/requires.txt +0 -20
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.dockerignore +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/ISSUE_TEMPLATE/issue.md +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/pages/index.html +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/pages/make_switcher.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/workflows/_pypi.yml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.gitignore +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.vscode/extensions.json +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.vscode/launch.json +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.vscode/settings.json +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.vscode/tasks.json +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/LICENSE +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/README.md +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/conf.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/explanations/decisions/0001-record-architecture-decisions.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/explanations/decisions/0002-switched-to-pip-skeleton.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/explanations/decisions.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/build-docs.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/contribute.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/lint.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/make-release.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/pin-requirements.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/run-tests.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/static-analysis.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/test-container.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/how-to/update-tools.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/index.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/reference/standards.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/developer/tutorials/dev-install.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/genindex.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/images/dls-favicon.ico +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/images/dls-logo.svg +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/images/ec-logs.png +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/images/ec-web.png +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/index.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/user/explanations/docs-structure.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/user/how-to/run-container.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/user/index.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/user/reference/api.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/docs/user/tutorials/installation.rst +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/setup.cfg +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/__init__.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/autocomplete.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/backend.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cli.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/__init__.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/commands.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/k8s_commands.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/cmds/monitor.tcss +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/git.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/globals.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/logging.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/shell.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli/utils.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli.egg-info/dependency_links.txt +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli.egg-info/entry_points.txt +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/src/edge_containers_cli.egg-info/top_level.txt +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/__init__.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/conftest.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/bl01t-ea-test-01/Chart.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/bl01t-ea-test-01/config/ioc.db +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/bl01t-ea-test-01/config/ioc.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/bl01t-ea-test-01/values.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/bl01t-ea-test-02/Chart.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/bl01t-ea-test-02/values.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/dls-aravis/Chart.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/dls-aravis/config/ioc.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/dls-aravis/values.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/bl01t-services/services/values.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/cli.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/k8s.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/data/yaml.yaml +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/test_argocd.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/test_cli.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/test_demo.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/test_k8s.py +0 -0
- {edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/tests/test_unit.py +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# Changes here will be overwritten by Copier
|
|
2
|
-
_commit:
|
|
2
|
+
_commit: 5.0.0a3
|
|
3
3
|
_src_path: gh:DiamondLightSource/python-copier-template
|
|
4
4
|
author_email: giles.knap@gmail.com
|
|
5
5
|
author_name: Giles Knap
|
|
6
6
|
description: CLI for deploying and managing epics containers IOCs and services
|
|
7
7
|
distribution_name: edge-containers-cli
|
|
8
8
|
docker: true
|
|
9
|
+
docker_debug: false
|
|
9
10
|
docs_type: README
|
|
10
11
|
git_platform: github.com
|
|
11
12
|
github_org: epics-containers
|
|
12
13
|
package_name: edge_containers_cli
|
|
13
14
|
pypi: true
|
|
14
15
|
repo_name: edge-containers-cli
|
|
16
|
+
strict_typing: false
|
|
15
17
|
type_checker: pyright
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// For format details, see https://containers.dev/implementors/json_reference/
|
|
2
|
+
{
|
|
3
|
+
"name": "Python 3 Developer Container",
|
|
4
|
+
"build": {
|
|
5
|
+
"dockerfile": "../Dockerfile",
|
|
6
|
+
"target": "developer"
|
|
7
|
+
},
|
|
8
|
+
"remoteEnv": {
|
|
9
|
+
// Allow X11 apps to run inside the container
|
|
10
|
+
"DISPLAY": "${localEnv:DISPLAY}",
|
|
11
|
+
// Do the equivalent of "activate" the venv so we don't have to "uv run" everything
|
|
12
|
+
"VIRTUAL_ENV": "/workspaces/${localWorkspaceFolderBasename}/.venv",
|
|
13
|
+
"PATH": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin:${containerEnv:PATH}"
|
|
14
|
+
},
|
|
15
|
+
"customizations": {
|
|
16
|
+
"vscode": {
|
|
17
|
+
// Set *default* container specific settings.json values on container create.
|
|
18
|
+
"settings": {
|
|
19
|
+
// Use the container's python by default
|
|
20
|
+
"python.defaultInterpreterPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/python",
|
|
21
|
+
// Don't activate the venv as it is already in the PATH
|
|
22
|
+
"python.terminal.activateEnvInCurrentTerminal": false,
|
|
23
|
+
"python.terminal.activateEnvironment": false,
|
|
24
|
+
// Workaround to prevent garbled python REPL in the terminal
|
|
25
|
+
// https://github.com/microsoft/vscode-python/issues/25505
|
|
26
|
+
"python.terminal.shellIntegration.enabled": false
|
|
27
|
+
},
|
|
28
|
+
// Add the IDs of extensions you want installed when the container is created.
|
|
29
|
+
"extensions": [
|
|
30
|
+
"ms-python.python",
|
|
31
|
+
"github.vscode-github-actions",
|
|
32
|
+
"tamasfe.even-better-toml",
|
|
33
|
+
"redhat.vscode-yaml",
|
|
34
|
+
"ryanluker.vscode-coverage-gutters",
|
|
35
|
+
"charliermarsh.ruff",
|
|
36
|
+
"ms-azuretools.vscode-docker"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
// Create the config folder for the bash-config feature and uv cache
|
|
41
|
+
// NOTE: The uv cache can get large, DLS users should read
|
|
42
|
+
// https://dev-guide.diamond.ac.uk/linux-user-environment/how-tos/disk-quota-troubleshooting
|
|
43
|
+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/terminal-config ${localEnv:HOME}/.cache/uv",
|
|
44
|
+
"runArgs": [
|
|
45
|
+
// Allow the container to access the host X11 display and EPICS CA
|
|
46
|
+
"--net=host",
|
|
47
|
+
// Make sure SELinux does not disable with access to host filesystems like tmp
|
|
48
|
+
"--security-opt=label=disable"
|
|
49
|
+
],
|
|
50
|
+
"mounts": [
|
|
51
|
+
// Mount in the user terminal config folder so it can be edited
|
|
52
|
+
{
|
|
53
|
+
"source": "${localEnv:HOME}/.config/terminal-config",
|
|
54
|
+
"target": "/user-terminal-config",
|
|
55
|
+
"type": "bind"
|
|
56
|
+
},
|
|
57
|
+
// Keep a persistent cross container cache for uv
|
|
58
|
+
{
|
|
59
|
+
"source": "${localEnv:HOME}/.cache/uv",
|
|
60
|
+
"target": "/root/.cache/uv",
|
|
61
|
+
"type": "bind"
|
|
62
|
+
},
|
|
63
|
+
// Use a volume mount for the uv venv so it is local to the container
|
|
64
|
+
{
|
|
65
|
+
"target": "/workspaces/${localWorkspaceFolderBasename}/.venv",
|
|
66
|
+
"type": "volume"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
// Mount the parent as /workspaces so we can pip install peers as editable
|
|
70
|
+
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
|
|
71
|
+
// After the container is created, install the python project in editable form
|
|
72
|
+
"postCreateCommand": "uv sync && uv run pre-commit install --install-hooks"
|
|
73
|
+
}
|
|
@@ -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/
|
|
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/5.0.0a3/how-to.html).
|
{edge_containers_cli-4.4.5 → edge_containers_cli-5.0.0}/.github/ISSUE_TEMPLATE/bug_report.md
RENAMED
|
@@ -7,7 +7,7 @@ assignees: ''
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
Describe the bug, including a clear and concise description of the expected
|
|
10
|
+
Describe the bug, including a clear and concise description of the expected behaviour, the actual behavior and the context in which you encountered it (ideally include details of your environment).
|
|
11
11
|
|
|
12
12
|
## Steps To Reproduce
|
|
13
13
|
Steps to reproduce the behavior:
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
on:
|
|
2
2
|
workflow_call:
|
|
3
|
+
inputs:
|
|
4
|
+
publish:
|
|
5
|
+
type: boolean
|
|
6
|
+
description: If true, pushes image to container registry
|
|
3
7
|
|
|
4
8
|
jobs:
|
|
5
9
|
build:
|
|
@@ -47,7 +51,7 @@ jobs:
|
|
|
47
51
|
type=raw,value=latest
|
|
48
52
|
|
|
49
53
|
- name: Push cached image to container registry
|
|
50
|
-
if: github.ref_type == 'tag'
|
|
54
|
+
if: inputs.publish && github.ref_type == 'tag'
|
|
51
55
|
uses: docker/build-push-action@v6
|
|
52
56
|
env:
|
|
53
57
|
DOCKER_BUILD_RECORD_UPLOAD: false
|
|
@@ -12,10 +12,13 @@ jobs:
|
|
|
12
12
|
# Need this to get version number from last tag
|
|
13
13
|
fetch-depth: 0
|
|
14
14
|
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v6
|
|
17
|
+
|
|
15
18
|
- name: Build sdist and wheel
|
|
16
19
|
run: >
|
|
17
20
|
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
|
|
18
|
-
|
|
21
|
+
uvx --from build pyproject-build
|
|
19
22
|
|
|
20
23
|
- name: Upload sdist and wheel as artifacts
|
|
21
24
|
uses: actions/upload-artifact@v4
|
|
@@ -24,12 +27,10 @@ jobs:
|
|
|
24
27
|
path: dist
|
|
25
28
|
|
|
26
29
|
- name: Check for packaging errors
|
|
27
|
-
run:
|
|
30
|
+
run: uvx twine check --strict dist/*
|
|
28
31
|
|
|
29
32
|
- name: Install produced wheel
|
|
30
|
-
|
|
31
|
-
with:
|
|
32
|
-
pip-install: dist/*.whl
|
|
33
|
+
run: python -m pip install dist/*.whl
|
|
33
34
|
|
|
34
35
|
- name: Test module --version works using the installed wheel
|
|
35
36
|
# If more than one module in src/ replace with module name to test
|
|
@@ -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@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
|
|
27
27
|
with:
|
|
28
28
|
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
|
|
29
29
|
files: "*"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
on:
|
|
2
|
+
workflow_call:
|
|
3
|
+
inputs:
|
|
4
|
+
python-version:
|
|
5
|
+
type: string
|
|
6
|
+
description: The version of python to install, default is from .python-version file
|
|
7
|
+
default: ""
|
|
8
|
+
runs-on:
|
|
9
|
+
type: string
|
|
10
|
+
description: The runner to run this job on
|
|
11
|
+
required: true
|
|
12
|
+
secrets:
|
|
13
|
+
CODECOV_TOKEN:
|
|
14
|
+
required: true
|
|
15
|
+
|
|
16
|
+
env:
|
|
17
|
+
# https://github.com/pytest-dev/pytest/issues/2042
|
|
18
|
+
PY_IGNORE_IMPORTMISMATCH: "1"
|
|
19
|
+
UV_PYTHON: ${{ inputs.python-version }}
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
run:
|
|
23
|
+
runs-on: ${{ inputs.runs-on }}
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
# Need this to get version number from last tag
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@v5
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: uv run --locked tox -e tests
|
|
37
|
+
|
|
38
|
+
- name: Upload coverage to Codecov
|
|
39
|
+
uses: codecov/codecov-action@v5
|
|
40
|
+
with:
|
|
41
|
+
name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
|
|
42
|
+
files: cov.xml
|
|
43
|
+
env:
|
|
44
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -15,8 +15,8 @@ jobs:
|
|
|
15
15
|
- name: Checkout
|
|
16
16
|
uses: actions/checkout@v4
|
|
17
17
|
|
|
18
|
-
- name: Install
|
|
19
|
-
uses:
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v5
|
|
20
20
|
|
|
21
21
|
- name: Run tox
|
|
22
|
-
run: tox -e ${{ inputs.tox }}
|
|
22
|
+
run: uv run --locked tox -e ${{ inputs.tox }}
|
|
@@ -2,30 +2,24 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- '*'
|
|
5
9
|
pull_request:
|
|
6
10
|
|
|
7
11
|
jobs:
|
|
8
|
-
check:
|
|
9
|
-
uses: ./.github/workflows/_check.yml
|
|
10
12
|
|
|
11
13
|
lint:
|
|
12
|
-
needs: check
|
|
13
|
-
if: needs.check.outputs.branch-pr == ''
|
|
14
14
|
uses: ./.github/workflows/_tox.yml
|
|
15
15
|
with:
|
|
16
16
|
tox: pre-commit,type-checking
|
|
17
17
|
|
|
18
18
|
test:
|
|
19
|
-
needs: check
|
|
20
|
-
if: needs.check.outputs.branch-pr == ''
|
|
21
19
|
strategy:
|
|
22
20
|
matrix:
|
|
23
21
|
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
|
|
24
|
-
python-version: ["3.
|
|
25
|
-
include:
|
|
26
|
-
# Include one that runs in the dev environment
|
|
27
|
-
- runs-on: "ubuntu-latest"
|
|
28
|
-
python-version: "dev"
|
|
22
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
29
23
|
fail-fast: false
|
|
30
24
|
uses: ./.github/workflows/_test.yml
|
|
31
25
|
with:
|
|
@@ -35,28 +29,28 @@ jobs:
|
|
|
35
29
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
36
30
|
|
|
37
31
|
container:
|
|
38
|
-
needs:
|
|
39
|
-
if:
|
|
32
|
+
needs: test
|
|
33
|
+
if: always()
|
|
40
34
|
uses: ./.github/workflows/_container.yml
|
|
35
|
+
with:
|
|
36
|
+
publish: ${{ needs.test.result == 'success' }}
|
|
41
37
|
permissions:
|
|
42
38
|
contents: read
|
|
43
39
|
packages: write
|
|
44
40
|
|
|
45
41
|
dist:
|
|
46
|
-
needs: check
|
|
47
|
-
if: needs.check.outputs.branch-pr == ''
|
|
48
42
|
uses: ./.github/workflows/_dist.yml
|
|
49
43
|
|
|
50
44
|
pypi:
|
|
45
|
+
needs: [dist, test]
|
|
51
46
|
if: github.ref_type == 'tag'
|
|
52
|
-
needs: dist
|
|
53
47
|
uses: ./.github/workflows/_pypi.yml
|
|
54
48
|
permissions:
|
|
55
49
|
id-token: write
|
|
56
50
|
|
|
57
51
|
release:
|
|
52
|
+
needs: [dist, test]
|
|
58
53
|
if: github.ref_type == 'tag'
|
|
59
|
-
needs: [dist]
|
|
60
54
|
uses: ./.github/workflows/_release.yml
|
|
61
55
|
permissions:
|
|
62
56
|
contents: write
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This allow-list is limited to YAML/YML files to cut down SealedSecrets false positives.
|
|
2
|
+
# All gitleaks default rules still apply everywhere (useDefault = true).
|
|
3
|
+
# To broaden this allow-list to all files, comment out the 'paths' line below.
|
|
4
|
+
|
|
5
|
+
[extend]
|
|
6
|
+
useDefault = true
|
|
7
|
+
|
|
8
|
+
[[rules]]
|
|
9
|
+
id = "generic-api-key"
|
|
10
|
+
|
|
11
|
+
# Pattern-only allowlist for long Ag… tokens in YAML
|
|
12
|
+
[[rules.allowlists]]
|
|
13
|
+
condition = "AND"
|
|
14
|
+
regexes = [
|
|
15
|
+
# Boundary-safe Ag… token without lookarounds (RE2-safe)
|
|
16
|
+
'''(?:^|[^A-Za-z0-9+/=])(Ag[A-Za-z0-9+/]{500,}={0,2})(?:[^A-Za-z0-9+/=]|$)'''
|
|
17
|
+
]
|
|
18
|
+
# Limit to YAML only for now. Comment this out if you want it to apply everywhere.
|
|
19
|
+
paths = ['''(?i).*\.ya?ml$''']
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-added-large-files
|
|
6
|
+
args: ["--maxkb=1000"] # uv.lock is more than 500kB
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
# omit helm templates which are not valid yaml
|
|
9
|
+
exclude: ^.*configmap.yaml$
|
|
10
|
+
- id: check-merge-conflict
|
|
11
|
+
- id: end-of-file-fixer
|
|
12
|
+
|
|
13
|
+
- repo: local
|
|
14
|
+
hooks:
|
|
15
|
+
- id: ruff
|
|
16
|
+
name: lint with ruff
|
|
17
|
+
language: system
|
|
18
|
+
entry: ruff check --force-exclude --fix
|
|
19
|
+
types: [python]
|
|
20
|
+
require_serial: true
|
|
21
|
+
|
|
22
|
+
- id: ruff-format
|
|
23
|
+
name: format with ruff
|
|
24
|
+
language: system
|
|
25
|
+
entry: ruff format --force-exclude
|
|
26
|
+
types: [python]
|
|
27
|
+
require_serial: true
|
|
28
|
+
exclude: tests/data/bl01t
|
|
29
|
+
|
|
30
|
+
- id: uv-sync
|
|
31
|
+
name: update uv.lock and venv
|
|
32
|
+
pass_filenames: false
|
|
33
|
+
language: system
|
|
34
|
+
entry: uv sync
|
|
35
|
+
files: ^(uv\.lock|pyproject\.toml)$
|
|
36
|
+
|
|
37
|
+
- repo: https://github.com/gitleaks/gitleaks
|
|
38
|
+
rev: v8.28.0
|
|
39
|
+
hooks:
|
|
40
|
+
- id: gitleaks
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# The devcontainer should use the developer target and run as root with podman
|
|
2
|
+
# or docker with user namespaces.
|
|
3
|
+
FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:noble AS developer
|
|
4
|
+
|
|
5
|
+
# Add any system dependencies for the developer/build environment here
|
|
6
|
+
RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
|
7
|
+
graphviz \
|
|
8
|
+
&& apt-get dist-clean
|
|
9
|
+
|
|
10
|
+
# The build stage installs the context into the venv
|
|
11
|
+
FROM developer AS build
|
|
12
|
+
|
|
13
|
+
# Change the working directory to the `app` directory
|
|
14
|
+
# and copy in the project
|
|
15
|
+
WORKDIR /app
|
|
16
|
+
COPY . /app
|
|
17
|
+
RUN chmod o+wrX .
|
|
18
|
+
|
|
19
|
+
# Tell uv sync to install python in a known location so we can copy it out later
|
|
20
|
+
ENV UV_PYTHON_INSTALL_DIR=/python
|
|
21
|
+
|
|
22
|
+
# Sync the project without its dev dependencies
|
|
23
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
24
|
+
uv sync --locked --no-editable --no-dev
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# The runtime stage copies the built venv into a runtime container
|
|
28
|
+
FROM ubuntu:noble AS runtime
|
|
29
|
+
|
|
30
|
+
# Add apt-get system dependecies for runtime here if needed
|
|
31
|
+
# RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
|
32
|
+
# some-library \
|
|
33
|
+
# && apt-get dist-clean
|
|
34
|
+
|
|
35
|
+
# Copy the python installation from the build stage
|
|
36
|
+
COPY --from=build /python /python
|
|
37
|
+
|
|
38
|
+
# Copy the environment, but not the source code
|
|
39
|
+
COPY --from=build /app/.venv /app/.venv
|
|
40
|
+
ENV PATH=/app/.venv/bin:$PATH
|
|
41
|
+
|
|
42
|
+
ENTRYPOINT ["ec"]
|
|
43
|
+
CMD ["--version"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edge-containers-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.0
|
|
4
4
|
Summary: CLI for deploying and managing epics containers IOCs and services
|
|
5
5
|
Author-email: Giles Knap <giles.knap@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -208,10 +208,10 @@ License: Apache License
|
|
|
208
208
|
Project-URL: GitHub, https://github.com/epics-containers/edge-containers-cli
|
|
209
209
|
Classifier: Development Status :: 3 - Alpha
|
|
210
210
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
212
211
|
Classifier: Programming Language :: Python :: 3.11
|
|
213
212
|
Classifier: Programming Language :: Python :: 3.12
|
|
214
|
-
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
214
|
+
Requires-Python: >=3.11
|
|
215
215
|
Description-Content-Type: text/markdown
|
|
216
216
|
License-File: LICENSE
|
|
217
217
|
Requires-Dist: natsort
|
|
@@ -222,17 +222,6 @@ Requires-Dist: jinja2
|
|
|
222
222
|
Requires-Dist: polars-lts-cpu
|
|
223
223
|
Requires-Dist: textual
|
|
224
224
|
Requires-Dist: urllib3<2.4.0
|
|
225
|
-
Provides-Extra: dev
|
|
226
|
-
Requires-Dist: copier; extra == "dev"
|
|
227
|
-
Requires-Dist: pipdeptree; extra == "dev"
|
|
228
|
-
Requires-Dist: pre-commit; extra == "dev"
|
|
229
|
-
Requires-Dist: pyright; extra == "dev"
|
|
230
|
-
Requires-Dist: pytest; extra == "dev"
|
|
231
|
-
Requires-Dist: pytest-cov; extra == "dev"
|
|
232
|
-
Requires-Dist: pytest-mock; extra == "dev"
|
|
233
|
-
Requires-Dist: ruff; extra == "dev"
|
|
234
|
-
Requires-Dist: tox-direct; extra == "dev"
|
|
235
|
-
Requires-Dist: types-mock; extra == "dev"
|
|
236
225
|
Dynamic: license-file
|
|
237
226
|
|
|
238
227
|
[](https://github.com/epics-containers/edge-containers-cli/actions/workflows/ci.yml)
|
|
@@ -7,9 +7,9 @@ name = "edge-containers-cli"
|
|
|
7
7
|
classifiers = [
|
|
8
8
|
"Development Status :: 3 - Alpha",
|
|
9
9
|
"License :: OSI Approved :: Apache Software License",
|
|
10
|
-
"Programming Language :: Python :: 3.10",
|
|
11
10
|
"Programming Language :: Python :: 3.11",
|
|
12
11
|
"Programming Language :: Python :: 3.12",
|
|
12
|
+
"Programming Language :: Python :: 3.13",
|
|
13
13
|
]
|
|
14
14
|
description = "CLI for deploying and managing epics containers IOCs and services"
|
|
15
15
|
|
|
@@ -29,19 +29,18 @@ dependencies = [
|
|
|
29
29
|
dynamic = ["version"]
|
|
30
30
|
license.file = "LICENSE"
|
|
31
31
|
readme = "README.md"
|
|
32
|
-
requires-python = ">=3.
|
|
32
|
+
requires-python = ">=3.11"
|
|
33
33
|
|
|
34
|
-
[
|
|
34
|
+
[dependency-groups]
|
|
35
35
|
dev = [
|
|
36
36
|
"copier",
|
|
37
|
-
"pipdeptree",
|
|
38
37
|
"pre-commit",
|
|
39
38
|
"pyright",
|
|
40
39
|
"pytest",
|
|
41
40
|
"pytest-cov",
|
|
42
41
|
"pytest-mock",
|
|
43
42
|
"ruff",
|
|
44
|
-
"tox-
|
|
43
|
+
"tox-uv",
|
|
45
44
|
"types-mock",
|
|
46
45
|
]
|
|
47
46
|
|
|
@@ -55,7 +54,6 @@ GitHub = "https://github.com/epics-containers/edge-containers-cli"
|
|
|
55
54
|
email = "giles.knap@gmail.com"
|
|
56
55
|
name = "Giles Knap"
|
|
57
56
|
|
|
58
|
-
|
|
59
57
|
[tool.setuptools_scm]
|
|
60
58
|
version_file = "src/edge_containers_cli/_version.py"
|
|
61
59
|
|
|
@@ -78,6 +76,7 @@ filterwarnings = [
|
|
|
78
76
|
testpaths = "src tests"
|
|
79
77
|
|
|
80
78
|
[tool.coverage.run]
|
|
79
|
+
patch = ["subprocess"]
|
|
81
80
|
data_file = "/tmp/edge_containers_cli.coverage"
|
|
82
81
|
omit = ["src/edge_containers_cli/cmds/monitor.py"]
|
|
83
82
|
|
|
@@ -91,23 +90,55 @@ omit = ["src/edge_containers_cli/cmds/monitor.py"]
|
|
|
91
90
|
# tox must currently be configured via an embedded ini string
|
|
92
91
|
# See: https://github.com/tox-dev/tox/issues/999
|
|
93
92
|
[tool.tox]
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
[
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
""
|
|
93
|
+
skipsdist = true
|
|
94
|
+
# envs to runs automatically with tox -p
|
|
95
|
+
env_list = ["pre-commit", "type-checking", "tests"]
|
|
96
|
+
|
|
97
|
+
[tool.tox.env_run_base]
|
|
98
|
+
# Pass all environment variables to the test environments
|
|
99
|
+
passenv = ["*"]
|
|
100
|
+
|
|
101
|
+
[tool.tox.env.pre-commit]
|
|
102
|
+
description = "Run pre-commit on all files"
|
|
103
|
+
commands = [
|
|
104
|
+
[
|
|
105
|
+
"pre-commit",
|
|
106
|
+
"run",
|
|
107
|
+
"--all-files",
|
|
108
|
+
"--show-diff-on-failure",
|
|
109
|
+
{ replace = "posargs", default = [
|
|
110
|
+
], extend = true },
|
|
111
|
+
],
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
[tool.tox.env.type-checking]
|
|
115
|
+
description = "Run pyright"
|
|
116
|
+
commands = [
|
|
117
|
+
[
|
|
118
|
+
"pyright",
|
|
119
|
+
"--pythonpath",
|
|
120
|
+
".venv/bin/python",
|
|
121
|
+
"src",
|
|
122
|
+
"tests",
|
|
123
|
+
{ replace = "posargs", default = [
|
|
124
|
+
], extend = true },
|
|
125
|
+
],
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
[tool.tox.env.tests]
|
|
129
|
+
description = "Run tests with coverage"
|
|
130
|
+
commands = [
|
|
131
|
+
[
|
|
132
|
+
"pytest",
|
|
133
|
+
"--cov=edge_containers_cli",
|
|
134
|
+
"--cov-report",
|
|
135
|
+
"term",
|
|
136
|
+
"--cov-report",
|
|
137
|
+
"xml:cov.xml",
|
|
138
|
+
{ replace = "posargs", default = [
|
|
139
|
+
], extend = true },
|
|
140
|
+
],
|
|
141
|
+
]
|
|
111
142
|
|
|
112
143
|
[tool.ruff]
|
|
113
144
|
src = ["src", "tests"]
|
|
@@ -117,12 +148,15 @@ lint.ignore = [
|
|
|
117
148
|
"E501", # Line too long, should be fixed by black.
|
|
118
149
|
"B008", # Do not perform function calls in argument defaults.
|
|
119
150
|
"UP007", # Do not complain about Optional[] (TODO: remove once typer is patched)
|
|
151
|
+
"N803", # Argument name should be lowercase
|
|
152
|
+
"N802", # Function name should be lowercase
|
|
120
153
|
]
|
|
121
154
|
lint.select = [
|
|
122
155
|
"B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
|
|
123
156
|
"C4", # flake8-comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
|
|
124
157
|
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
|
|
125
158
|
"F", # pyflakes rules - https://docs.astral.sh/ruff/rules/#pyflakes-f
|
|
159
|
+
"N", # pep8-naming - https://docs.astral.sh/ruff/rules/#pep8-naming-n
|
|
126
160
|
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
|
|
127
161
|
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
|
|
128
162
|
"UP", # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
|
-
from typing import Optional
|
|
4
3
|
|
|
5
4
|
import typer
|
|
6
5
|
|
|
@@ -36,7 +35,7 @@ def backend_callback(ctx: typer.Context, backend: ECBackends):
|
|
|
36
35
|
@cli.callback()
|
|
37
36
|
def _main(
|
|
38
37
|
ctx: typer.Context,
|
|
39
|
-
version:
|
|
38
|
+
version: bool | None = typer.Option(
|
|
40
39
|
None,
|
|
41
40
|
"--version",
|
|
42
41
|
callback=version_callback,
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '
|
|
32
|
-
__version_tuple__ = version_tuple = (
|
|
31
|
+
__version__ = version = '5.0.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (5, 0, 0)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g7454dd976'
|