Skip to content

Commit

Permalink
Merge branch 'ufal/fe-22-54-download-preview-item' of github.com:data…
Browse files Browse the repository at this point in the history
…quest-dev/dspace-angular into ufal/fe-22-54-download-preview-item
  • Loading branch information
milanmajchrak committed Sep 27, 2023
2 parents a868331 + 29a7f0d commit d12d397
Show file tree
Hide file tree
Showing 54 changed files with 829 additions and 99 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Build
on:
push:
branches:
- dtq-dev-7.5
- dtq-dev
pull_request:

permissions:
Expand All @@ -20,7 +20,7 @@ jobs:
# The ci step will test the dspace-angular code against DSpace REST.
# Direct that step to utilize a DSpace REST service that has been started in docker.
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
DSPACE_CI_IMAGE: 'dataquest/dspace:dtq-dev-7.5-test'
DSPACE_CI_IMAGE: 'dataquest/dspace:dspace-7_x-test'
DSPACE_REST_HOST: 127.0.0.1
DSPACE_REST_PORT: 8080
DSPACE_REST_NAMESPACE: '/server'
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ jobs:
with:
submodules: false
- name: deploy
if: 'false'
run: |
cd $GITHUB_WORKSPACE/build-scripts/run/
pwd
touch .env.dev-5 || true
echo DSPACE_REST_HOST=dev-5.pc > .env.dev-5
echo REST_URL=http://dev-5.pc:8085/server >> .env.dev-5
echo UI_URL=http://dev-5.pc:85 >> .env.dev-5
echo DSPACE_REST_IMAGE=dataquest/dspace:dtq-dev-7.5 >> .env.dev-5
echo DOCKER_OWNER=dataquest >> .env.dev-5
## echo NODE_ENV="development" >> .env.dev-5
echo DSPACE_UI_IMAGE="dataquest/dspace-angular:dtq-dev-7.5" >> .env.dev-5
echo DSPACE_VER="dtq-dev-7.5" >> .env.dev-5
echo INSTANCE=5 >> .env.dev-5
echo DSPACE_HOST=dev-5.pc >> .env.dev-5
echo DSPACE_VER=dspace-7_x >> .env.dev-5
echo DSPACE_SSL=false >> .env.dev-5
echo DOCKER_OWNER=dataquest >> .env.dev-5
echo DSPACE_UI_IMAGE=\${DOCKER_OWNER}/dspace-angular:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_IMAGE=\${DOCKER_OWNER}/dspace:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_PORT=8\$INSTANCE >> .env.dev-5
echo REST_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT}/server >> .env.dev-5
echo UI_URL=http://\${DSPACE_HOST}:400\$INSTANCE >> .env.dev-5
echo S3_STORAGE=1 >> .env.dev-5
echo S3_ENABLED=true >> .env.dev-5
echo S3_RELATIVE_PATH=true >> .env.dev-5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
labels: ${{ steps.meta_build.outputs.labels }}

