-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add DSpace submit functionality #13
Conversation
Why these changes are being introduced: The core functionality of this app is to create new items with associated bitstreams in DSpace based on the messages retrieved from an input SQS queue. This commit adds the functionality to do so, along with some necessary functionality around configuration and secrets handling. How this addresses that need: * Adds a submission module with a Submission class that can be instantiated from an SQS message, with methods to facilitate creating a DSpace item with bitstreams and generating both success and error result messages * Updates the sqs module process function to use the new submission module * Adds an smm module with an SSM class that handles retrieving secrets from AWS Systems Manager Parameter Store * Adds a config module that configures the application based on env (set by the WORKSPACE env variable) * Adds and updates relevant tests, including adding a conftest.py and fixtures * Updates Dockerfile and setup.py to reflect new dependencies Additional changes in this commit: * Adds logging throughout the app with logging configuration set by the root logger * Adds pytest-cov and updates make test command to create a coverage report * Updates .gitignore Side effects of this change: * For the app to work in staging and production environments, the WORKSPACE and SSM_PATH env variables must be set and the application must have an IAM role with access to SSM. This has been handled in a separate ticket, just noting it here (also added this info to the README). Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/ETD-398 * https://mitlibraries.atlassian.net/browse/ETD-407
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my... lots of stuff going on here :)
Firstly, nothing blocking feel free to merge whenever. A few questions and comments and requests for Jira tickets along the way. I didn't run this locally as I felt we'd get enough opportunities to confirm it actually works as we run through tests on staging (and the local setup is a pain until I land my secret branch I never bothered to finish because reasons).
I did. So at least there's that ¯_(ツ)_/¯ |
Why these changes are being introduced:
The core functionality of this app is to create new items with associated bitstreams in DSpace based on the messages retrieved from an input SQS queue. This commit adds the functionality to do so, along with some necessary functionality around configuration and secrets handling.
How this addresses that need:
Additional changes in this commit:
Side effects of this change:
Includes new or updated dependencies?
YES
Changes expectations for external applications?
NO
Developer
How can a reviewer manually see the effects of these changes?
It's a process, but:
DSS_INPUT_QUEUE
to whatever the input queue name is.input_message_good
fixture inconftest.py
for an example (but note you'll need to change things like the collection handle and the output queue name).DSPACE_API_URL=<dspace test instance API url>
DSPACE_USER=<a user with write access to a DSpace collection>
DSPACE_PASSWORD=<that user's password>
sqs.py
retrieve
andwrite
functions tosqs = boto3.resource("sqs", endpoint="<whatever your localhost moto server endpoint is>")
so the app will read and write to the local SQS queues and not real AWS.pipenv run submitter start
and watch the app process the message, post the item to DSpace, and send the result message to the output queue.Code Reviewer
(not just this pull request message)