-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FTPS server to system test and test successful upload (#268)
* Update `pixl_ehr` README, not actually using cogstack Docker service * Move cogstack dummy service to subdirectory * Move ftp-server to `test/dummy-services` * Add ftp-server to system-test docker compose * Add `SendViaFTPS` to `OnChange` callback for `orthanc-anon` * Check FTPS upload in system test * Fix `check_ftps_upload` and log expected export files * Trigger system test on CI * Typo fix Co-authored-by: Peter Tsrunchev <[email protected]> * Rename endpoint uploading env variable and set default to `false` * Remove type annotations for `OnChange` again * Fix `glob_list` creation Co-authored-by: Jeremy Stein <[email protected]> * Make container naming consistent * Rename mount data env variable and expand it * Print uploaded files instead of logging * Hardcode project name slug * Disable Azure related code in `orthanc-anon` plugin if no Azure available * fix: get the correct pseudo-anon ID before sending via FTPS * Add missing env variables * fix: check for env var correctly * More bug fixes * More consistent naming of env variable * Rename query helper function * Make helper functions snakecase * Also update the `.env` files * Make orthanc plugin code more type safe and system exit when query fails * More type safety * Define the `FTP_PORT` environment variable * Document the FTPS server requirements Should have done this way earlier! * Markdown formatting * Fix FTP config * Add more FTP logging * Allow python 11 for CLI * Ignore new data mount location * Allow system tests to pass * DEBUG: check ftp logs * Poll for two minutes instead of hardcoded wait * Poll for two minutes instead of hardcoded wait * More debugging * Reorder system test scripts * For arguments sake, try polling for images for 4 minutes * Increase timeout * Use logger rather than logging directly * Increase timeout * Add comment about number of expected studies * Clean up ftp output directory after check * Actually wait for the desired number of seconds * Empty-Commit to test building * Fix CI for ftps upload * Remove logs check * Reorder system tests to make parquet upload export testing easier * Empty-Commit to test building * Wait until there are two exported DICOM messages In case we hit CI when there is only one * Document FTPS server specifics * Try to make ftp server more robust in CI * Copy certs into dockerfile instead of mounting Could this fix our volume error? Who knows * Copy certs into dockerfile instead of mounting Could this fix our volume error? Who knows * Update core test compose file too * Put "when" and "then" statements on their own lines * docs: SSL certificates are now copied instead of mounted --------- Co-authored-by: Peter Tsrunchev <[email protected]> Co-authored-by: Jeremy Stein <[email protected]> Co-authored-by: Stef Piatek <[email protected]>
- Loading branch information
1 parent
82e4738
commit 428c3a5
Showing
25 changed files
with
364 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# FTPS server | ||
|
||
Currently, we can only upload files to the Data Safe Haven (DSH) through an | ||
[FTPS](https://en.wikipedia.org/wiki/FTPS) connection. | ||
|
||
The [`core.upload`](../../pixl_core/src/core/upload.py) module implements functionality to upload | ||
DICOM tags and parquet files to an **FTPS server**. This requires the following environment | ||
variables to be set: | ||
|
||
- `FTP_HOST`: URL to the FTPS server | ||
- `FTP_PORT`: port on which the FTPS server is listening | ||
- `FTP_USER_NAME`: name of user with access to the FTPS server | ||
- `FTP_USER_PASSWORD`: password for the authorised user | ||
|
||
We provide mock values for these for the unit tests (see | ||
[`./tests/conftest.py`](./tests/conftest.py)). When running in production, these should be defined | ||
in the `.env` file (see [the example](../.env.sample)). | ||
|
||
For the `pixl_core` unit tests and the system test, we spin up an FTPS server with a Docker | ||
container, defined in [`test/dummy-services/ftp-server`](../../test/dummy-services/ftp-server/) and | ||
set the necessary environment variables in [`.env.test`](../../test/.env.test). | ||
|
||
## FTPS test server | ||
|
||
We provide a Docker container to spin up a test FTPS server. The documentation for this can be found | ||
in [`test/README.md`](../../test/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.