-
Notifications
You must be signed in to change notification settings - Fork 17
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 ability to run deposit services #344
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
58aa8c0
Add ability to run deposit services
rpoet-jh 27ca8cc
Use pass_version env var
rpoet-jh 9f7ce47
Fix typo
rpoet-jh 16c9e9e
Clean dspace license clause
rpoet-jh 2262c45
Add localstack image version
rpoet-jh 3381295
Fix dspace configuration issue
rpoet-jh e44e824
Add ftp server for pmc deposits
rpoet-jh 42bd332
Add deposit repositories config
rpoet-jh 397d56b
Update README
rpoet-jh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2002-2021, LYRASIS. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
- Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
- Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
- Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | ||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
DAMAGE. |
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 |
---|---|---|
|
@@ -2,11 +2,34 @@ The "demo" compose file describes an early system meant to demonstrate some new | |
|
||
## Running: | ||
|
||
Docker compose works as normal, but for the demo you need to specify both correct `yml` file and env file. In order to run a local instance, you can run: | ||
``` sh | ||
Docker compose works as normal, but for the demo you need to specify both correct `yml` file and env file. | ||
|
||
In order to run a local instance **_without_** deposit-service and dspace, you can run: | ||
``` | ||
docker compose up -d --no-build --quiet-pull --pull always | ||
``` | ||
|
||
In order to stop a local instance, you can run: | ||
``` | ||
docker compose -p pass-docker down -v | ||
``` | ||
Note the `-v` to remove the volumes, **this is critical** so on subsequent starts, user data is not duplicated. | ||
|
||
In order to run a local instance **_with_** deposit-service and dspace, you can run: | ||
``` | ||
docker compose -p pass-docker -f docker-compose.yml -f docker-compose-deposit.yml -f docker-compose-dspace.yml up -d --no-build --quiet-pull | ||
``` | ||
|
||
Run the following to create a test admin user in dspace: | ||
``` | ||
docker-compose -p pass-docker -f dspace-cli.yml run --rm dspace-cli create-administrator -e [email protected] -f admin -l user -p admin -c en | ||
``` | ||
|
||
Run the following to load sample data into dspace: | ||
``` | ||
docker-compose -p pass-docker -f dspace-cli.yml -f dspace-cli.ingest.yml run --rm dspace-cli | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. docker compose There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
``` | ||
|
||
## Services: | ||
|
||
### [`pass-auth`](https://github.com/jaredgalanis/pass-auth) | ||
|
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,28 @@ | ||
# | ||
# Copyright 2023 Johns Hopkins University | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# The docker-compose file to start PASS deposit services. | ||
version: '3.8' | ||
|
||
services: | ||
deposit-services: | ||
image: "ghcr.io/eclipse-pass/deposit-services-core:${PASS_VERSION}" | ||
container_name: pass-deposit-services | ||
env_file: | ||
- .env | ||
networks: | ||
- back | ||
depends_on: | ||
- pass-core |
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,141 @@ | ||
# | ||
# DSpace License: DSPACE_LICENSE file in root of this project. | ||
# Details available online at: http://www.dspace.org/license/ | ||
# | ||
# The docker-compose file to start Dspace7 with SwordV2 enabled. | ||
# The dspace service definitions were taken from the dspace-angular project: | ||
# https://github.com/DSpace/dspace-angular.git | ||
# The service definitions have been slightly modified to run within the PASS docker-compose process. | ||
# | ||
version: '3.8' | ||
|
||
services: | ||
# DSpace (backend) webapp container | ||
dspace: | ||
container_name: dspace | ||
environment: | ||
# Below syntax may look odd, but it is how to override dspace.cfg settings via env variables. | ||
# See https://github.com/DSpace/DSpace/blob/main/dspace/config/config-definition.xml | ||
# __P__ => "." (e.g. dspace__P__dir => dspace.dir) | ||
# __D__ => "-" (e.g. google__D__metadata => google-metadata) | ||
# dspace.dir, dspace.server.url, dspace.ui.url and dspace.name | ||
dspace__P__dir: /dspace | ||
dspace__P__server__P__url: http://dspace:8080/server | ||
dspace__P__ui__P__url: http://localhost:4000 | ||
dspace__P__name: 'DSpace Started with Docker Compose' | ||
# db.url: Ensure we are using the 'dspacedb' image for our database | ||
db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace' | ||
# solr.server: Ensure we are using the 'dspacesolr' image for Solr | ||
solr__P__server: http://dspacesolr:8983/solr | ||
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests | ||
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above. | ||
proxies__P__trusted__P__ipranges: '172.23.0' | ||
swordv2__D__server__P__enabled: true | ||
swordv2__D__server__P__url: http://dspace:8080/server/swordv2 | ||
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-7_x-test}" | ||
depends_on: | ||
- dspacedb | ||
networks: | ||
back: | ||
ports: | ||
- published: 8080 | ||
target: 8080 | ||
stdin_open: true | ||
tty: true | ||
volumes: | ||
- assetstore:/dspace/assetstore | ||
# Mount DSpace's solr configs to a volume, so that we can share to 'dspacesolr' container (see below) | ||
- solr_configs:/dspace/solr | ||
# Ensure that the database is ready BEFORE starting tomcat | ||
# 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep | ||
# 2. Then, run database migration to init database tables | ||
# 3. Finally, start Tomcat | ||
entrypoint: | ||
- /bin/bash | ||
- '-c' | ||
- | | ||
while (!</dev/tcp/dspacedb/5432) > /dev/null 2>&1; do sleep 1; done; | ||
/dspace/bin/dspace database migrate | ||
catalina.sh run | ||
# DSpace database container | ||
dspacedb: | ||
container_name: dspacedb | ||
environment: | ||
PGDATA: /pgdata | ||
POSTGRES_PASSWORD: dspace | ||
image: dspace/dspace-postgres-pgcrypto | ||
networks: | ||
back: | ||
ports: | ||
- published: 5432 | ||
target: 5432 | ||
stdin_open: true | ||
tty: true | ||
volumes: | ||
- pgdata:/pgdata | ||
# DSpace Solr container | ||
dspacesolr: | ||
container_name: dspacesolr | ||
image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-7_x}" | ||
# Needs main 'dspace' container to start first to guarantee access to solr_configs | ||
depends_on: | ||
- dspace | ||
networks: | ||
back: | ||
ports: | ||
- published: 8983 | ||
target: 8983 | ||
stdin_open: true | ||
tty: true | ||
working_dir: /var/solr/data | ||
volumes: | ||
# Keep Solr data directory between reboots | ||
- solr_data:/var/solr/data | ||
# Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr | ||
# * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op | ||
# * Second, copy configsets to this core: | ||
# Updates to Solr configs require the container to be rebuilt/restarted: | ||
# `docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --build dspacesolr` | ||
entrypoint: | ||
- /bin/bash | ||
- '-c' | ||
- | | ||
init-var-solr | ||
precreate-core authority /opt/solr/server/solr/configsets/authority | ||
cp -r /opt/solr/server/solr/configsets/authority/* authority | ||
precreate-core oai /opt/solr/server/solr/configsets/oai | ||
cp -r /opt/solr/server/solr/configsets/oai/* oai | ||
precreate-core search /opt/solr/server/solr/configsets/search | ||
cp -r /opt/solr/server/solr/configsets/search/* search | ||
precreate-core statistics /opt/solr/server/solr/configsets/statistics | ||
cp -r /opt/solr/server/solr/configsets/statistics/* statistics | ||
exec solr -f | ||
|
||
dspace-angular: | ||
container_name: dspace-angular | ||
environment: | ||
DSPACE_UI_SSL: 'false' | ||
DSPACE_UI_HOST: dspace-angular | ||
DSPACE_UI_PORT: '4000' | ||
DSPACE_UI_NAMESPACE: / | ||
DSPACE_REST_SSL: 'false' | ||
DSPACE_REST_HOST: localhost | ||
DSPACE_REST_PORT: 8080 | ||
DSPACE_REST_NAMESPACE: /server | ||
image: dspace/dspace-angular:dspace-7_x | ||
networks: | ||
back: | ||
ports: | ||
- published: 4000 | ||
target: 4000 | ||
- published: 9876 | ||
target: 9876 | ||
stdin_open: true | ||
tty: true | ||
|
||
volumes: | ||
assetstore: | ||
pgdata: | ||
solr_data: | ||
# Special volume used to share Solr configs from 'dspace' to 'dspacesolr' container (see above) | ||
solr_configs: |
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,33 @@ | ||
# | ||
# DSpace License: DSPACE_LICENSE file in root of this project. | ||
# Details available online at: http://www.dspace.org/license/ | ||
# | ||
# This is a copy of the cli.ingest.yml that is available in the DSpace/DSpace | ||
# (Backend) at: | ||
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/cli.ingest.yml | ||
# | ||
# Therefore, it should be kept in sync with that file | ||
version: "3.7" | ||
|
||
services: | ||
dspace-cli: | ||
environment: | ||
- AIPZIP=https://github.com/DSpace-Labs/AIP-Files/raw/main/dogAndReport.zip | ||
- [email protected] | ||
- AIPDIR=/tmp/aip-dir | ||
entrypoint: | ||
- /bin/bash | ||
- '-c' | ||
- | | ||
rm -rf $${AIPDIR} | ||
mkdir $${AIPDIR} /dspace/upload | ||
cd $${AIPDIR} | ||
pwd | ||
curl $${AIPZIP} -L -s --output aip.zip | ||
unzip aip.zip | ||
cd $${AIPDIR} | ||
|
||
/dspace/bin/dspace packager -r -a -t AIP -e $${ADMIN_EMAIL} -f -u SITE*.zip | ||
/dspace/bin/dspace database update-sequences | ||
|
||
/dspace/bin/dspace index-discovery |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
docker compose
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.
Done