Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Service - Update Documenation and Verify Temp Storage #59

Merged
merged 12 commits into from
Sep 18, 2023

Conversation

tsande16
Copy link
Contributor

@tsande16 tsande16 commented Sep 12, 2023

  • README needs to make clear the role of PASS_CORE_FILE_SERVICE_ROOT_DIR when configured to use S3.
  • In staging the name of the directory should default to the OS generated name and not the name of the variable itself.
  • Verify that the temp storage is being cleaned up when configured using S3
  • Verify that if PASS_CORE_FILE_SERVICE_ROOT_DIR is configured with a bucket name that it continues to work correctly using the temp directories. NOTE: This is no longer valid. PASS_CORE_FILE_SERVICE_ROOT_DIR must be a valid path on the local file system or attached file/network storage that is accessible by a path on the OS.

Things to note:

  • Recognition of the behavior of the FileService and how PASS_CORE_FILE_SERVICE_ROOT_DIR is supposed to be used is noted in the README
  • New test was created to test that the temp directory is cleaned up after a file is uploaded.

To Test:
Mvn verify

To check that files are uploaded, they are logged in the logs:
Example:

INFO o.e.p.f.s.storage.FileStorageService.storeFile - File Service: File with ID 469d149c-df88-4baa-b7a2-793ba6d91ce0/Nanometer-Scale Thermometry.pdf was stored in the file system repo at the location:C:\Users\tsande16\AppData\Local\Temp\1944912672741001035\ocfl\211\b3c\73a\211b3c73a7aaf393803607b3be9710a16169e89375a0eac1648feff7e4aa9173\v1\content\469d149c-df88-4baa-b7a2-793ba6d91ce0.pdf

To check your temp, the location is logged here:
14-09-2023 11:38:49.362 [main] [pass-core, ] INFO o.e.p.f.s.storage.FileStorageService.<init> - File Service: C:\Users\tsande16\AppData\Local\Temp\1944912672741001035 Storage Root Directory

I also tested locally running the jar and checking my local file system to ensure that the temp directory was being cleaned up after uploading files. I also tested in docker by running docker-compose up -d and uploading files there and checking the /tmp directory to ensure that was being cleaned up as well. Also to ensure that PASS_CORE_FILE_SERVICE_ROOT_DIR wasn't being created as a temp directory I grepped the filesystem in docker.

…yaml

- Update the README to be more clear about role of PASS_CORE_FILE_SERVICE_ROOT_DIR
@tsande16 tsande16 self-assigned this Sep 12, 2023
@tsande16 tsande16 marked this pull request as draft September 12, 2023 14:04
@tsande16 tsande16 marked this pull request as ready for review September 14, 2023 15:28
Copy link
Contributor

@markpatton markpatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good and tests pass for me locally.

@tsande16 tsande16 merged commit 291eb47 into main Sep 18, 2023
2 checks passed
@tsande16 tsande16 deleted the 687-file-service-update-doc-verify-temp branch September 18, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File Service - Update Documenation and Verify Temp Storage
2 participants