auditor-apel-plugin 0.1.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.
- auditor_apel_plugin-0.1.0/.github/dependabot.yml +7 -0
- auditor_apel_plugin-0.1.0/.github/workflows/publish_pypi_git.yml +31 -0
- auditor_apel_plugin-0.1.0/.github/workflows/publish_pypi_test.yml +30 -0
- auditor_apel_plugin-0.1.0/.github/workflows/style_checks.yml +25 -0
- auditor_apel_plugin-0.1.0/.github/workflows/unit_tests.yml +30 -0
- auditor_apel_plugin-0.1.0/.gitignore +10 -0
- auditor_apel_plugin-0.1.0/LICENSE +49 -0
- auditor_apel_plugin-0.1.0/PKG-INFO +24 -0
- auditor_apel_plugin-0.1.0/README.md +13 -0
- auditor_apel_plugin-0.1.0/auditor-apel-plugin.service +11 -0
- auditor_apel_plugin-0.1.0/auditor_apel_plugin.cfg +36 -0
- auditor_apel_plugin-0.1.0/codecov.yml +6 -0
- auditor_apel_plugin-0.1.0/pyproject.toml +60 -0
- auditor_apel_plugin-0.1.0/scripts/install.sh +14 -0
- auditor_apel_plugin-0.1.0/scripts/publish.sh +4 -0
- auditor_apel_plugin-0.1.0/scripts/republish.sh +13 -0
- auditor_apel_plugin-0.1.0/scripts/uninstall.sh +9 -0
- auditor_apel_plugin-0.1.0/setup.cfg +4 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin/__init__.py +0 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin/_version.py +4 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin/core.py +682 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin/publish.py +150 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin/republish.py +104 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin.egg-info/PKG-INFO +24 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin.egg-info/SOURCES.txt +30 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin.egg-info/dependency_links.txt +1 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin.egg-info/entry_points.txt +3 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin.egg-info/requires.txt +17 -0
- auditor_apel_plugin-0.1.0/src/auditor_apel_plugin.egg-info/top_level.txt +1 -0
- auditor_apel_plugin-0.1.0/tests/test_auditor_apel_plugin.py +1070 -0
- auditor_apel_plugin-0.1.0/tests/test_cert.cert +36 -0
- auditor_apel_plugin-0.1.0/tests/test_key.key +52 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: publish-pypi-git
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
steps:
|
|
14
|
+
- name: Check out repo
|
|
15
|
+
uses: actions/checkout@v3
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v4
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.11"
|
|
20
|
+
- name: Install build
|
|
21
|
+
run: |
|
|
22
|
+
pip install --upgrade pip
|
|
23
|
+
pip install .[build]
|
|
24
|
+
- name: Build binary wheel and source tarball
|
|
25
|
+
run: python3 -m build --sdist --wheel --outdir dist/
|
|
26
|
+
- name: Publish to PyPI
|
|
27
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
28
|
+
- name: Publish to GitHub
|
|
29
|
+
uses: softprops/action-gh-release@v1
|
|
30
|
+
with:
|
|
31
|
+
files: dist/*
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: publish-pypi-test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build-and-publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
id-token: write
|
|
12
|
+
steps:
|
|
13
|
+
- name: Check out repo
|
|
14
|
+
uses: actions/checkout@v3
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v4
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.11"
|
|
21
|
+
- name: Install build
|
|
22
|
+
run: |
|
|
23
|
+
pip install --upgrade pip
|
|
24
|
+
pip install .[build]
|
|
25
|
+
- name: Build binary wheel and source tarball
|
|
26
|
+
run: python3 -m build --sdist --wheel --outdir dist/
|
|
27
|
+
- name: Publish to Test PyPI
|
|
28
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
29
|
+
with:
|
|
30
|
+
repository-url: https://test.pypi.org/legacy/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: style-check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check-style:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Check out repo
|
|
13
|
+
uses: actions/checkout@v3
|
|
14
|
+
- name: Set up Python
|
|
15
|
+
uses: actions/setup-python@v4
|
|
16
|
+
with:
|
|
17
|
+
python-version: 3.11
|
|
18
|
+
- name: Install dependencies
|
|
19
|
+
run: |
|
|
20
|
+
pip install --upgrade pip
|
|
21
|
+
pip install .[style]
|
|
22
|
+
- name: Run flake8
|
|
23
|
+
run: flake8 src tests
|
|
24
|
+
- name: Run black
|
|
25
|
+
run: black --diff --check .
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: unit-tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
unit-test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
|
14
|
+
steps:
|
|
15
|
+
- name: Check out repo
|
|
16
|
+
uses: actions/checkout@v3
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v4
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: |
|
|
23
|
+
pip install --upgrade pip
|
|
24
|
+
pip install -e .[tests]
|
|
25
|
+
- name: Run pytest
|
|
26
|
+
run: pytest
|
|
27
|
+
- name: Upload coverage
|
|
28
|
+
uses: codecov/codecov-action@v3
|
|
29
|
+
with:
|
|
30
|
+
fail_ci_if_error: true
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Copyright (c) 2022 Dirk Sammel
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
7
|
+
this list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
Subject to the terms and conditions of this license, each copyright holder
|
|
14
|
+
and contributor hereby grants to those receiving rights under this license
|
|
15
|
+
a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
16
|
+
(except for failure to satisfy the conditions of this license) patent
|
|
17
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
18
|
+
transfer this software, where such license applies only to those patent
|
|
19
|
+
claims, already acquired or hereafter acquired, licensable by such copyright
|
|
20
|
+
holder or contributor that are necessarily infringed by:
|
|
21
|
+
|
|
22
|
+
(a) their Contribution(s) (the licensed copyrights of copyright holders and
|
|
23
|
+
non-copyrightable additions of contributors, in source or binary form)
|
|
24
|
+
alone; or
|
|
25
|
+
|
|
26
|
+
(b) combination of their Contribution(s) with the work of authorship to
|
|
27
|
+
which such Contribution(s) was added by such copyright holder or
|
|
28
|
+
contributor, if, at the time the Contribution is added, such addition
|
|
29
|
+
causes such combination to be necessarily infringed. The patent license
|
|
30
|
+
shall not apply to any other combinations which include the
|
|
31
|
+
Contribution.
|
|
32
|
+
|
|
33
|
+
Except as expressly stated above, no rights or licenses from any copyright
|
|
34
|
+
holder or contributor is granted under this license, whether expressly, by
|
|
35
|
+
implication, estoppel or otherwise.
|
|
36
|
+
|
|
37
|
+
DISCLAIMER
|
|
38
|
+
|
|
39
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
40
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
41
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
42
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
|
43
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
44
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
45
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
46
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
47
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
48
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
49
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: auditor_apel_plugin
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AUDITOR plugin for sending accounting data to APEL
|
|
5
|
+
Requires-Python: >=3.7
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Provides-Extra: style
|
|
8
|
+
Provides-Extra: tests
|
|
9
|
+
Provides-Extra: build
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
|
|
12
|
+
# AUDITOR-APEL-plugin
|
|
13
|
+
|
|
14
|
+
Plugin for AUDITOR to report job records to APEL
|
|
15
|
+
|
|
16
|
+
## License
|
|
17
|
+
|
|
18
|
+
Licensed under
|
|
19
|
+
|
|
20
|
+
- BSD-2-Clause Plus Patent License ([LICENSE](https://github.com/ALU-Schumacher/AUDITOR-APEL-plugin/blob/main/LICENSE))
|
|
21
|
+
|
|
22
|
+
### Contribution
|
|
23
|
+
|
|
24
|
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# AUDITOR-APEL-plugin
|
|
2
|
+
|
|
3
|
+
Plugin for AUDITOR to report job records to APEL
|
|
4
|
+
|
|
5
|
+
## License
|
|
6
|
+
|
|
7
|
+
Licensed under
|
|
8
|
+
|
|
9
|
+
- BSD-2-Clause Plus Patent License ([LICENSE](https://github.com/ALU-Schumacher/AUDITOR-APEL-plugin/blob/main/LICENSE))
|
|
10
|
+
|
|
11
|
+
### Contribution
|
|
12
|
+
|
|
13
|
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[Unit]
|
|
2
|
+
Description=Service publishes accounting data from AUDITOR to APEL
|
|
3
|
+
After=default.target
|
|
4
|
+
|
|
5
|
+
[Service]
|
|
6
|
+
Type=simple
|
|
7
|
+
Restart=always
|
|
8
|
+
ExecStart=/bin/sh -c 'source /usr/bin/auditor-apel-venv && apel-publish'
|
|
9
|
+
|
|
10
|
+
[Install]
|
|
11
|
+
WantedBy=default.target
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[logging]
|
|
2
|
+
log_level = DEBUG
|
|
3
|
+
|
|
4
|
+
[paths]
|
|
5
|
+
time_db_path = /tmp/time.db
|
|
6
|
+
|
|
7
|
+
[intervals]
|
|
8
|
+
report_interval = 20
|
|
9
|
+
|
|
10
|
+
[site]
|
|
11
|
+
publish_since = 2023-03-13 00:00:00+00:00
|
|
12
|
+
sites_to_report = ["atlas-bfg"]
|
|
13
|
+
site_name_mapping = {"atlas-bfg": "UNI-FREIBURG"}
|
|
14
|
+
default_submit_host = gsiftp://arc.bfg.uni-freiburg.de:2811/jobs
|
|
15
|
+
infrastructure_type = grid
|
|
16
|
+
benchmark_type = hepscore23
|
|
17
|
+
|
|
18
|
+
[auditor]
|
|
19
|
+
auditor_ip = 127.0.0.1
|
|
20
|
+
auditor_port = 3333
|
|
21
|
+
auditor_timeout = 60
|
|
22
|
+
benchmark_name = hepscore23
|
|
23
|
+
cores_name = Cores
|
|
24
|
+
cpu_time_name = TotalCPU
|
|
25
|
+
nnodes_name = NNodes
|
|
26
|
+
meta_key_site = site_id
|
|
27
|
+
meta_key_submithost = headnode
|
|
28
|
+
meta_key_voms = voms
|
|
29
|
+
meta_key_username = subject
|
|
30
|
+
|
|
31
|
+
[authentication]
|
|
32
|
+
auth_url = https://192.168.56.2:8443/v1/service-types/ams/hosts/ams:authx509
|
|
33
|
+
ams_url = https://192.168.56.2:443/v1/projects/accounting/topics/topic1:publish?key=
|
|
34
|
+
client_cert = /home/dirk/test/client.pem
|
|
35
|
+
client_key = /home/dirk/test/client.key
|
|
36
|
+
ca_path = /etc/grid-security/certificates
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "setuptools_scm[toml]"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "auditor_apel_plugin"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
requires-python = ">=3.7"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"python-auditor==0.1.0",
|
|
11
|
+
"pytz==2023.3",
|
|
12
|
+
"requests==2.31.0",
|
|
13
|
+
"cryptography==41.0.1",
|
|
14
|
+
]
|
|
15
|
+
description = "AUDITOR plugin for sending accounting data to APEL"
|
|
16
|
+
readme = "README.md"
|
|
17
|
+
|
|
18
|
+
[project.optional-dependencies]
|
|
19
|
+
style = [
|
|
20
|
+
"black",
|
|
21
|
+
"flake8",
|
|
22
|
+
]
|
|
23
|
+
tests = [
|
|
24
|
+
"pytest",
|
|
25
|
+
"pytest-cov",
|
|
26
|
+
]
|
|
27
|
+
build = [
|
|
28
|
+
"build",
|
|
29
|
+
"setuptools",
|
|
30
|
+
"setuptools_scm[toml]",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
auditor-apel-publish = "auditor_apel_plugin.publish:main"
|
|
35
|
+
auditor-apel-republish = "auditor_apel_plugin.republish:main"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools_scm]
|
|
38
|
+
local_scheme = "no-local-version"
|
|
39
|
+
write_to = "src/auditor_apel_plugin/_version.py"
|
|
40
|
+
|
|
41
|
+
[tool.setuptools.packages.find]
|
|
42
|
+
where = ["src"]
|
|
43
|
+
|
|
44
|
+
[tool.coverage.run]
|
|
45
|
+
source = ["src"]
|
|
46
|
+
omit = ["*__init__.py","*publish.py","*_version.py"]
|
|
47
|
+
branch = true
|
|
48
|
+
|
|
49
|
+
[tool.black]
|
|
50
|
+
line-length = 79
|
|
51
|
+
include = '\.pyi?$'
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
addopts = "-s -v --cov"
|
|
55
|
+
testpaths = [
|
|
56
|
+
"tests",
|
|
57
|
+
]
|
|
58
|
+
filterwarnings = [
|
|
59
|
+
"ignore::DeprecationWarning",
|
|
60
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
python -m venv venv
|
|
4
|
+
source venv/bin/activate
|
|
5
|
+
|
|
6
|
+
pip install --upgrade pip
|
|
7
|
+
pip install -e .
|
|
8
|
+
|
|
9
|
+
mkdir /etc/auditor-apel-plugin
|
|
10
|
+
|
|
11
|
+
ln -s $PWD/apel_plugin.cfg /etc/auditor-apel-plugin/apel_plugin.cfg
|
|
12
|
+
ln -s $PWD/scripts/publish.py /usr/bin/auditor-apel-publish
|
|
13
|
+
ln -s $PWD/venv/bin/activate /usr/bin/auditor-apel-venv
|
|
14
|
+
ln -s $PWD/auditor-apel-plugin.service /etc/systemd/system/auditor-apel-plugin.service
|
|
File without changes
|