- name: redeploy
if: 'false'
if: '!cancelled()'
run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/erase_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
restart_db:
env:
env:
INSTANCE: 5
runs-on: dspace-dep-1
steps:
Expand All @@ -17,11 +17,11 @@ jobs:
docker stop dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE
docker rm dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE
- name: remove volumes
if: '!cancelled()'
if: 'false'
run: |
docker volume rm dspace-${{env.INSTANCE}}_pgdata dspace-${{env.INSTANCE}}_assetstore
- name: redeploy
if: 'false'
run: |
curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" --request POST https://api.github.com/repos/dataquest-dev/dspace-angular/actions/workflows/deploy.yml/dispatches --data "{\"ref\":\"refs/heads/dtq-dev-7.5\"}"
curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" --request POST https://api.github.com/repos/dataquest-dev/dspace-angular/actions/workflows/deploy.yml/dispatches --data "{\"ref\":\"refs/heads/dtq-dev\"}"
20 changes: 8 additions & 12 deletions .github/workflows/new_issue_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ on:
issues:
types: [opened]

env:
MY_GITHUB_TOKEN: ${{ secrets.PAT_ISSUE_MGMT }}

jobs:
assign_one_project:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
name: Assign to One Project
steps:
- uses: actions/checkout@v3
- name: Assign NEW issues to dspace-project
uses: ./.github/actions/project-management-action
if: github.event.action == 'opened'
with:
project: 'https://github.com/orgs/dataquest-dev/projects/6'
column_name: 'Backlog'
- uses: actions/[email protected]
with:
# You can target a project in a different organization
# to the issue
project-url: https://github.com/orgs/dataquest-dev/projects/12
github-token: ${{ secrets.PAT_ISSUE_MGMT }}
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ RUN yarn install --network-timeout 300000
# Listen / accept connections from all IP addresses.
# NOTE: At this time it is only possible to run Docker container in Production mode
# if you have a public IP. See https://github.com/DSpace/dspace-angular/issues/1485
CMD yarn serve --host 0.0.0.0
RUN apk add tzdata
RUN yarn build:prod
RUN npm install pm2 -g
CMD /bin/sh -c "pm2 start dspace-ui.json && pm2 logs"
14 changes: 7 additions & 7 deletions build-scripts/run/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ source $ENVFILE
docker pull $DSPACE_UI_IMAGE

pushd ../..
docker-compose --env-file $ENVFILE -f docker/docker-compose.yml -f docker/docker-compose-rest.yml pull
docker-compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --no-build
docker compose --env-file $ENVFILE -f docker/docker-compose.yml -f docker/docker-compose-rest.yml pull
docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --no-build
popd

# Create admin user
# set DOCKER_OWNER to match our image (see cli.yml)
pushd ../..
docker-compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/matomo-w-db.yml pull
docker-compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/matomo-w-db.yml up -d --no-build
docker-compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli create-administrator -e [email protected] -f admin -l user -p admin -c en -o dataquest
docker-compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli user --add -m [email protected] -g meno -s priezvisko -l en -p user -o dataquest
docker-compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli version
docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/matomo-w-db.yml pull
docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/matomo-w-db.yml up -d --no-build
docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli create-administrator -e [email protected] -f admin -l user -p admin -c en -o dataquest
docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli user --add -m [email protected] -g meno -s priezvisko -l en -p user -o dataquest
docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli version
popd
76 changes: 76 additions & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,79 @@ rest:
host: localhost
port: 8080
nameSpace: /server


info:
# Whether the end user agreement is required before users may use the repository.
# If enabled, the user will be required to accept the agreement before they can use the repository.
# If disabled, the page will not exist and no agreement is required to use the repository
enableEndUserAgreement: false
# Whether the privacy statement should exist or not.
enablePrivacyStatement: false

# Keep only English language
languages:
- code: en
label: English
active: true
- code: ca
label: Català
active: false
- code: cs
label: Čeština
active: true
- code: de
label: Deutsch
active: false
- code: es
label: Español
active: false
- code: fr
label: Français
active: false
- code: gd
label: Gàidhlig
active: false
- code: lv
label: Latviešu
active: false
- code: hu
label: Magyar
active: false
- code: nl
label: Nederlands
active: false
- code: pl
label: Polski
active: false
- code: pt-PT
label: Português
active: false
- code: pt-BR
label: Português do Brasil
active: false
- code: fi
label: Suomi
active: false
- code: sv
label: Svenska
active: false
- code: tr
label: Türkçe
active: false
- code: kk
label: Қазақ
active: false
- code: bn
label: বাংলা
active: false
- code: hi
label: हिंदी
active: false
- code: el
label: Ελληνικά
active: false
- code: uk
label: Yкраї́нська
active: false

7 changes: 1 addition & 6 deletions docker/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@
# http://www.dspace.org/license/
#

#
# This is a copy of the docker-compose-cli.yml that is available in the DSpace/DSpace
# (Backend) at:
# https://github.com/DSpace/DSpace/blob/main/docker-compose-cli.yml
#
# Therefore, it should be kept in sync with that file
version: "3.7"

services:
dspace-cli:
image: "${DOCKER_OWNER:-dataquest}/dspace-cli:${DSPACE_VER:-dspace-7_x}"
container_name: dspace-cli
environment:
TZ: ${TIMEZONE:-Europe/Bratislava}
# 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)
Expand Down
13 changes: 13 additions & 0 deletions docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
restart: unless-stopped
container_name: dspace${INSTANCE}
environment:
TZ: ${TIMEZONE:-Europe/Bratislava}
# 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)
Expand Down Expand Up @@ -51,14 +52,18 @@ services:
ports:
- published: 808${INSTANCE}
target: 8080
host_ip: 127.0.0.1
- published: 800${INSTANCE}
target: 8000
host_ip: 127.0.0.1
stdin_open: true
tty: true
volumes:
- dspace_logs:/dspace/log
- 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
- ./local.cfg:/dspace/config/local.cfg
# 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
Expand All @@ -75,6 +80,7 @@ services:
restart: unless-stopped
container_name: dspacedb${INSTANCE}
environment:
TZ: ${TIMEZONE:-Europe/Bratislava}
PGDATA: /pgdata
POSTGRES_PASSWORD: dspace
image: dspace/dspace-postgres-pgcrypto
Expand All @@ -83,13 +89,16 @@ services:
ports:
- published: 543${INSTANCE}
target: 543${INSTANCE}
host_ip: 127.0.0.1
stdin_open: true
tty: true
volumes:
- pgdata:/pgdata
command: -p 543${INSTANCE}
# DSpace Solr container
dspacesolr:
environment:
TZ: ${TIMEZONE:-Europe/Bratislava}
restart: unless-stopped
container_name: dspacesolr${INSTANCE}
# Uses official Solr image at https://hub.docker.com/_/solr/
Expand All @@ -102,6 +111,7 @@ services:
ports:
- published: 898${INSTANCE}
target: 898${INSTANCE}
host_ip: 127.0.0.1
stdin_open: true
tty: true
working_dir: /var/solr/data
Expand All @@ -111,6 +121,7 @@ services:
- solr_configs:/opt/solr/server/solr/configsets/dspace
# Keep Solr data directory between reboots
- solr_data:/var/solr/data
- solr_logs:/var/solr/logs
# 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 updated configs from mounted configsets to this core. If it already existed, this updates core
Expand All @@ -135,3 +146,5 @@ volumes:
solr_data:
# Special volume used to share Solr configs from 'dspace' to 'dspacesolr' container (see above)
solr_configs:
dspace_logs:
solr_logs:
19 changes: 11 additions & 8 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# http://www.dspace.org/license/
#

# Docker Compose for running the DSpace Angular UI for testing/development
# Requires also running a REST API backend (either locally or remotely),
# for example via 'docker-compose-rest.yml'
version: '3.7'
networks:
dspacenet:
Expand All @@ -17,24 +14,30 @@ services:
restart: unless-stopped
container_name: dspace-angular${INSTANCE}
environment:
TZ: ${TIMEZONE:-Europe/Bratislava}
DSPACE_UI_SSL: 'false'
DSPACE_UI_HOST: dspace-angular
DSPACE_UI_PORT: 400${INSTANCE}
DSPACE_UI_PORT: 4000
DSPACE_UI_NAMESPACE: /
DSPACE_REST_SSL: 'false'
DSPACE_REST_HOST: ${DSPACE_REST_HOST:-localhost}
DSPACE_REST_PORT: 808${INSTANCE}
DSPACE_REST_SSL: ${DSPACE_SSL:-false}
DSPACE_REST_HOST: ${DSPACE_HOST:-localhost}
DSPACE_REST_PORT: ${DSPACE_REST_PORT}
DSPACE_REST_NAMESPACE: /server
image: ${DSPACE_UI_IMAGE:-dataquest/dspace-angular:dspace-7_x}
volumes:
- ./config.prod.yml:/app/config/config.prod.yml
build:
context: ..
dockerfile: Dockerfile
networks:
dspacenet:
entrypoint: ${FE_CMD:-/bin/sh -c "pm2 start dspace-ui.json && pm2 logs"}
ports:
- published: 400${INSTANCE}
target: 400${INSTANCE}
target: 4000
host_ip: 127.0.0.1
- published: 987${INSTANCE}
target: 987${INSTANCE}
host_ip: 127.0.0.1
stdin_open: true
tty: true
1 change: 1 addition & 0 deletions docker/local.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This is a sample config file. Replace with production local.cfg to be mounted into docker.
12 changes: 12 additions & 0 deletions dspace-ui.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"apps": [
{
"name": "dspace-ui",
"cwd": "/app",
"script": "dist/server/main.js",
"instances": "7",
"exec_mode": "cluster",
"node_args": "--max_old_space_size=4096"
}
]
}
Loading

0 comments on commit d12d397

Please sign in to comment.