imas-simdb 0.13.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 (168) hide show
  1. imas_simdb-0.13.0/.gitattributes +1 -0
  2. imas_simdb-0.13.0/.github/workflows/build_and_test.yml +53 -0
  3. imas_simdb-0.13.0/.github/workflows/build_docs.yml +50 -0
  4. imas_simdb-0.13.0/.github/workflows/publish.yml +70 -0
  5. imas_simdb-0.13.0/.gitignore +33 -0
  6. imas_simdb-0.13.0/.gitlab-ci.yml +148 -0
  7. imas_simdb-0.13.0/.pylintrc +0 -0
  8. imas_simdb-0.13.0/.readthedocs.yml +24 -0
  9. imas_simdb-0.13.0/Dockerfile +9 -0
  10. imas_simdb-0.13.0/LICENSE.txt +165 -0
  11. imas_simdb-0.13.0/PKG-INFO +116 -0
  12. imas_simdb-0.13.0/README.md +25 -0
  13. imas_simdb-0.13.0/ci/build_and_test.sh +55 -0
  14. imas_simdb-0.13.0/ci/build_docs.sh +46 -0
  15. imas_simdb-0.13.0/conda/requirements-server.txt +79 -0
  16. imas_simdb-0.13.0/conda/requirements.txt +44 -0
  17. imas_simdb-0.13.0/dev_requirements.txt +34 -0
  18. imas_simdb-0.13.0/docker/proxy_params +4 -0
  19. imas_simdb-0.13.0/docker/simdb.nginx +9 -0
  20. imas_simdb-0.13.0/docker-compose.yml +33 -0
  21. imas_simdb-0.13.0/docs/.gitignore +4 -0
  22. imas_simdb-0.13.0/docs/Makefile +19 -0
  23. imas_simdb-0.13.0/docs/cli.md +789 -0
  24. imas_simdb-0.13.0/docs/cli.md.in +32 -0
  25. imas_simdb-0.13.0/docs/design.md +260 -0
  26. imas_simdb-0.13.0/docs/developer_guide.md +91 -0
  27. imas_simdb-0.13.0/docs/genapidocs.sh +5 -0
  28. imas_simdb-0.13.0/docs/generate_cli_docs.py +65 -0
  29. imas_simdb-0.13.0/docs/install_guide.md +65 -0
  30. imas_simdb-0.13.0/docs/iter_certificate.md +24 -0
  31. imas_simdb-0.13.0/docs/iter_remotes.md +52 -0
  32. imas_simdb-0.13.0/docs/maintenance_guide.md +420 -0
  33. imas_simdb-0.13.0/docs/make.bat +35 -0
  34. imas_simdb-0.13.0/docs/setting_up_postgres.md +26 -0
  35. imas_simdb-0.13.0/docs/simdb-architecture.svg +1 -0
  36. imas_simdb-0.13.0/docs/sphinx/conf.py +196 -0
  37. imas_simdb-0.13.0/docs/sphinx/index.rst +24 -0
  38. imas_simdb-0.13.0/docs/tutorial.md +148 -0
  39. imas_simdb-0.13.0/docs/user_guide.md +293 -0
  40. imas_simdb-0.13.0/pyproject.toml +167 -0
  41. imas_simdb-0.13.0/requirements.txt +31 -0
  42. imas_simdb-0.13.0/scripts/iter_yaml_to_simdb.py +124 -0
  43. imas_simdb-0.13.0/scripts/python-argcomplete.sh +76 -0
  44. imas_simdb-0.13.0/scripts/simdb +13 -0
  45. imas_simdb-0.13.0/scripts/simdb_legacy_importer.py +1352 -0
  46. imas_simdb-0.13.0/scripts/simdb_server +5 -0
  47. imas_simdb-0.13.0/setup.cfg +4 -0
  48. imas_simdb-0.13.0/simdb.sh +18 -0
  49. imas_simdb-0.13.0/sql/create.sql +38 -0
  50. imas_simdb-0.13.0/sql/drop.sql +6 -0
  51. imas_simdb-0.13.0/sql/manage.py +34 -0
  52. imas_simdb-0.13.0/sql/test2.py +267 -0
  53. imas_simdb-0.13.0/src/imas_simdb.egg-info/PKG-INFO +116 -0
  54. imas_simdb-0.13.0/src/imas_simdb.egg-info/SOURCES.txt +166 -0
  55. imas_simdb-0.13.0/src/imas_simdb.egg-info/dependency_links.txt +1 -0
  56. imas_simdb-0.13.0/src/imas_simdb.egg-info/entry_points.txt +3 -0
  57. imas_simdb-0.13.0/src/imas_simdb.egg-info/requires.txt +72 -0
  58. imas_simdb-0.13.0/src/imas_simdb.egg-info/top_level.txt +1 -0
  59. imas_simdb-0.13.0/src/simdb/__init__.py +20 -0
  60. imas_simdb-0.13.0/src/simdb/_version.py +34 -0
  61. imas_simdb-0.13.0/src/simdb/checksum.py +27 -0
  62. imas_simdb-0.13.0/src/simdb/cli/__init__.py +6 -0
  63. imas_simdb-0.13.0/src/simdb/cli/__main__.py +3 -0
  64. imas_simdb-0.13.0/src/simdb/cli/commands/__init__.py +14 -0
  65. imas_simdb-0.13.0/src/simdb/cli/commands/alias.py +126 -0
  66. imas_simdb-0.13.0/src/simdb/cli/commands/config.py +57 -0
  67. imas_simdb-0.13.0/src/simdb/cli/commands/database.py +19 -0
  68. imas_simdb-0.13.0/src/simdb/cli/commands/manifest.py +34 -0
  69. imas_simdb-0.13.0/src/simdb/cli/commands/provenance.py +62 -0
  70. imas_simdb-0.13.0/src/simdb/cli/commands/remote.py +659 -0
  71. imas_simdb-0.13.0/src/simdb/cli/commands/simulation.py +427 -0
  72. imas_simdb-0.13.0/src/simdb/cli/commands/utils.py +168 -0
  73. imas_simdb-0.13.0/src/simdb/cli/commands/validators.py +13 -0
  74. imas_simdb-0.13.0/src/simdb/cli/file_system.py +2 -0
  75. imas_simdb-0.13.0/src/simdb/cli/manifest.py +612 -0
  76. imas_simdb-0.13.0/src/simdb/cli/remote_api.py +993 -0
  77. imas_simdb-0.13.0/src/simdb/cli/simdb.py +98 -0
  78. imas_simdb-0.13.0/src/simdb/cli/template.yaml +14 -0
  79. imas_simdb-0.13.0/src/simdb/config/__init__.py +10 -0
  80. imas_simdb-0.13.0/src/simdb/config/config.py +354 -0
  81. imas_simdb-0.13.0/src/simdb/database/__init__.py +10 -0
  82. imas_simdb-0.13.0/src/simdb/database/database.py +734 -0
  83. imas_simdb-0.13.0/src/simdb/database/models/__init__.py +7 -0
  84. imas_simdb-0.13.0/src/simdb/database/models/base.py +40 -0
  85. imas_simdb-0.13.0/src/simdb/database/models/file.py +139 -0
  86. imas_simdb-0.13.0/src/simdb/database/models/metadata.py +42 -0
  87. imas_simdb-0.13.0/src/simdb/database/models/simulation.py +353 -0
  88. imas_simdb-0.13.0/src/simdb/database/models/types.py +110 -0
  89. imas_simdb-0.13.0/src/simdb/database/models/utils.py +68 -0
  90. imas_simdb-0.13.0/src/simdb/database/models/watcher.py +59 -0
  91. imas_simdb-0.13.0/src/simdb/docstrings.py +19 -0
  92. imas_simdb-0.13.0/src/simdb/email/__init__.py +0 -0
  93. imas_simdb-0.13.0/src/simdb/email/server.py +35 -0
  94. imas_simdb-0.13.0/src/simdb/imas/__init__.py +6 -0
  95. imas_simdb-0.13.0/src/simdb/imas/checksum.py +95 -0
  96. imas_simdb-0.13.0/src/simdb/imas/imas_metadata.yaml +20 -0
  97. imas_simdb-0.13.0/src/simdb/imas/metadata.py +142 -0
  98. imas_simdb-0.13.0/src/simdb/imas/utils.py +348 -0
  99. imas_simdb-0.13.0/src/simdb/json.py +51 -0
  100. imas_simdb-0.13.0/src/simdb/notifications.py +8 -0
  101. imas_simdb-0.13.0/src/simdb/py.typed +0 -0
  102. imas_simdb-0.13.0/src/simdb/query.py +173 -0
  103. imas_simdb-0.13.0/src/simdb/remote/__init__.py +19 -0
  104. imas_simdb-0.13.0/src/simdb/remote/apis/__init__.py +147 -0
  105. imas_simdb-0.13.0/src/simdb/remote/apis/files.py +248 -0
  106. imas_simdb-0.13.0/src/simdb/remote/apis/metadata.py +29 -0
  107. imas_simdb-0.13.0/src/simdb/remote/apis/v1/__init__.py +55 -0
  108. imas_simdb-0.13.0/src/simdb/remote/apis/v1/simulations.py +349 -0
  109. imas_simdb-0.13.0/src/simdb/remote/apis/v1_1/__init__.py +55 -0
  110. imas_simdb-0.13.0/src/simdb/remote/apis/v1_1/simulations.py +460 -0
  111. imas_simdb-0.13.0/src/simdb/remote/apis/v1_2/__init__.py +59 -0
  112. imas_simdb-0.13.0/src/simdb/remote/apis/v1_2/sim.sql +39 -0
  113. imas_simdb-0.13.0/src/simdb/remote/apis/v1_2/simulations.py +632 -0
  114. imas_simdb-0.13.0/src/simdb/remote/apis/watchers.py +68 -0
  115. imas_simdb-0.13.0/src/simdb/remote/app.py +62 -0
  116. imas_simdb-0.13.0/src/simdb/remote/core/__init__.py +0 -0
  117. imas_simdb-0.13.0/src/simdb/remote/core/alias.py +20 -0
  118. imas_simdb-0.13.0/src/simdb/remote/core/auth/__init__.py +124 -0
  119. imas_simdb-0.13.0/src/simdb/remote/core/auth/_authenticator.py +52 -0
  120. imas_simdb-0.13.0/src/simdb/remote/core/auth/_exceptions.py +2 -0
  121. imas_simdb-0.13.0/src/simdb/remote/core/auth/_user.py +4 -0
  122. imas_simdb-0.13.0/src/simdb/remote/core/auth/active_directory.py +47 -0
  123. imas_simdb-0.13.0/src/simdb/remote/core/auth/firewall.py +34 -0
  124. imas_simdb-0.13.0/src/simdb/remote/core/auth/keycloak.py +34 -0
  125. imas_simdb-0.13.0/src/simdb/remote/core/auth/ldap.py +89 -0
  126. imas_simdb-0.13.0/src/simdb/remote/core/auth/no_authentication.py +25 -0
  127. imas_simdb-0.13.0/src/simdb/remote/core/auth/token.py +44 -0
  128. imas_simdb-0.13.0/src/simdb/remote/core/cache.py +27 -0
  129. imas_simdb-0.13.0/src/simdb/remote/core/errors.py +7 -0
  130. imas_simdb-0.13.0/src/simdb/remote/core/path.py +22 -0
  131. imas_simdb-0.13.0/src/simdb/remote/core/typing.py +18 -0
  132. imas_simdb-0.13.0/src/simdb/remote/scripts/app.cfg +18 -0
  133. imas_simdb-0.13.0/src/simdb/remote/scripts/openssl.cnf +22 -0
  134. imas_simdb-0.13.0/src/simdb/remote/scripts/run.sh +12 -0
  135. imas_simdb-0.13.0/src/simdb/remote/scripts/setup.env +6 -0
  136. imas_simdb-0.13.0/src/simdb/remote/scripts/setup.md +38 -0
  137. imas_simdb-0.13.0/src/simdb/remote/scripts/simdb.initd +62 -0
  138. imas_simdb-0.13.0/src/simdb/remote/scripts/simdb.nginx +9 -0
  139. imas_simdb-0.13.0/src/simdb/remote/wsgi.py +35 -0
  140. imas_simdb-0.13.0/src/simdb/uda/__init__.py +6 -0
  141. imas_simdb-0.13.0/src/simdb/uda/checksum.py +30 -0
  142. imas_simdb-0.13.0/src/simdb/uri.py +161 -0
  143. imas_simdb-0.13.0/src/simdb/validation/__init__.py +3 -0
  144. imas_simdb-0.13.0/src/simdb/validation/file/__init__.py +17 -0
  145. imas_simdb-0.13.0/src/simdb/validation/file/ids_validator.py +99 -0
  146. imas_simdb-0.13.0/src/simdb/validation/file/validator_base.py +28 -0
  147. imas_simdb-0.13.0/src/simdb/validation/validator.py +206 -0
  148. imas_simdb-0.13.0/test.yaml +3 -0
  149. imas_simdb-0.13.0/tests/cli/test_cli_alias_command.py +78 -0
  150. imas_simdb-0.13.0/tests/cli/test_cli_config_command.py +34 -0
  151. imas_simdb-0.13.0/tests/cli/test_cli_database_command.py +13 -0
  152. imas_simdb-0.13.0/tests/cli/test_cli_manifest_command.py +38 -0
  153. imas_simdb-0.13.0/tests/cli/test_cli_provenance_command.py +20 -0
  154. imas_simdb-0.13.0/tests/cli/test_cli_remote_command.py +334 -0
  155. imas_simdb-0.13.0/tests/cli/test_cli_simulation_command.py +85 -0
  156. imas_simdb-0.13.0/tests/cli/utils.py +51 -0
  157. imas_simdb-0.13.0/tests/config/test_config.py +48 -0
  158. imas_simdb-0.13.0/tests/database/test_database.py +52 -0
  159. imas_simdb-0.13.0/tests/database/test_models.py +40 -0
  160. imas_simdb-0.13.0/tests/locust.yaml +50 -0
  161. imas_simdb-0.13.0/tests/manifest.yaml +44 -0
  162. imas_simdb-0.13.0/tests/remote/test_api.py +76 -0
  163. imas_simdb-0.13.0/tests/remote/test_authentication.py +92 -0
  164. imas_simdb-0.13.0/tests/test0.yaml +75 -0
  165. imas_simdb-0.13.0/tests/test_uri.py +62 -0
  166. imas_simdb-0.13.0/tests/tests.py +14 -0
  167. imas_simdb-0.13.0/validation/iter_scenarios_validation.yaml +309 -0
  168. imas_simdb-0.13.0/validation/simple_validation.yaml +22 -0
