From c5decb2d1a71ae976e59d8d49825b6cf45327296 Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Fri, 5 Aug 2022 10:35:14 -0500 Subject: [PATCH 01/12] Add PR template (#119) * Add PR template * remove unnecessary test configuration inputs --- .github/pull_request_template.md | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..8575e3b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,37 @@ +# Description + +Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +## Type of change + +Please delete options that are not relevant. + +- [ ] 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 + +# How Has This Been Tested? + +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration + +- [ ] Test A +- [ ] Test B + +**Test Configuration**: +* Toolchain: +* SDK: + +# Checklist: + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged and published in downstream modules + From c73dcdedf2a18696742ac9ef030db39dd2fc884c Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Fri, 5 Aug 2022 10:35:33 -0500 Subject: [PATCH 02/12] Add issue templates (#118) * Update issue templates * remove assignees field from issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 37 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 19 ++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..ad553f4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,37 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..a27874f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 083d028ba048b81a6b2e128c524b939d4ca0412d Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Wed, 10 Aug 2022 08:31:08 -0500 Subject: [PATCH 03/12] Standardize the multiple forms of gitignore --- .gitignore | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 91365cb..2bf65cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,34 @@ -.apt_generated/ +# Java project type gitignore + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +# Docker gitignore + +# Application specific gitignore +# Maven target/ -.DS_Store -.classpath -.factorypath -.project -.settings -.springBeans -*.log* -bin/ + logs/ -dump.rdb \ No newline at end of file From ca2189ed93178b5efc21bfd22c6079c2e51aac3d Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Wed, 10 Aug 2022 16:09:47 -0500 Subject: [PATCH 04/12] update contributing, replace deploying, update license and readme --- CONTRIBUTING.md | 86 +++++++++++++++---------------- DEPLOYING.md | 129 +++++++++++----------------------------------- DEPLOYMENT.md | 120 +++++++++++++++++++++++++++++++++++++++++++ LICENSE | 23 ++------- README.md | 133 +++++++++++++++++++++++++++++++++++------------- 5 files changed, 295 insertions(+), 196 deletions(-) create mode 100644 DEPLOYMENT.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0e0915..aa72e13 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,69 +1,63 @@ -# Contributing To IR IIIF Service + +# Contributing To IRIIIFService -Though IR IIIF Service is developed and maintained by Texas A&M University Libraries, we welcome community contributions. Involvement in IR IIIF Service can take many forms: +Though IRIIIFService is developed and maintained by Texas A&M University Libraries, we welcome community contributions. +Involvement in IRIIIFService can take many forms: -#### Using IR IIIF Service +
(back to top)
-Deploying IR IIIF Service and trying it out at your own institution is itself a way of contributing to the development process. For more information on deployment strategies please see the [relevant documentation](https://github.com/TAMULib/IRIIIFService/blob/master/README.md). +## Using -#### Filing Issues +Deploying IRIIIFService and trying it out at your own institution is itself a way of contributing to the development process. +For more information on deployment strategies please see the [Deployment Guide][deployment-guide]. -Once you are using IR IIIF Service the creation of new issues through Github is a major method of contribution towards IR IIIF Service development. Issues can be motivated by the discovery of a bug in the software, or by the desire to see either new features added to cap or existing features behaving differently. +[deployment-guide]: DEPLOYING.md -These three categories of issue can be submitted using the following template: +
(back to top)
- [*] Bug Report - [] Feature Enhancement - [] Feature Request +## Filing Issues - Current Behavior: +Once you are using IRIIIFService the creation of new issues through GitHub is a major method of contribution towards IRIIIFService development. +Issues can be motivated by the discovery of a bug in the software, or by the desire to see either new features added or see changes to existing features. - [A description of the current behavior. This could include a list of steps to reproduce in the instance of a - Bug Report, and can be 'N/A' for Feature Requests] +There are two primary types of issues: +1. Bug Report +2. Feature Request - Desired Behavior: +A **Bug Report** involves a problem with the existing software or a **Feature** is not working as designed or expected. - [A description of the expected/desired behavior of the application] +A **Feature** involves new functionality or behavior. +
(back to top)
- Relevant Information: +## Creating a Pull Request - [This section can include relevant error messages, or links to information that pertains to the issue] +Community code and documentation contributions are welcome and should take the form of a **GitHub Pull Request** (*PR*). +Each *PR* will need to be reviewed by a IRIIIFService developer. +A review will result in the *PR* being accepted and merged, a descriptive request for changes, or the *PR* being closed along with a detailed explanation. -Once an issue has been filed it will be curated by a IR IIIF Service developer and receive the appropriate labeling. +It is our intention to maintain labeling on issues that are deemed to be low difficulty in order to provide a good point of entry for those looking to begin contributing code or documentation. -#### Creating Pull Requests +A *PR* description should include a list of the specific issues resolved, the predicted *semantic versioning* impact of the changes, and a description which characterizes the nature of the changes made. +When creating a *PR*, an issue template is automatically provided to simplify this process. -Community code and documentation contributions are welcome, and should take the form of a Github Pull Request (PR). Each PR will need to be reviewed by a IR IIIF Service developer. A review will result in the PR being accepted and merged, a descriptive request for changes, or the PR being closed along with a detailed explanation. +For more information about *semantic versioning* please see [Semantic Versioning Website][semantic-versioning]. +In general keep in mind: -It is our intention to maintain labeling on issues that are deemed to be low difficulty, in order to provide a good point of entry for those looking to begin contributing code or documentation. +- A **Major Change** is a breaking change that is not backwards compatible. +- A **Minor Change** is a non-breaking change that is backwards compatible to the last **Major Change**. +- A **Patch** is a trivial change or bug fix that should not impact compatibility. -A PR description should include a list of the specific issues resolved, the predicted semantic versioning impact of the changes and a description which characterizes the nature of the changes made. +
(back to top)
-For more information about semantic versioning please see [this reference](https://semver.org/). In general keep in mind: +## Good Luck! -- A Major Change is a breaking change that is not backwards compatible. -- A Minor Change is a non breaking change that is backwards compatible to the last major change. -- A Patch is a trivial change or bug fix that should not impact compatibility +We look forward to seeing your contributions. +If you have any additional questions please contact the IRIIIFService developers at [helpdesk@library.tamu.edu][helpdesk-email]. -Please confirm you PR description to the following template: +
(back to top)
- Resolves: - - - [List of # references to specific issues addressed by this PR] - - Changes: - - [*] Major - [] Minor - [] Patch - - [A description of the approach taken to resolving those issues] - -In addition to a well formatted PR we would also appreciate granular commits with descriptive messages. For instance a good commit message may be `Moved /foo endpoint logic into a FooService`, whereas `Everything I did Friday` is less granular or descriptive. - -If your commits do not conform to these recommendations you might consider rebasing your PR. Instructions for how this might work can be found [here](https://help.github.com/articles/about-git-rebase/). - -#### Good Luck! - -We look forward to seeing your contributions. If you have any additional questions please contact the IR IIIF Service developers at [helpdesk@library.tamu.edu](<>). + +[deployment-guide]: DEPLOYING.md +[semantic-versioning]: https://semver.org/ +[helpdesk-email]: mailto:helpdesk@library.tamu.edu \ No newline at end of file diff --git a/DEPLOYING.md b/DEPLOYING.md index e7aa60c..55d7654 100644 --- a/DEPLOYING.md +++ b/DEPLOYING.md @@ -1,119 +1,52 @@ -## Packaging + +# Deployment Guide -IR IIIF Service build is done with [Maven](https://maven.apache.org/). The build is configured with [pom.xml](https://github.com/TAMULib/IRIIIFService/blob/master/pom.xml). +## Production Deployments -### Maven build arguments +For **production** deployments, deploy using `docker`. +This is the recommended method of deployment for production systems. -- `-DskipTests` will skip tests. -- `-Dspring.config.location=file:/var/ir-iiif-service/config/` will configure the external configuration directory for development using `spring-boot:run`. - -**Ending trailing slash is required for spring.config.location** +### Build Docker image +```shell +docker build --tag=service +``` +### Configure +Follow spring-boot external configuration guide to override application.yml properties using environment variables. +### Run +Deploy image in infrastructure using configured environment variables. -The external configuration directory is where an application.yml file can be added to override default properties. When packaging the application, define `config.uri`. This will template context.xml file with the `spring.config.location` system variable for container deployment. +The **development** deployment can also use `docker` to run locally. -When running for development define `spring.config.location` to externalize the configuration. +
(back to top)
-**External configuration is recommended for production deployment** +## Development Deployment using **Docker** -### Development +Build and run using `docker`, run the following: -```bash -$ mvn clean spring-boot:run +```shell +docker image build -t service . +docker run -it service ``` -or run for development with external configuration - -```bash -$ mvn clean spring-boot:run -Dspring.config.location=file:/var/ir-iiif-service/config/ ``` - -### Production - -```bash -$ mvn clean package -DskipTests -Dconfig.uri=file:/var/ir-iiif-service/config/ +docker build --help +# -t, --tag list Name and optionally a tag in the ``` -If build succeeds, you should have `ROOT.war` in the `target/` directory. - -## Testing - -```bash -$ mvn clean test ``` - -## Configuration - -> Configuration for this service is done in [application.yml](https://github.com/TAMULib/IRIIIFService/blob/master/src/main/resources/application.yml) file located in src/main/resources directory. - -
-View Properties - -
- -| **Property** | **Type** | **Description** | **Example** | -| :-------------------------------------- | :----------- | :-------------------------------------------------------------------------- | :------------------------------------------------------------------------------ | -| server.contextPath | string | Path in which service is hosted. | /iiif-service | -| server.port | number | Port in which service is hosted. | 9000 | -| logging.file | string | Log file. | iiif-service.log | -| logging.level.edu.tamu.iiif | LOG_LEVEL | Log level for iiif service. | INFO | -| logging.level.org.springframework | LOG_LEVEL | Log level for spring framework. | INFO | -| logging.path | string | Path for log file. | /var/logs/iiif | -| spring.activemq.broker-url | url | ActiveMQ broker URL. | tcp://localhost:61616 | -| spring.activemq.username | string | ActiveMQ broker username. | username | -| spring.activemq.password | string | ActiveMQ broker password. | password | -| spring.redis.host | string | Host for redis server. | localhost | -| spring.redis.port | number | Port for redis server. | 6379 | -| spring.profiles.active | string | Build environment profile. | production | -| spring.profiles.include | string | Additional build environment profiles. | dspace, fedora, weaver-messaging | -| messaging.channels.cap | string | Channel to listen for Weaver messages in order to update chached manifests. | cap | -| iiif.admins | object array | Array of admin credentials. | [ { username: admin, password: password } ] | -| iiif.service.url | url | IIIF service URL. | | -| iiif.service.connection.timeout | number | HTTP connection request timeout in milliseconds. | 300000 | -| iiif.service.connection.request.timeout | number | HTTP connection timeout in milliseconds. | 300000 | -| iiif.service.socket.timeout | number | HTTP socket timeout in milliseconds. | 300000 | -| iiif.image.server.url | url | IIIF image server URL. | | -| iiif.logo.url | url | URL for a default logo. | | -| iiif.dspace.identifier | string | DSpace Identifier. | dspace | -| iiif.dspace.label-precedence | array | Array of valid RDF schema fields to determine title. | [ "http://purl.org/dc/elements/1.1/title", "http://purl.org/dc/terms/title" ] | -| iiif.dspace.description-precedence | array | Array of valid RDF schema fields to determine description. | [ "http://purl.org/dc/terms/abstract", "http://purl.org/dc/terms/description" ] | -| iiif.dspace.metadata-prefixes | array | Array of valid RDF schema URL to determine what metadate to include. | [ "http://purl.org/dc/elements/1.1/", "http://purl.org/dc/terms/" ] | -| iiif.dspace.url | url | DSpace base URL. | | -| iiif.dspace.webapp | string | DSpace UI webapp. | xmlui | -| iiif.fedora.identifier | string | Fedora PCDM identifier. | fedora | -| iiif.fedora.url | url | Fedora REST URL. | | -| iiif.dspace.label-precedence | array | Array of valid RDF schema fields to determine title. | [ "http://purl.org/dc/elements/1.1/title", "http://purl.org/dc/terms/title" ] | -| iiif.fedora.description-precedence | array | Array of valid RDF schema fields to determine description. | [ "http://purl.org/dc/terms/abstract", "http://purl.org/dc/terms/description" ] | -| iiif.fedora.metadata-prefixes | array | Array of valid RDF schema URL to determine what metadate to include. | [ "http://purl.org/dc/elements/1.1/", "http://purl.org/dc/terms/" ] | - -
- -Currently, in order to have Tomcat know where the external configuration directory is, `[Tomcat webapps directory]/ir-iiif-service/classes/META-INF/context.xml` will have to be updated. Skip step 1 if package built defining `config.uri`. - -1) Update [context.xml](https://github.com/TAMULib/IRIIIFService/blob/master/src/main/resources/META-INF/context.xml) to set external configuration directory - -```xml - - - - +docker run --help +# -i, --interactive Keep STDIN open even if not attached. +# -t, --tty Allocate a pseudo-TTY ``` -2) Update [application.yml](https://github.com/TAMULib/IRIIIFService/blob/master/src/main/resources/application.yml) +
(back to top)
-### Deploy to Tomcat +## Development Deployment using **Maven** -Copy war file into Tomcat webapps directory (your location may vary -- this is an example): +Running locally is easiest using spring boot: -```bash -$ cp ~/ROOT.war /opt/tomcat/webapps/ir-iiif-service.war +```shell +mvn spring-boot:run ``` -**if not specifying config.uri during build the application.yml will be under the IR IIIF Service webapp's classpath, /opt/tomcat/webapps/ir-iiif-service/WEB-INF/classes/application.yml** - -**if deployed from default WAR package and would like to externalize the config, you will have to edit /opt/tomcat/webapps/ir-iiif-service/META-INF/context.xml\*** - -### Running WAR as a stand-alone Spring Boot application - -```bash -java -jar target/ROOT.war -``` +
(back to top)
diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 0000000..d4b1aef --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,120 @@ + +## Packaging + +IR IIIF Service build is done with [Maven](https://maven.apache.org/). The build is configured with [pom.xml](https://github.com/TAMULib/IRIIIFService/blob/master/pom.xml). + +### Maven build arguments + +- `-DskipTests` will skip tests. +- `-Dspring.config.location=file:/var/ir-iiif-service/config/` will configure the external configuration directory for development using `spring-boot:run`. + +**Ending trailing slash is required for spring.config.location** + +The external configuration directory is where an application.yml file can be added to override default properties. When packaging the application, define `config.uri`. This will template context.xml file with the `spring.config.location` system variable for container deployment. + +When running for development define `spring.config.location` to externalize the configuration. + +**External configuration is recommended for production deployment** + +### Development + +```bash +$ mvn clean spring-boot:run +``` + +or run for development with external configuration + +```bash +$ mvn clean spring-boot:run -Dspring.config.location=file:/var/ir-iiif-service/config/ +``` + +### Production + +```bash +$ mvn clean package -DskipTests -Dconfig.uri=file:/var/ir-iiif-service/config/ +``` + +If build succeeds, you should have `ROOT.war` in the `target/` directory. + +## Testing + +```bash +$ mvn clean test +``` + +## Configuration + +> Configuration for this service is done in [application.yml](https://github.com/TAMULib/IRIIIFService/blob/master/src/main/resources/application.yml) file located in src/main/resources directory. + +
+View Properties + +
+ +| **Property** | **Type** | **Description** | **Example** | +| :-------------------------------------- | :----------- | :-------------------------------------------------------------------------- | :------------------------------------------------------------------------------ | +| server.contextPath | string | Path in which service is hosted. | /iiif-service | +| server.port | number | Port in which service is hosted. | 9000 | +| logging.file | string | Log file. | iiif-service.log | +| logging.level.edu.tamu.iiif | LOG_LEVEL | Log level for iiif service. | INFO | +| logging.level.org.springframework | LOG_LEVEL | Log level for spring framework. | INFO | +| logging.path | string | Path for log file. | /var/logs/iiif | +| spring.activemq.broker-url | url | ActiveMQ broker URL. | tcp://localhost:61616 | +| spring.activemq.username | string | ActiveMQ broker username. | username | +| spring.activemq.password | string | ActiveMQ broker password. | password | +| spring.redis.host | string | Host for redis server. | localhost | +| spring.redis.port | number | Port for redis server. | 6379 | +| spring.profiles.active | string | Build environment profile. | production | +| spring.profiles.include | string | Additional build environment profiles. | dspace, fedora, weaver-messaging | +| messaging.channels.cap | string | Channel to listen for Weaver messages in order to update chached manifests. | cap | +| iiif.admins | object array | Array of admin credentials. | [ { username: admin, password: password } ] | +| iiif.service.url | url | IIIF service URL. | | +| iiif.service.connection.timeout | number | HTTP connection request timeout in milliseconds. | 300000 | +| iiif.service.connection.request.timeout | number | HTTP connection timeout in milliseconds. | 300000 | +| iiif.service.socket.timeout | number | HTTP socket timeout in milliseconds. | 300000 | +| iiif.image.server.url | url | IIIF image server URL. | | +| iiif.logo.url | url | URL for a default logo. | | +| iiif.dspace.identifier | string | DSpace Identifier. | dspace | +| iiif.dspace.label-precedence | array | Array of valid RDF schema fields to determine title. | [ "http://purl.org/dc/elements/1.1/title", "http://purl.org/dc/terms/title" ] | +| iiif.dspace.description-precedence | array | Array of valid RDF schema fields to determine description. | [ "http://purl.org/dc/terms/abstract", "http://purl.org/dc/terms/description" ] | +| iiif.dspace.metadata-prefixes | array | Array of valid RDF schema URL to determine what metadate to include. | [ "http://purl.org/dc/elements/1.1/", "http://purl.org/dc/terms/" ] | +| iiif.dspace.url | url | DSpace base URL. | | +| iiif.dspace.webapp | string | DSpace UI webapp. | xmlui | +| iiif.fedora.identifier | string | Fedora PCDM identifier. | fedora | +| iiif.fedora.url | url | Fedora REST URL. | | +| iiif.dspace.label-precedence | array | Array of valid RDF schema fields to determine title. | [ "http://purl.org/dc/elements/1.1/title", "http://purl.org/dc/terms/title" ] | +| iiif.fedora.description-precedence | array | Array of valid RDF schema fields to determine description. | [ "http://purl.org/dc/terms/abstract", "http://purl.org/dc/terms/description" ] | +| iiif.fedora.metadata-prefixes | array | Array of valid RDF schema URL to determine what metadate to include. | [ "http://purl.org/dc/elements/1.1/", "http://purl.org/dc/terms/" ] | + +
+ +Currently, in order to have Tomcat know where the external configuration directory is, `[Tomcat webapps directory]/ir-iiif-service/classes/META-INF/context.xml` will have to be updated. Skip step 1 if package built defining `config.uri`. + +1) Update [context.xml](https://github.com/TAMULib/IRIIIFService/blob/master/src/main/resources/META-INF/context.xml) to set external configuration directory + +```xml + + + + +``` + +2) Update [application.yml](https://github.com/TAMULib/IRIIIFService/blob/master/src/main/resources/application.yml) + +### Deploy to Tomcat + +Copy war file into Tomcat webapps directory (your location may vary -- this is an example): + +```bash +$ cp ~/ROOT.war /opt/tomcat/webapps/ir-iiif-service.war +``` + +**if not specifying config.uri during build the application.yml will be under the IR IIIF Service webapp's classpath, /opt/tomcat/webapps/ir-iiif-service/WEB-INF/classes/application.yml** + +**if deployed from default WAR package and would like to externalize the config, you will have to edit /opt/tomcat/webapps/ir-iiif-service/META-INF/context.xml\*** + +### Running WAR as a stand-alone Spring Boot application + +```bash +java -jar target/ROOT.war +``` diff --git a/LICENSE b/LICENSE index 408a7ff..9d02011 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,8 @@ -MIT License +The MIT License (MIT) +Copyright © 2022 Texas A&M University Libraries -Copyright (c) 2018 Texas A&M University Libraries +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index eea40f9..5166720 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,55 @@ -[![Build Status](https://github.com/TAMULib/IRIIIFService/workflows/Build/badge.svg)](https://github.com/TAMULib/IRIIIFService/actions?query=workflow%3ABuild) -[![Coverage Status](https://coveralls.io/repos/github/TAMULib/IRIIIFService/badge.svg?branch=main)](https://coveralls.io/github/TAMULib/IRIIIFService?branch=main) +[![Build Status][build-badge]][build-status] +[![Coverage Status][coverage-badge]][coverage-status] -# IR IIIF Service +# Institutional Repository (IR) International Image Interoperability Framework (IIIF) Service -> This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCDM. + -## Requirements +This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCDM. -- [Redis](https://redis.io/) - - manifest cache - - resource URL cache +
+Table of contents + + - [Requirements:](#requirements) + - [External Requirements:](#external-requirements) + - [IIIF Image Server](#iiif-image-server) + - [DSpace](#dspace) + - [Fedora](#fedora) + - [Developer Documentation](#developer-documentation) + - [Additional Resources](#additional-resources) + +
+ +## Requirements: + +- [Redis](redis) + - manifest cache + - resource URL cache -## External Requirements +
(back to top)
-- IIIF Image Server - - must support API v2 - - script delegate to resolve identifier - - tested with [Cantaloupe](https://medusa-project.github.io/cantaloupe/) -- DSpace - - RDF webapp deployed and indexed - - Triplestore - - tested with [Fuseki](https://jena.apache.org/documentation/fuseki2/) -- Fedora - - structured with [PCDM](https://pcdm.org/) +### External Requirements: -### [IIIF](http://iiif.io/) Image Server +- IIIF Image Server + - must support API v2 + - script delegate to resolve identifier + - tested with [Cantaloupe](cantaloupe) +- DSpace + - RDF webapp deployed and indexed + - Triplestore + - tested with [Fuseki](fuseki) +- Fedora + - structured with [PCDM](pcdm) -- Image resolution by identifier - - `http://[iiif image server]/iiif/2/[UUID redis key]/full/full/0/default.jpg` - - UUID resource location resolution via resources interface -- [Presentation API v2](http://iiif.io/api/presentation/2.1/) -- [Image API v2](http://iiif.io/api/image/2.1/) +
(back to top)
+ +### [IIIF](iiif) Image Server + +- Image resolution by identifier + - `http://[iiif image server]/iiif/2/[UUID redis key]/full/full/0/default.jpg` + - UUID resource location resolution via resources interface +- [Presentation API v2](iiif-presentation-api-v2) +- [Image API v2](iiif-image-api-v2)
Example Cantaloupe custom delegate @@ -83,19 +102,65 @@
-### [DSpace](http://www.dspace.org/) +
(back to top)
+ +### [DSpace](dspace) -- [Installation](https://wiki.duraspace.org/display/DSDOC6x/Installing+DSpace#space-menu-link-content) -- [RDF](https://wiki.duraspace.org/display/DSDOC6x/Linked+%28Open%29+Data) +- [Installation](dspace-install) +- [RDF](dspace-rdf) -### [Fedora](https://fedorarepository.org/) +
(back to top)
-- [Installation](https://wiki.duraspace.org/display/FEDORA4x/Quick+Start) +#### [Fedora](refora) + + - [Installation](fedora-install) + +
(back to top)
## Developer Documentation -- [Contributors Documentation](https://github.com/TAMULib/IRIIIFService/blob/master/CONTRIBUTING.md) -- [Deployment Documentation](https://github.com/TAMULib/IRIIIFService/blob/master/DEPLOYING.md) -- [API Documentation](https://tamulib.github.io/IRIIIFService) +- [Contributors Documentation][contribute-guide] +- [Deployment Documentation][deployment-guide] +- [API Documentation](api-guide) + +
(back to top)
+ +## Additional Resources + +Please feel free to file any issues concerning Ecosystem Identifier Service to the issues section of the repository. + +Any questions concerning Ecosystem Identifier Service can be directed to helpdesk@library.tamu.edu. + +
(back to top)
+ +Copyright © 2022 Texas A&M University Libraries under the [The MIT License][license]. + + +[build-badge]: https://github.com/TAMULib/IRIIIFService/workflows/Build/badge.svg +[build-status]: https://github.com/TAMULib/IRIIIFService/actions?query=workflow%3ABuild +[coverage-badge]: https://coveralls.io/repos/github/TAMULib/IRIIIFService/badge.svg +[coverage-status]: https://coveralls.io/github/TAMULib/IRIIIFService + +[api-guide]: https://tamulib.github.io/IRIIIFService +[tamu-library]: http://library.tamu.edu +[deployment-guide]: DEPLOYING.md +[contribute-guide]: CONTRIBUTING.md +[license]: LICENSE + +[redis]: https://redis.io/ + +[cantaloupe]: https://medusa-project.github.io/cantaloupe/ +[fuseki]: https://jena.apache.org/documentation/fuseki2/ + +[pcdm]: https://pcdm.org/ + +[iiif]: http://iiif.io/ +[iiif-presentation-api-v2]: http://iiif.io/api/presentation/2.1/) +[iiif-image-api-v2]: http://iiif.io/api/image/2.1/) + +[dspace]: http://www.dspace.org/ +[dspace-install]: https://wiki.duraspace.org/display/DSDOC6x/Installing+DSpace#space-menu-link-content +[dspace-rdf]: https://wiki.duraspace.org/display/DSDOC6x/Linked+%28Open%29+Data -Please feel free to file any issues concerning IRIIIFService to the issues section of the repository. Any questions concerning cap can be directed to [helpdesk@library.tamu.edu](<>) +[fedora]: https://fedorarepository.org/ +[fedora-install]: https://wiki.duraspace.org/display/FEDORA4x/Quick+Start From f909b04dfe3d0f1b18e1fab1d16cbd5576ad0335 Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Thu, 11 Aug 2022 10:48:16 -0500 Subject: [PATCH 05/12] update dockerfile --- Dockerfile | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index df7a4dc..d0d7ae7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,17 @@ # Settings. ARG USER_ID=3001 ARG USER_NAME=iriif -ARG HOME_DIR=/$USER_NAME -ARG SOURCE_DIR=$HOME_DIR/source +ARG SOURCE_DIR=/$USER_NAME/source # Maven stage. FROM maven:3-openjdk-11-slim as maven ARG USER_ID ARG USER_NAME -ARG HOME_DIR ARG SOURCE_DIR -# Create the group (use a high ID to attempt to avoid conflits). -RUN groupadd -g $USER_ID $USER_NAME - -# Create the user (use a high ID to attempt to avoid conflits). -RUN useradd -d $HOME_DIR -m -u $USER_ID -g $USER_ID $USER_NAME +# Create the user and group (use a high ID to attempt to avoid conflicts). +RUN groupadd --non-unique -g $USER_ID $USER_NAME && \ + useradd --non-unique -d /$USER_NAME -m -u $USER_ID -g $USER_ID $USER_NAME # Update the system. RUN apt-get update && apt-get upgrade -y @@ -40,20 +36,17 @@ RUN mvn package -Pjar -DskipTests=true FROM openjdk:11-jre-slim ARG USER_ID ARG USER_NAME -ARG HOME_DIR ARG SOURCE_DIR -# Create the group (use a high ID to attempt to avoid conflits). -RUN groupadd -g $USER_ID $USER_NAME - -# Create the user (use a high ID to attempt to avoid conflits). -RUN useradd -d $HOME_DIR -m -u $USER_ID -g $USER_ID $USER_NAME +# Create the user and group (use a high ID to attempt to avoid conflicts). +RUN groupadd --non-unique -g $USER_ID $USER_NAME && \ + useradd --non-unique -d /$USER_NAME -m -u $USER_ID -g $USER_ID $USER_NAME # Login as user. USER $USER_NAME # Set deployment directory. -WORKDIR $HOME_DIR +WORKDIR /$USER_NAME # Copy over the built artifact from the maven image. COPY --from=maven $SOURCE_DIR/target/ROOT.jar ./iriif.jar From 48b3eb33008d57b209930cc19718a42f72cef3fa Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Thu, 11 Aug 2022 11:02:34 -0500 Subject: [PATCH 06/12] cleanup log files --- src/test/resources/logback-test.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index f6a703d..37b758e 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -1,9 +1,9 @@ - + From b185ff071d65aecc001da42d380e352945c22ac7 Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Thu, 11 Aug 2022 11:12:12 -0500 Subject: [PATCH 07/12] update weaver version and normalize pom --- pom.xml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 3945d88..4ed0044 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,6 @@ - 4.0.0 edu.tamu @@ -15,7 +14,7 @@ edu.tamu.weaver webservice-parent - 2.1.1-RC10 + 2.1.1-RC11 @@ -74,8 +73,8 @@ spring-boot-starter-data-redis - io.lettuce - lettuce-core + io.lettuce + lettuce-core @@ -362,14 +361,22 @@ tamu-releases https://artifacts.library.tamu.edu/repository/maven-releases - true - false + + true + + + false + tamu-snapshots https://artifacts.library.tamu.edu/repository/maven-snapshots - false - true + + false + + + true + From ce5a6df1f583a4260b19c6271d7a3ab8ff35c697 Mon Sep 17 00:00:00 2001 From: William Welling <8352733+wwelling@users.noreply.github.com> Date: Thu, 11 Aug 2022 11:23:40 -0500 Subject: [PATCH 08/12] update build workflow --- .github/workflows/build.yml | 8 ++-- README.md | 90 ++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14254a2..86c1826 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: "Maven Cache" - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -20,14 +20,14 @@ jobs: with: java-version: 11 - - name: "Maven Tests" + - name: "Maven Test" run: mvn clean test jacoco:report coveralls:report -DdryRun=true - name: "Coverage Report" uses: MikeEdgar/github-action@raw_coverage_file with: github-token: ${{ secrets.github_token }} - path-to-file: 'target/coveralls.json' + path-to-file: './target/coveralls.json' coverage-format: raw - name: "Deploy GH-Pages" diff --git a/README.md b/README.md index 5166720..c317d9e 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCD ### [IIIF](iiif) Image Server - Image resolution by identifier - - `http://[iiif image server]/iiif/2/[UUID redis key]/full/full/0/default.jpg` - - UUID resource location resolution via resources interface + - `http://[iiif image server]/iiif/2/[UUID redis key]/full/full/0/default.jpg` + - UUID resource location resolution via resources interface - [Presentation API v2](iiif-presentation-api-v2) - [Image API v2](iiif-image-api-v2) @@ -56,49 +56,49 @@ This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCD
- require 'base64' - class CustomDelegate - ## - # Returns one of the following: - # - # 1. String URI - # 2. Hash with the following keys: - # * `uri` [String] (required) - # * `username` [String] For HTTP Basic authentication (optional). - # * `secret` [String] For HTTP Basic authentication (optional). - # * `headers` [Hash] Hash of request headers (optional). - # 3. nil if not found. - # - # @param options [Hash] Empty hash. - # @return See above. - # - def httpsource_resource_info(options = {}) - id = context['identifier'] - puts id - if ( id =~ /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ ) - uri = '<%= @iiif_service_url %>resources/' + id + '/redirect' - elsif - irid = Base64.decode64(id) - puts irid - if irid.include? ":" - parts = irid.split(':') - ir = parts[0] - path = parts[1] - if ir == 'fedora' - uri = '<%= @fedora_url %>' + path - elsif ir == 'dspace' - uri = '<%= @dspace_url %>' + path - else - uri = irid - end - else - uri = id - end + require 'base64' + class CustomDelegate + ## + # Returns one of the following: + # + # 1. String URI + # 2. Hash with the following keys: + # * `uri` [String] (required) + # * `username` [String] For HTTP Basic authentication (optional). + # * `secret` [String] For HTTP Basic authentication (optional). + # * `headers` [Hash] Hash of request headers (optional). + # 3. nil if not found. + # + # @param options [Hash] Empty hash. + # @return See above. + # + def httpsource_resource_info(options = {}) + id = context['identifier'] + puts id + if ( id =~ /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ ) + uri = '<%= @iiif_service_url %>resources/' + id + '/redirect' + elsif + irid = Base64.decode64(id) + puts irid + if irid.include? ":" + parts = irid.split(':') + ir = parts[0] + path = parts[1] + if ir == 'fedora' + uri = '<%= @fedora_url %>' + path + elsif ir == 'dspace' + uri = '<%= @dspace_url %>' + path + else + uri = irid end - puts uri - return uri + else + uri = id end end + puts uri + return uri + end + end @@ -106,14 +106,14 @@ This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCD ### [DSpace](dspace) -- [Installation](dspace-install) -- [RDF](dspace-rdf) +- [Installation](dspace-install) +- [RDF](dspace-rdf)
(back to top)
#### [Fedora](refora) - - [Installation](fedora-install) +- [Installation](fedora-install)
(back to top)
From 8be7d5ef5fd1cca75dca8eda54b525c5dca7115d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 18 Aug 2022 16:17:55 -0500 Subject: [PATCH 09/12] Use .gitignore based off of App Repos. --- .gitignore | 84 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 2bf65cc..4faeb8c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,34 +1,70 @@ -# Java project type gitignore +### Git ### +!.gitkeep -# Compiled class file -*.class -# Log file -*.log +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache -# BlueJ files -*.ctxt -# Mobile Tools for Java (J2ME) -.mtj.tmp/ +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -replay_pid* +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ -# Docker gitignore +/.nb-gradle/ + + +### VS Code ### +.vscode/ + +dump.rdb -# Application specific gitignore -# Maven -target/ +### OS Specific ### +.DS_Store +.tmp/ + +tmp/ + + +### Maven ### logs/ +target/ + +.classpth +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.project + +buildNumber.properties +dependency-reduced-pom.xml +pom.xml.next +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +release.properties + + +### Weaver ### +dist/ + + +### Project Specific ### +.env* + +!**/src/main/** +!**/src/test/** From 43cf6f0f41c54480f55365c4f9155f0429354239 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 18 Aug 2022 16:40:18 -0500 Subject: [PATCH 10/12] Update readme and related files for consistency. - Fix simple mistakes. - Use long/full names in titles without acronyms. - Leave most of the README.md design as-is for comparison against alternative methods. - Fix license sentence. - Fix line endings where needed. - Use different documentation for cases where there is no `docker-compose` available (as in, no UI or App Repos). - Some documents have the incorrect link styling, which doesn't work. - Make readme and related files more consistent. --- CONTRIBUTING.md | 22 ++++++++++--------- DEPLOYING.md | 58 ++++++++++++++++++++++++++++--------------------- README.md | 48 +++++++++++++++++++++++----------------- 3 files changed, 73 insertions(+), 55 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa72e13..62e3008 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,23 +1,23 @@ -# Contributing To IRIIIFService +# Contributing to Institutional Repository International Image Interoperability Framework Service -Though IRIIIFService is developed and maintained by Texas A&M University Libraries, we welcome community contributions. -Involvement in IRIIIFService can take many forms: +Though *Institutional Repository International Image Interoperability Framework (IRIIIF) Service* is developed and maintained by Texas A&M University Libraries, we welcome community contributions. +Involvement in *IRIIIF Service* can take many forms. + ## Using -Deploying IRIIIFService and trying it out at your own institution is itself a way of contributing to the development process. +Deploying *IRIIIF Service* and trying it out at your own institution is itself a way of contributing to the development process. For more information on deployment strategies please see the [Deployment Guide][deployment-guide]. -[deployment-guide]: DEPLOYING.md - + ## Filing Issues -Once you are using IRIIIFService the creation of new issues through GitHub is a major method of contribution towards IRIIIFService development. +Once you are using *IRIIIF Service* the creation of new issues through GitHub is a major method of contribution towards *IRIIIF Service* development. Issues can be motivated by the discovery of a bug in the software, or by the desire to see either new features added or see changes to existing features. There are two primary types of issues: @@ -30,10 +30,11 @@ A **Feature** involves new functionality or behavior. + ## Creating a Pull Request Community code and documentation contributions are welcome and should take the form of a **GitHub Pull Request** (*PR*). -Each *PR* will need to be reviewed by a IRIIIFService developer. +Each *PR* will need to be reviewed by a *IRIIIF Service* developer. A review will result in the *PR* being accepted and merged, a descriptive request for changes, or the *PR* being closed along with a detailed explanation. It is our intention to maintain labeling on issues that are deemed to be low difficulty in order to provide a good point of entry for those looking to begin contributing code or documentation. @@ -50,14 +51,15 @@ In general keep in mind: + ## Good Luck! We look forward to seeing your contributions. -If you have any additional questions please contact the IRIIIFService developers at [helpdesk@library.tamu.edu][helpdesk-email]. +If you have any additional questions please contact the *IRIIIF Service* developers at helpdesk@library.tamu.edu. + [deployment-guide]: DEPLOYING.md [semantic-versioning]: https://semver.org/ -[helpdesk-email]: mailto:helpdesk@library.tamu.edu \ No newline at end of file diff --git a/DEPLOYING.md b/DEPLOYING.md index 55d7654..9c56537 100644 --- a/DEPLOYING.md +++ b/DEPLOYING.md @@ -1,52 +1,60 @@ -# Deployment Guide +# Institutional Repository International Image Interoperability Framework Service Deployment Guide ## Production Deployments -For **production** deployments, deploy using `docker`. -This is the recommended method of deployment for production systems. +For **production** deployments, deployment should ideally be done using `docker-compose`. +However, there is currently no *App* repository for *IRIIIF Service* providing a `docker-compose` file. + +For now, **production** deployments are identical to **development** deployments as described in the **Docker** method below. + + + + +## Development Deployment using Docker + +To manually use `docker` rather than `docker-compose`, run the following: -### Build Docker image ```shell -docker build --tag=service +docker image build -t project . +docker run -it project ``` -### Configure -Follow spring-boot external configuration guide to override application.yml properties using environment variables. -### Run -Deploy image in infrastructure using configured environment variables. -The **development** deployment can also use `docker` to run locally. +_* Note: `-t project` and `-it project` may be changed to another tag name as desired, such as `-t developing_on_this` and `-it developing_on_this`._
-## Development Deployment using **Docker** -Build and run using `docker`, run the following: +## Development Deployment using Maven + +Manual deployment can be summed up by running: ```shell -docker image build -t service . -docker run -it service +mvn spring-boot:run ``` -``` -docker build --help -# -t, --tag list Name and optionally a tag in the -``` +Those steps are a great way to start but they also fail to explain the customization that is often needed. +There are multiple ways to further configure this for deployment to better meet the desired requirements. -``` -docker run --help -# -i, --interactive Keep STDIN open even if not attached. -# -t, --tty Allocate a pseudo-TTY -``` +It is highly recommended only to perform *manual installation* when developing. +For **production** deployment, please use the **Docker** method above. -## Development Deployment using **Maven** -Running locally is easiest using spring boot: +### Directly Configuring the `src/main/resources/application.yml` File + +This method of configuration works by altering the configuration file. + +With this in mind, the deployment steps now look like: ```shell +# Edit 'src/main/resources/application.yml' here. + mvn spring-boot:run ``` + + + diff --git a/README.md b/README.md index c317d9e..947b21b 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,20 @@ [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] -# Institutional Repository (IR) International Image Interoperability Framework (IIIF) Service +# Institutional Repository International Image Interoperability Framework Service -This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCDM. +A *Spring* backend for the *Institutional Repository International Image Interoperability Framework (IRIIIF) Service* developed and maintained by [Texas A&M University Libraries][tamu-library]. + +This service provides **IIIF** manifest generation from **DSpace RDF** and/or **Fedora PCDM**.
Table of contents - [Requirements:](#requirements) - [External Requirements:](#external-requirements) - - [IIIF Image Server](#iiif-image-server) + - [IIIF Server](#iiif-server) - [DSpace](#dspace) - [Fedora](#fedora) - [Developer Documentation](#developer-documentation) @@ -20,42 +22,43 @@ This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCD
+ ## Requirements: -- [Redis](redis) +- [Redis][redis] - manifest cache - resource URL cache + ### External Requirements: -- IIIF Image Server +- IIIF Server - must support API v2 - script delegate to resolve identifier - - tested with [Cantaloupe](cantaloupe) + - tested with [Cantaloupe][cantaloupe] - DSpace - RDF webapp deployed and indexed - Triplestore - - tested with [Fuseki](fuseki) + - tested with [Fuseki][fuseki] - Fedora - - structured with [PCDM](pcdm) + - structured with [PCDM][pcdm] -### [IIIF](iiif) Image Server + +#### [IIIF][iiif] Server - Image resolution by identifier - `http://[iiif image server]/iiif/2/[UUID redis key]/full/full/0/default.jpg` - UUID resource location resolution via resources interface -- [Presentation API v2](iiif-presentation-api-v2) -- [Image API v2](iiif-image-api-v2) +- [Presentation API v2][iiif-presentation-api-v2] +- [Image API v2][iiif-image-api-v2]
Example Cantaloupe custom delegate -
- require 'base64' class CustomDelegate ## @@ -104,36 +107,41 @@ This service provides IIIF manifest generation from DSpace RDF and/or Fedora PCD -### [DSpace](dspace) -- [Installation](dspace-install) -- [RDF](dspace-rdf) +#### [DSpace][dspace] + +- [Installation][dspace-install] +- [RDF][dspace-rdf] -#### [Fedora](refora) -- [Installation](fedora-install) +#### [Fedora][fedora] + +- [Installation][fedora-install] + ## Developer Documentation - [Contributors Documentation][contribute-guide] - [Deployment Documentation][deployment-guide] -- [API Documentation](api-guide) +- [API Documentation][api-guide] + ## Additional Resources Please feel free to file any issues concerning Ecosystem Identifier Service to the issues section of the repository. Any questions concerning Ecosystem Identifier Service can be directed to helpdesk@library.tamu.edu. +Copyright © 2022 Texas A&M University Libraries under the [MIT License][license]. + -Copyright © 2022 Texas A&M University Libraries under the [The MIT License][license]. [build-badge]: https://github.com/TAMULib/IRIIIFService/workflows/Build/badge.svg From 399f9fdc9bf8f19ece218e1edde7062511136879 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 19 Aug 2022 09:12:48 -0500 Subject: [PATCH 11/12] Use project-specific name in docker deploy instructions. --- DEPLOYING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPLOYING.md b/DEPLOYING.md index 9c56537..7c955f4 100644 --- a/DEPLOYING.md +++ b/DEPLOYING.md @@ -16,11 +16,11 @@ For now, **production** deployments are identical to **development** deployments To manually use `docker` rather than `docker-compose`, run the following: ```shell -docker image build -t project . -docker run -it project +docker image build -t iriifservice . +docker run -it iriifservice ``` -_* Note: `-t project` and `-it project` may be changed to another tag name as desired, such as `-t developing_on_this` and `-it developing_on_this`._
+_* Note: `-t iriifservice` and `-it iriifservice` may be changed to another tag name as desired, such as `-t developing_on_this` and `-it developing_on_this`._
From d59b92447c6f9232ce3089d62559d7c63b46691f Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 19 Aug 2022 09:22:49 -0500 Subject: [PATCH 12/12] Make Dockerfile more consistent. - Remove SOURCE_DIR when not needed. - Always clean and clear apt cache to reduce docker disk usage. - Make sure the SOURCE_DIR exists when not copying it wholesale. - Remove any spurious new lines. --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d0d7ae7..3f3d52f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,15 @@ ARG SOURCE_DIR RUN groupadd --non-unique -g $USER_ID $USER_NAME && \ useradd --non-unique -d /$USER_NAME -m -u $USER_ID -g $USER_ID $USER_NAME -# Update the system. -RUN apt-get update && apt-get upgrade -y +# Update the system and install dependencies. +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Make sure source directory exists. +RUN mkdir -p $SOURCE_DIR && \ + chown -R $USER_ID:$USER_ID $SOURCE_DIR # Set deployment directory. WORKDIR $SOURCE_DIR