Skip to content

Commit

Permalink
Merge branch 'main' into jeremy/refactor-dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyestein committed Dec 18, 2024
2 parents 3b0bac0 + 6435ebb commit 418579a
Show file tree
Hide file tree
Showing 160 changed files with 9,376 additions and 2,953 deletions.
36 changes: 17 additions & 19 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
DEBUG=True
PIXL_DICOM_TRANSFER_TIMEOUT=120
PIXL_QUERY_TIMEOUT=120
PIXL_DICOM_TRANSFER_TIMEOUT=240
PIXL_QUERY_TIMEOUT=10
CLI_RETRY_SECONDS=300

# PIXL PostgreSQL instance
PIXL_DB_HOST=postgres
Expand All @@ -9,14 +10,6 @@ PIXL_DB_USER=pixl
PIXL_DB_PASSWORD=
SKIP_ALEMBIC=false

# EMAP UDS
EMAP_UDS_HOST=
EMAP_UDS_PORT=
EMAP_UDS_NAME=
EMAP_UDS_USER=
EMAP_UDS_PASSWORD=
EMAP_UDS_SCHEMA_NAME=

# Exposed ports
HASHER_API_PORT=
POSTGRES_PORT=
Expand Down Expand Up @@ -52,11 +45,12 @@ ORTHANC_RAW_AE_TITLE=
ORTHANC_AUTOROUTE_RAW_TO_ANON=true
ORTHANC_RAW_MAXIMUM_STORAGE_SIZE= // MB
ORTHANC_RAW_JOB_HISTORY_SIZE=100
ORTHANC_RAW_CONCURRENT_JOBS=5
ORTHANC_CONCURRENT_JOBS=20
ORTHANC_RAW_RECORD_HEADERS=
ORTHANC_RAW_HEADER_LOG_PATH=

# PIXL Orthanc anon instance
ORTHANC_ANON_URL=http://orthanc-anon:8042
ORTHANC_ANON_USERNAME=
ORTHANC_ANON_PASSWORD=
ORTHANC_ANON_AE_TITLE=
Expand All @@ -67,11 +61,17 @@ STUDY_TIME_OFFSET=
LOCAL_SALT_VALUE=PIXL


# UCVNAQR DICOM node information
VNAQR_AE_TITLE=
VNAQR_DICOM_PORT=
VNAQR_IP_ADDR=
VNAQR_MODALITY=UCVNAQR
# UCPRIMARYQR DICOM node information
PRIMARY_DICOM_SOURCE_AE_TITLE=
PRIMARY_DICOM_SOURCE_PORT=
PRIMARY_DICOM_SOURCE_IP_ADDR=
PRIMARY_DICOM_SOURCE_MODALITY=UCPRIMARYQR

# UCSECONDARYQR DICOM node information - commented out vars are optional
#SECONDARY_DICOM_SOURCE_AE_TITLE=
#SECONDARY_DICOM_SOURCE_PORT=
#SECONDARY_DICOM_SOURCE_IP_ADDR=
SECONDARY_DICOM_SOURCE_MODALITY=UCSECONDARYQR

# DICOMweb endpoint
AZ_DICOM_ENDPOINT_NAME=
Expand All @@ -88,9 +88,7 @@ RABBITMQ_USERNAME=
RABBITMQ_PASSWORD=

# Imaging extraction API
PIXL_DICOM_TRANSFER_TIMEOUT=240
PIXL_QUERY_TIMEOUT=10
PIXL_MAX_MESSAGES_IN_FLIGHT=50
PIXL_MAX_MESSAGES_IN_FLIGHT=5

# Project configs directory
PROJECT_CONFIGS_DIR=projects/configs
Expand Down
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) University College London Hospitals NHS Foundation Trust
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Bug Report
description: Have you got a bug? Please report it here!
projects: [ "SAFEHR-data/13" ]
body:
- type: markdown
attributes:
value: |
A clear and concise description of what the bug is. Please use a short, concise title for the bug and elaborate here
- type: textarea
id: actual_behaviour
attributes:
label: What happened?
description: A clear and concise description of what actually happens.
placeholder: "If you have a code sample, error messages, stack traces, please provide it here as well"
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output (optional)
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
validations:
required: false
- type: textarea
id: expected_behaviour
attributes:
label: What did you expect? (optional)
description: A clear and concise description of what you expected to happen.
validations:
required: false
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright (c) University College London Hospitals NHS Foundation Trust
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Feature Request
description: Submit a proposal/request for a new feature
projects: [ "SAFEHR-data/13" ]
body:
- type: markdown
attributes:
value: |
A clear and concise description of the feature proposal
- type: textarea
id: motivation
attributes:
label: Motivation
description: Please outline the motivation for the proposal.
placeholder: "Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too"
validations:
required: true
- type: textarea
id: pitch
attributes:
label: Pitch
description: A clear and concise description of what you want to happen.
validations:
required: false
- type: textarea
id: alternatives
attributes:
label: Alternatives
description: A clear and concise description of any alternative solutions or features you've considered, if any.
placeholder:
validations:
required: false
- type: textarea
id: additional_context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/voxl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
name: VOXL story
description: Create a new story or task for VOXL
projects: [ "UCLH-Foundry/13" ]
projects: [ "SAFEHR-data/13" ]
body:
- type: markdown
attributes:
Expand Down
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Replace {issue_number} with the issue that will be closed after merging this PR -->
## Description
Fixes #{issue_number}: A few words or sentences describing the changes proposed in this pull request (PR).