@@ -0,0 +1 @@
1
+ src/simdb/_version.py export-subst
@@ -0,0 +1,53 @@
1
+ name: SimDB CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
7
+
8
+ jobs:
9
+ tests:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: [ "3.11", "3.12", "3.13" ]
15
+
16
+ steps:
17
+ - name: Install OpenLDAP development libraries
18
+ run: sudo apt-get update && sudo apt-get install -y libldap2-dev libsasl2-dev
19
+
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v4
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v4
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ cache: pip
28
+
29
+ - name: Install build and test dependencies
30
+ run: |
31
+ python -m venv venv
32
+ source venv/bin/activate
33
+ pip install --upgrade pip setuptools wheel
34
+ python -m pip install python-ldap
35
+ pip install pytest-xdist
36
+ pip install .[build-test]
37
+
38
+ - name: Run tests
39
+ run: |
40
+ source venv/bin/activate
41
+ python -m pytest --cov=simdb --cov-report=term-missing --cov-report=xml:coverage.xml --cov-report=html:htmlcov --junit-xml=junit.xml -v --tb=short
42
+
43
+ - name: Upload coverage report ${{ matrix.python-version }}
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: coverage-report-${{ matrix.python-version }}
47
+ path: htmlcov
48
+
49
+ - name: Upload test report ${{ matrix.python-version }}
50
+ uses: actions/upload-artifact@v4
51
+ with:
52
+ name: test-report-${{ matrix.python-version }}
53
+ path: junit.xml
@@ -0,0 +1,50 @@
1
+ name: Build Docs
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
7
+ paths:
8
+ - "docs/**"
9
+ - "src/simdb/**"
10
+
11
+ jobs:
12
+ build-docs:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout repository
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v4
20
+ with:
21
+ python-version: "3.11"
22
+ cache: pip
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ pip install --upgrade pip setuptools wheel
27
+ pip install .[build-docs]
28
+
29
+ - name: Build Documentation
30
+ run: |
31
+ cd docs
32
+ sphinx-apidoc -f -o sphinx -e -M ../src/simdb
33
+ rm -f sphinx/modules.rst || true
34
+ cp -f *.md sphinx/ 2>/dev/null || true
35
+ cp -f *.svg sphinx/ 2>/dev/null || true
36
+ make clean html
37
+
38
+ - name: Upload docs artifact
39
+ uses: actions/upload-artifact@v4
40
+ with:
41
+ name: documentation
42
+ path: docs/_build/html
43
+
44
+ - name: Check build warnings
45
+ run: |
46
+ if grep -q "WARNING\|ERROR" docs/_build/html/.doctrees/environment.pickle 2>/dev/null; then
47
+ echo "Documentation build has warnings/errors"
48
+ exit 1
49
+ fi
50
+
@@ -0,0 +1,70 @@
1
+ name: build-wheel-and-publish-test-pypi
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
7
+
8
+ jobs:
9
+ build:
10
+ name: Build distribution
11
+ runs-on: ubuntu-22.04
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ with:
15
+ fetch-depth: 0
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ - name: Install pypa/build
19
+ run: >-
20
+ python3 -m pip install pip setuptools wheel build
21
+ - name: Build a binary wheel and a source tarball
22
+ run: python3 -m build .
23
+ - name: Store the distribution packages
24
+ uses: actions/upload-artifact@v4
25
+ with:
26
+ name: python-package-distributions
27
+ path: dist/
28
+
29
+ publish-to-pypi:
30
+ name: Publish SimDB distribution to PyPI
31
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
32
+ needs:
33
+ - build
34
+ runs-on: ubuntu-22.04
35
+ environment:
36
+ name: pypi
37
+ url: https://pypi.org/p/imas-simdb
38
+ permissions:
39
+ id-token: write # IMPORTANT: mandatory for trusted publishing
40
+ steps:
41
+ - name: Download all the dists
42
+ uses: actions/download-artifact@v4
43
+ with:
44
+ name: python-package-distributions
45
+ path: dist/
46
+ - name: Publish distribution to PyPI
47
+ uses: pypa/gh-action-pypi-publish@release/v1
48
+
49
+ publish-to-testpypi:
50
+ name: Publish SimDB distribution to TestPyPI
51
+ if: github.ref=='refs/heads/develop' # only publish to TestPyPI on develop pushes
52
+ needs:
53
+ - build
54
+ runs-on: ubuntu-22.04
55
+ environment:
56
+ name: testpypi
57
+ url: https://test.pypi.org/p/imas-simdb
58
+ permissions:
59
+ id-token: write # IMPORTANT: mandatory for trusted publishing
60
+ steps:
61
+ - name: Download all the dists
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: python-package-distributions
65
+ path: dist/
66
+ - name: Publish distribution to TestPyPI
67
+ uses: pypa/gh-action-pypi-publish@unstable/v1
68
+ with:
69
+ repository-url: https://test.pypi.org/legacy/
70
+ verbose: true
@@ -0,0 +1,33 @@
1
+ __pycache__
2
+ sql/sim.db
3
+ .idea/
4
+ .mypy_cache
5
+ /build
6
+ /data
7
+ /logs
8
+ venv
9
+ environment.txt
10
+ environment.yml
11
+ git_update
12
+ runtests
13
+ sdb
14
+ src/simdb/cli/runtests
15
+ src/simdb.egg-info
16
+ test.yml
17
+ test4_manifest.yml
18
+ test7_manifest.yml
19
+ test_manifest.yml
20
+ /temp
21
+ /htmlcov
22
+ /test-reports/
23
+ /tests/cli/test.cfg
24
+ /tests/cli/*.yaml
25
+ .eggs
26
+ .coverage
27
+ *.xml
28
+ simdb-coverage-report
29
+ *.tar.gz
30
+ src/simdb/_version.py
31
+ *.egg-info
32
+ *.egg
33
+ *.whl
@@ -0,0 +1,148 @@
1
+ image:
2
+ name: "python:3.7"
3
+
4
+ stages:
5
+ - build
6
+ - test
7
+ - doc
8
+
9
+ # Change pip's cache directory to be inside the project directory since we can
10
+ # only cache local items.
11
+ variables:
12
+ PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
13
+ PYTHONTOOLS_VENV_PATH: "$CI_PROJECT_DIR/venv/simdb"
14
+ PYTHONTOOLS_DIR: "$CI_PROJECT_DIR"
15
+ PACKAGE: "simdb"
16
+
17
+ # Pip's cache doesn't store the python packages
18
+ # https://pip.pypa.io/en/stable/reference/pip_install/#caching
19
+ #
20
+ # If you want to also cache the installed packages, you have to install
21
+ # them in a virtualenv and cache it as well.
22
+ .cache_python: &cache_python
23
+ paths:
24
+ - $PIP_CACHE_DIR
25
+
26
+
27
+ ########################################
28
+ # General Docker environment templates #
29
+ ########################################
30
+
31
+ ##############################
32
+ # Global tests and templates #
33
+ ##############################
34
+ before_script:
35
+ - export USER=root
36
+
37
+ .collect_deps_manually: &collect_deps_manually |
38
+ export BUILD_DEPS=$(cat pyproject.toml | grep requires | cut -d'=' -f2- | tr -d ,\"\' | sed "s/^ \[//" | sed "s/\]$//")
39
+ export RUN_DEP_FILES=dev_requirements.txt
40
+
41
+ .print_debugging: &print_debugging |
42
+ python --version # Print out python version for debugging
43
+ pip --version # Show pip version for debugging
44
+ echo $PYTHONPATH
45
+ echo $PATH
46
+ echo BUILD_DEPS=$BUILD_DEPS
47
+ echo RUN_DEP_FILES=$RUN_DEP_FILES
48
+
49
+ # venv editable install
50
+ .install_venv_editable_template:
51
+ script:
52
+ - *collect_deps_manually
53
+ - *print_debugging
54
+ # Now we install dependencies manually
55
+ - pip install --upgrade $BUILD_DEPS # Install build deps manually
56
+ - python setup.py --version # Print setuptools found version
57
+ - python -m pip freeze > $PYTHONTOOLS_DIR/pre_install_packages.txt
58
+ - for file in $RUN_DEP_FILES; do echo Installing $file; pip install -r $file; done; # Install run deps manually
59
+ # Install from wheel
60
+ # Should install almost nothing, as we installed most of it ourselves
61
+ # Install without extras here. We installed these manually.
62
+ - pip install ---no-build-isolation --upgrade --editable . # Install local folder in editable mode
63
+ - pip freeze > $PYTHONTOOLS_DIR/post_install_packages.txt
64
+ # Do basic sanity checking
65
+ - mkdir tmp && cd tmp
66
+ - python -c "import $PACKAGE; print($PACKAGE.__version__); print($PACKAGE.__path__)" # Try regular import
67
+ # Run the real test, pytest
68
+ - which pytest
69
+ - pytest --version
70
+ - echo Running "pytest --cov=$PACKAGE --cov-report=term --cov-report=xml:$PYTHONTOOLS_DIR/coverage.xml --junit-xml=$PYTHONTOOLS_DIR/junit.xml --ignore=../tests/NNDB '"$PYTHONTOOLS_DIR"'"
71
+ - pytest --cov=$PACKAGE --cov-report=term --cov-report=xml:$PYTHONTOOLS_DIR/coverage.xml --junit-xml=$PYTHONTOOLS_DIR/junit.xml "$PYTHONTOOLS_DIR"
72
+ # One pipeline has one artifact. We need both the test report _and_ the installed packages to pass on
73
+ artifacts:
74
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
75
+ reports:
76
+ junit: [$PYTHONTOOLS_DIR/junit.xml]
77
+ cobertura: [$PYTHONTOOLS_DIR/coverage.xml]
78
+ when: always
79
+ expire_in: 1 day # These are only used in quick interactive CI debugging, and in next jobs
80
+ stage: test
81
+ cache:
82
+ <<: *cache_python
83
+ policy: push
84
+ needs: [] # Only needs a sane python env
85
+
86
+ # editable venv-like install
87
+ install_venv_editable:
88
+ extends: .install_venv_editable_template
89
+
90
+ flake8:
91
+ stage: test
92
+ before_script:
93
+ - pip install flake8 pyflakes anybadge
94
+ script:
95
+ - mkdir -p ./flake8
96
+ - flake8 --exit-zero --doctests --statistics --count $(find $PACKAGE -name '*.py') | tee flake8.txt
97
+ - PEP8_VIOLATIONS=$(tail flake8.txt -n1)
98
+ - echo "Flake8 finds $PEP8_VIOLATIONS PEP8 violations"
99
+ - anybadge -ou --label=flake8 --value=$PEP8_VIOLATIONS --file=flake8/flake8.svg -c silver
100
+ artifacts:
101
+ paths:
102
+ - ./flake8/
103
+
104
+ pylint:
105
+ stage: test
106
+ before_script:
107
+ - pip install pylint pylint-exit anybadge
108
+ script:
109
+ - mkdir -p ./pylint
110
+ - pylint --rcfile=.pylintrc --output-format=text src | tee ./pylint/pylint.log || pylint-exit $?
111
+ - PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
112
+ - echo "Pylint score is $PYLINT_SCORE"
113
+ - anybadge -ou --label=pylint --value=$PYLINT_SCORE --file=pylint/pylint.svg 2=red 4=orange 8=yellow 10=green
114
+ artifacts:
115
+ paths:
116
+ - ./pylint/
117
+
118
+ black:
119
+ stage: test
120
+ script:
121
+ - pip install black
122
+ - black --diff --color src
123
+
124
+ pages:
125
+ stage: doc
126
+ script:
127
+ - pip install -r dev_requirements.txt
128
+ - pip install --upgrade --editable .
129
+ - cd docs
130
+ - sphinx-apidoc -f -o sphinx -e -M ../src/simdb && rm sphinx/modules.rst
131
+ - cp *.md sphinx
132
+ - cp *.svg sphinx
133
+ - make clean
134
+ - make html
135
+ - mv _build/html/ ../public/
136
+ artifacts:
137
+ paths:
138
+ - public/
139
+ - docs/_build/
140
+ - docs/source/generated/
141
+ only:
142
+ - master
143
+ - /^release.*$/
144
+ - feature/ukaea-gitlab-ci
145
+ cache:
146
+ <<: *cache_python
147
+ policy: pull
148
+ needs: ["install_venv_editable"]
File without changes
@@ -0,0 +1,24 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: "ubuntu-22.04"
5
+ tools:
6
+ python: "3.11"
7
+ jobs:
8
+ post_checkout:
9
+ - git fetch --unshallow || true
10
+ - cp docs/*.md docs/sphinx/ || true
11
+ pre_build:
12
+ - cd docs && sphinx-apidoc -f -o sphinx -e -M ../src/simdb
13
+
14
+ python:
15
+ install:
16
+ - method: pip
17
+ path: .
18
+ extra_requirements:
19
+ - build-docs
20
+
21
+ sphinx:
22
+ builder: html
23
+ configuration: docs/sphinx/conf.py
24
+ fail_on_warning: false
@@ -0,0 +1,9 @@
1
+ FROM python:3.7
2
+ COPY ./ /tmp/simdb/
3
+ RUN cd /tmp/simdb/ && \
4
+ pip3 install . && \
5
+ pip3 install flask flask_caching flask_cors flask_restx gunicorn psycopg2-binary && \
6
+ rm -rf /tmp/simdb
7
+
8
+ ENTRYPOINT ["gunicorn", "--bind=0.0.0.0:5000", "--workers=1", "simdb.remote.wsgi:app"]
9
+ EXPOSE 5000
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: imas-simdb
3
+ Version: 0.13.0
4
+ Summary: ITER Simulation Management Tool
5
+ Author: ITER Organization
6
+ Author-email: imas-support@iter.org
7
+ Maintainer: ITER Organization
8
+ Maintainer-email: imas-support@iter.org
9
+ Project-URL: Homepage, https://simdb.iter.org/dashboard/
10
+ Project-URL: Documentation, https://sharepoint.iter.org/departments/POP/CM/IMDesign/Code%20Documentation/simdb-doc/html/index.html
11
+ Project-URL: Repository, https://git.iter.org/projects/IMEX/repos/simdb/browse
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Development Status :: 4 - Beta
20
+ Classifier: Topic :: Scientific/Engineering :: Physics
21
+ Classifier: Intended Audience :: Developers
22
+ Classifier: Intended Audience :: Science/Research
23
+ Classifier: Intended Audience :: System Administrators
24
+ Classifier: Natural Language :: English
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE.txt
27
+ Requires-Dist: Cerberus>=1.3.2
28
+ Requires-Dist: PyJWT>=1.4.0
29
+ Requires-Dist: appdirs>=1.4
30
+ Requires-Dist: appdirs>=1.4.0
31
+ Requires-Dist: argcomplete>=1.9.4
32
+ Requires-Dist: backports-datetime-fromisoformat>=1.0
33
+ Requires-Dist: click<=8.1.8,>=7.0
34
+ Requires-Dist: click_option_group>=0.5
35
+ Requires-Dist: distro>=1.8.0
36
+ Requires-Dist: email-validator>=1.1
37
+ Requires-Dist: numpy>=1.14
38
+ Requires-Dist: python-dateutil>=2.6
39
+ Requires-Dist: pyyaml>=3.13
40
+ Requires-Dist: requests>=2.27.0
41
+ Requires-Dist: semantic-version>=2.8
42
+ Requires-Dist: sqlalchemy<2.0,>=1.2.12
43
+ Requires-Dist: urllib3>=1.26
44
+ Provides-Extra: build-test
45
+ Requires-Dist: pytest>=6.0; extra == "build-test"
46
+ Requires-Dist: pytest-cov>=2.0; extra == "build-test"
47
+ Requires-Dist: mypy>=0.910; extra == "build-test"
48
+ Requires-Dist: flake8>=3.9; extra == "build-test"
49
+ Requires-Dist: tox>=3.24; extra == "build-test"
50
+ Requires-Dist: Flask>=2.0; extra == "build-test"
51
+ Requires-Dist: flask-cors>=3; extra == "build-test"
52
+ Requires-Dist: flask-compress>=1.12; extra == "build-test"
53
+ Requires-Dist: Werkzeug==2.0.3; extra == "build-test"
54
+ Requires-Dist: python-magic~=0.4; extra == "build-test"
55
+ Requires-Dist: flask-caching>=1.10; extra == "build-test"
56
+ Requires-Dist: flask-restx==0.5; extra == "build-test"
57
+ Requires-Dist: flask-mail~=0.9.1; extra == "build-test"
58
+ Requires-Dist: simplejson~=3.0; extra == "build-test"
59
+ Requires-Dist: easyad>=1.0; extra == "build-test"
60
+ Provides-Extra: server
61
+ Requires-Dist: Flask>=2.0; extra == "server"
62
+ Requires-Dist: Werkzeug==2.0.3; extra == "server"
63
+ Requires-Dist: flask-caching>=1.10; extra == "server"
64
+ Requires-Dist: flask-compress>=1.12; extra == "server"
65
+ Requires-Dist: flask-cors>=3; extra == "server"
66
+ Requires-Dist: flask-mail~=0.9.1; extra == "server"
67
+ Requires-Dist: flask-restx==0.5; extra == "server"
68
+ Requires-Dist: python-magic~=0.4; extra == "server"
69
+ Requires-Dist: simplejson~=3.0; extra == "server"
70
+ Provides-Extra: auth-ad
71
+ Requires-Dist: easyad>=1.0; extra == "auth-ad"
72
+ Provides-Extra: auth-keycloak
73
+ Requires-Dist: python-keycloak>=4.0; extra == "auth-keycloak"
74
+ Provides-Extra: auth-ldap
75
+ Requires-Dist: python-ldap>=3.4; extra == "auth-ldap"
76
+ Provides-Extra: imas-validator
77
+ Requires-Dist: imas-validator>=1.0.0; extra == "imas-validator"
78
+ Provides-Extra: build-docs
79
+ Requires-Dist: sphinx>=4.5; extra == "build-docs"
80
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "build-docs"
81
+ Requires-Dist: sphinx-autodoc-typehints>=1.12.0; extra == "build-docs"
82
+ Requires-Dist: myst-parser>=0.18.0; extra == "build-docs"
83
+ Requires-Dist: nbsphinx>=0.8.0; extra == "build-docs"
84
+ Requires-Dist: docutils>=0.17; extra == "build-docs"
85
+ Requires-Dist: recommonmark>=0.7.0; extra == "build-docs"
86
+ Provides-Extra: postgres
87
+ Requires-Dist: psycopg2-binary>=2.8.0; extra == "postgres"
88
+ Provides-Extra: all
89
+ Requires-Dist: simdb[imas-validator,postgres,server]; extra == "all"
90
+ Dynamic: license-file
91
+
92
+ # SimDB simulation management tool
93
+
94
+ SimDB is a tool designed to track, manage, upload and query simulations. The simulation data can be tagged with metadata, managed locally or transferred to remote SimDB services. Uploaded simulations can then be queried based on metadata.
95
+
96
+ ## Command line interface
97
+
98
+ SimDB consists of a command line interface (CLI) tool which interacts with one or more remote services.
99
+
100
+ For details on how to install the CLI see [here](docs/install_guide.md) and for information on how to use the CLI see [here](docs/user_guide.md).
101
+
102
+ ### Accessing ITER remotes
103
+
104
+ To access data from the ITER remotes from outside of the ITER systems you'll need to [add and configure a SimDB remote](docs/iter_remotes.md).
105
+
106
+ ### Installing ITER certificate
107
+
108
+ To access the ITER remote from within the ITER systems you will need to install the ITER SSL certificate. Details for how to do this can be found [here](docs/iter_certificate.md).
109
+
110
+ ## Server setup
111
+
112
+ For information on setting and maintaining a remote CLI server see [here](docs/maintenance_guide.md).
113
+
114
+ ## Developer guide
115
+
116
+ Information about setting up a developer environment can be found [here](docs/developer_guide.md).