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

PDS DOI Service Dockerization #185

Merged
merged 9 commits into from
Apr 21, 2021
Merged

PDS DOI Service Dockerization #185

merged 9 commits into from
Apr 21, 2021

Conversation

collinss-jpl
Copy link
Contributor

Summary
This PR adds the configuration files and code updates to support containerization of the PDS DOI Service via Docker.

A Docker image can now be built for the DOI service by running docker build --tag pds-doi-service . from the root of the repo. The container can be launched via docker-compose up. The API can then be reached via localhost:8080/PDS_APIs/pds_doi_api/0.1/ui/ as usual.

To support injection of configuration parameters, such as OSTI credentials, a doi_service.env file is utilized from within the docker-compose.yml to pass in options as environment variables. The INI config parser used by the DOI Service has also been modified to search the environment for expected options before falling back to what is in the INI.

Test Data and/or Report
A unit test has been added for the new config parsing behavior.
test.txt

Related Issues

Scott Collins added 9 commits April 13, 2021 11:56
…arsed as XML during a draft POST request and cause an error

JSON is now explicitly checked for when providing a requestBody for draft actions, and an exception is raised if present
…containerized context

The parser instance created by DOIConfigUtil.get_config() is now cached (memorized) to prevent redundant processing of the INI.
The config parser instance itself is now a specialized version of ConfigParser designed to prioritize expected environment variables over the INI values.
This allows configuration options to be easily injected into the service when launching via Docker.
Copy link
Member

@nutjob4life nutjob4life left a comment

Choose a reason for hiding this comment

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

This looks pretty snazzy to me. +1. I say 🚢 it. What say you @tloubrieu-jpl?

@jordanpadams jordanpadams merged commit a60bb99 into master Apr 21, 2021
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.

Dockerize API Service
3 participants