## Type of change
Please delete options accordingly to the description.

<!-- Write an `x` in all the boxes that apply -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update


### Suggested Checklist
<!-- You do not need to complete all the items by the time you submit the pull request, but most likely the changes will only be merged if all the tasks are done. -->

<!-- Write an `x` in all the boxes that apply -->
- [ ] I have performed a self-review of my own code.
- [ ] I have made corresponding changes to the documentation.
- [ ] My changes generate no new warnings.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have passed on my local host device. (see further details at the [CONTRIBUTING](https://github.com/SAFEHR-data/PIXL/blob/main/CONTRIBUTING.md#local-testing) document)
- [ ] Make sure your branch is up-to-date with main branch. See [CONTRIBUTING](https://github.com/SAFEHR-data/PIXL/blob/main/CONTRIBUTING.md) for a general example to syncronise your branch with the `main` branch.
- [ ] I have requested review to this PR.
- [ ] I have addressed and marked as resolved all the review comments in my PR.
- [ ] Finally, I have selected `squash and merge`

68 changes: 50 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
push:
branches:
- main
- "renovate/**"
pull_request:
workflow_dispatch:

Expand All @@ -27,14 +28,14 @@ concurrency:

jobs:
lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Run pre-commit
uses: pre-commit/[email protected]
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: --all-files

Expand All @@ -45,18 +46,18 @@ jobs:
docker compose config --quiet
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false # run all tests if even if one fails
matrix:
package_dir: [pixl_core, hasher, pixl_dcmd, cli, pixl_export, pixl_imaging]
package_dir: [pixl_core, hasher, pixl_dcmd, cli, pixl_export, pixl_imaging, pytest-pixl]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Init Python
uses: actions/setup-python@v5
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: "3.11"
cache: "pip"
Expand All @@ -70,28 +71,28 @@ jobs:
- name: Run tests and generate coverage report
working-directory: ${{ matrix.package_dir }}
run: pytest --cov --cov-report=xml
run: COV_CORE_SOURCE=src COV_CORE_CONFIG=.coveragerc COV_CORE_DATAFILE=.coverage.eager pytest --cov=src --cov-append --cov-report=xml --cov-report=term-missing
env:
ENV: test
AZURE_KEY_VAULT_NAME: test
AZURE_KEY_VAULT_SECRET_NAME: test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.2.0
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
directory: ${{ matrix.package_dir }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

system-test:
if: ${{ ! github.event.pull_request.draft || contains(github.event.pull_request.title, '[force-system-test]') }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
- name: Init Python
uses: actions/setup-python@v5
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: "3.11"
cache: "pip"
Expand Down Expand Up @@ -131,23 +132,54 @@ jobs:
./run-system-test.sh coverage
echo FINISHED SYSTEM TEST SCRIPT
- name: Dump export-api docker logs for debugging
- name: Dump queue docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-export-api-1 2>&1
docker logs -t system-test-queue-1 2>&1
- name: Dump orthanc-anon docker logs for debugging
- name: Dump postgres docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-orthanc-anon-1 2>&1
docker logs -t system-test-postgres-1 2>&1
- name: Dump imaging-api docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-imaging-api-1 2>&1
- name: Dump orthanc-raw docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-orthanc-raw-1 2>&1
- name: Dump orthanc-anon docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-orthanc-anon-1 2>&1
- name: Dump hasher-api docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-hasher-api-1 2>&1
- name: Dump export-api docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-export-api-1 2>&1
- name: Dump VNA docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-vna-qr-1 2>&1
- name: Dump DICOMWeb docker logs for debugging
if: ${{ failure() }}
run: |
docker logs -t system-test-dicomweb-server-1 2>&1
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.2.0
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
directory: test
env:
Expand Down
15 changes: 12 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,37 @@
---
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
rev: v0.5.5
hooks:
- id: ruff-format
- id: ruff
args:
- --fix

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.11.1
hooks:
- id: mypy
entry: mypy .
args: [--config-file=mypy.ini]
pass_filenames: false
additional_dependencies:
[
"mypy==1.9.0",
"mypy==1.11.1",
"types-PyYAML",
"types-requests",
"types-python-slugify",
"types-psycopg2",
]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
hooks:
# Schemas taken from https://www.schemastore.org/json/
- id: check-jsonschema
name: "Validate GitHub issue templates"
files: ^\.github/ISSUE_TEMPLATE/.*\.yml$
exclude: ^\.github/ISSUE_TEMPLATE/config\.yml$
args: ["--verbose", "--schemafile", "schemas/github-issue-forms.json"]

- repo: local
hooks:
Expand Down
Loading

0 comments on commit 418579a

Please sign in to comment.