Skip to content

Commit 94bb8e4

Browse files
CasperWATEAM4-0
authored andcommitted
Compound updates to use OTEAPI Core v1 (#597)
* Implement changes from external fork - Drop Python 3.9 support (now using Python 3.10). - Replace pylint+isort with ruff. - Add markdownlintcli2 and blacken-docs dev tools. - Move AppSettings to a separate module and expand it slightly. - Create a logging module to instantiate logging. - Add introspective endpoints under a new 'admin' group of routers. The redis admin router has been moved under this admin group of routers. - Update invoke tasks to drop dulwich dependency. - Upgrade tests and fixtures to support testing the introspective endpoint. - Test the introspective endpoint. - Remove usage of the permanent dependencies branch ci/dependabot-updates. - Update the CI/CD workflows to better test the docker file. Furthermore, update to use the non-dev version of OTEAPI Core. * Update to OTEAPI Core v1 Update setup of tests and tasks Stop using dulwich Update docker compose files Update the special CI plugins docker compose file for running the docker compose CI tests. Co-authored-by: Thomas Hagelien<on.liamg@gmail.com>
1 parent 55b4ff9 commit 94bb8e4

73 files changed

Lines changed: 1803 additions & 1177 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dev/requirements_ci.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
pre-commit~=4.2
12
safety~=3.2

.dev/requirements_dev.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
dulwich~=0.22.8
21
debugpy>=1.8.0
32
fakeredis~=2.28
43
httpx~=0.28.1
54
invoke~=2.2
65
pre-commit~=4.2
7-
pylint~=3.3
86
pytest~=8.3
97
pytest-cov~=6.1
108

@@ -15,4 +13,4 @@ pytest-cov~=6.1
1513
# version listed in `requirements.txt`. This is accepted for the moment, but should
1614
# be followed up.
1715

18-
# Note, the minimum supported Python version is expected to be Python 3.9.
16+
# Note, the minimum supported Python version is expected to be Python 3.10.

.dev/requirements_release.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
invoke~=2.2
2+
pre-commit~=4.2

.github/dependabot.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,25 @@ updates:
99
interval: weekly
1010
day: monday
1111
time: "05:18"
12-
# Should be bigger than or equal to the total number of dependencies (currently 5)
13-
open-pull-requests-limit: 10
14-
target-branch: ci/dependabot-updates
12+
target-branch: master
1513
labels:
1614
- CI/CD
15+
- skip-changelog
16+
groups:
17+
packages:
18+
applies-to: version-updates
19+
patterns: ["*"]
20+
security:
21+
applies-to: security-updates
22+
patterns: ["*"]
1723

1824
# Run dependabot for all GitHub Actions
1925
- package-ecosystem: github-actions
2026
directory: "/"
2127
schedule:
2228
interval: daily
2329
time: "05:24"
24-
target-branch: ci/dependabot-updates
30+
target-branch: master
2531
labels:
2632
- CI/CD
33+
- skip-changelog

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Description:
1+
# Description
22
<!-- Summary of change, including the issue to be addressed. -->
33

4-
## Type of change:
4+
## Type of change
55
<!-- Put an `x` in the box that applies. -->
66
- [ ] Bug fix.
77
- [ ] New feature.
88
- [ ] Documentation update.
99

10-
## Checklist for the reviewer:
10+
## Checklist for the reviewer
1111
<!-- Put an `x` in the boxes that apply. These can be filled by reviewer after the PR is created. -->
1212

1313
This checklist should be used as a help for the reviewer.

.github/utils/docker-compose_ci_plugins.yml renamed to .github/utils/compose.ci_plugins.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
version: "3.3"
2-
31
services:
42
oteapi:
53
build:
64
context: "../../"
75
target: "${DOCKER_OTEAPI_TARGET:-development}"
6+
additional_contexts:
7+
# These can be changed to point to local directories or similar
8+
oteapi-core: "${OTEAPI_CORE_PATH:-https://github.com/EMMC-ASBL/oteapi-core.git}"
89
ports:
9-
- "${PORT:-8080}:8080"
10+
- "${OTEAPI_PORT:-8080}:8080"
1011
- "5678:5678" # Debug port
1112
environment:
1213
OTEAPI_REDIS_TYPE: redis
1314
OTEAPI_REDIS_HOST: redis
1415
OTEAPI_REDIS_PORT: 6379
15-
OTEAPI_prefix: "${OTEAPI_prefix:-/api/v1}"
16+
OTEAPI_PREFIX: "${OTEAPI_PREFIX:-/api/v1}"
1617
OTEAPI_INCLUDE_REDISADMIN: "${OTEAPI_INCLUDE_REDISADMIN:-True}"
1718
OTEAPI_EXPOSE_SECRETS: "${OTEAPI_EXPOSE_SECRETS:-True}"
18-
PATH_TO_OTEAPI_CORE: "${PATH_TO_OTEAPI_CORE:-/dev/null}"
1919
OTEAPI_PLUGIN_PACKAGES:
2020
OTEAPI_AUTHENTICATION_DEPENDENCIES:
2121
CI:
22+
volumes:
23+
- "${OTEAPI_CORE_PATH:-/dev/null}:${CONTAINER_PLUGIN_PATH:-/dev/null}"
2224
depends_on:
2325
- redis
2426
networks:
2527
- otenet
26-
volumes:
27-
- "${LOCAL_TARGET_PLUGIN_PATH:-/dev/null}:${CONTAINER_PLUGIN_PATH:-/dev/null}"
28-
- "${PATH_TO_OTEAPI_CORE:-/dev/null}:/oteapi_core"
2928

3029
redis:
3130
image: redis:latest
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
fastapi-slim>=0.115.12
2-
hypercorn>=0.14.4
3-
oteapi-core>=0.7.0
4-
pydantic>=2.11.3
2+
hypercorn>=0.17.3
3+
oteapi-core>=1.0.0
4+
pydantic>=2.11.2
55
pydantic-settings>=2.8.1
66
redis>=5.2.1
77
tenacity>=9.1.2
8-
urllib3<2 # Ensure allegrograph works as intended

.github/workflows/cd_release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CD - Release
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
env:
10+
GIT_USER_NAME: "TEAM 4.0[bot]"
11+
GIT_USER_EMAIL: "Team4.0@SINTEF.no"
12+
DEFAULT_REPO_BRANCH: master
13+
14+
jobs:
15+
update_version:
16+
name: Update the version
17+
if: github.repository_owner == 'EMMC-ASBL'
18+
runs-on: ubuntu-latest
19+
outputs:
20+
continue_workflow: ${{ steps.update_version_step.outputs.continue_workflow }}
21+
22+
permissions:
23+
contents: write
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Set up git config
32+
run: |
33+
git config --global user.name "${{ env.GIT_USER_NAME }}"
34+
git config --global user.email "${{ env.GIT_USER_EMAIL }}"
35+
36+
- name: Set up Python 3.10
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: "3.10"
40+
41+
- name: Install Python dependencies
42+
run: |
43+
python -m pip install -U pip
44+
pip install -U setuptools wheel
45+
pip install -U -r .dev/requirements_release.txt
46+
47+
- name: Update version
48+
id: update_version_step
49+
run: |
50+
invoke setver
51+
52+
if [ -n "$(git status --porcelain app/__init__.py)" ]; then
53+
echo "Version updated !"
54+
CONTINUE_WORKFLOW=true
55+
else
56+
# The version has not changed - i.e. the workflow shouldn't continue.
57+
echo "Version NOT updated !"
58+
CONTINUE_WORKFLOW=false
59+
fi
60+
61+
echo "continue_workflow=${CONTINUE_WORKFLOW}" >> $GITHUB_OUTPUT
62+
63+
- name: Update changelog
64+
if: steps.update_version_step.outputs.continue_workflow == 'true'
65+
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
66+
with:
67+
args: --user "${{ github.repository_owner }}" --project "oteapi-services" --token "${{ secrets.RELEASE_PAT }}" --release-branch "${{ env.DEFAULT_REPO_BRANCH }}" --exclude-labels "skip-changelog,duplicate,question,invalid,wontfix"
68+
69+
- name: Commit changes
70+
if: steps.update_version_step.outputs.continue_workflow == 'true'
71+
run: |
72+
git add app/__init__.py CHANGELOG.md
73+
git commit --amend -C HEAD
74+
75+
- name: Update '${{ env.DEFAULT_REPO_BRANCH }}'
76+
if: steps.update_version_step.outputs.continue_workflow == 'true'
77+
uses: CasperWA/push-protected@v2
78+
with:
79+
token: ${{ secrets.RELEASE_PAT }}
80+
branch: ${{ env.DEFAULT_REPO_BRANCH }}
81+
sleep: 15
82+
force: true
83+
unprotect_reviews: false
84+
85+
publish_container_image:
86+
name: Publish Container image on GH Packages
87+
needs: update_version
88+
if: github.repository_owner == 'EMMC-ASBL' && needs.update_version.outputs.continue_workflow == 'true'
89+
uses: ./.github/workflows/ci_cd_docker.yml
90+
with:
91+
source_ref: 'master' # Must match DEFAULT_REPO_BRANCH - env context not available here
92+
image_name: oteapi
93+
image_owner: emmc-asbl
94+
registry_url: ghcr.io
95+
secrets:
96+
REGISTRY_USER: TEAM4-0
97+
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
98+
PAT: ${{ secrets.RELEASE_PAT }}
99+
100+
permissions:
101+
packages: write
102+
contents: read

.github/workflows/ci_automerge_dependabot.yml renamed to .github/workflows/ci_automerge_bot_prs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: CI - Activate auto-merging for Dependabot PRs
1+
name: CI - Activate auto-merging for BOT PRs
22

33
on:
44
pull_request_target:
5-
branches: [ci/dependabot-updates]
5+
branches: [master]
66

77
jobs:
88
update-dependabot-branch:

0 commit comments

Comments
 (0)