Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • commul/docker/clarin-dspace
1 result
Show changes
Showing with 178 additions and 244 deletions
##############################################################################
# Dockerfile to build postgres for LINDAT Dspace container
# Based on Postgres
##############################################################################
ARG DSPACE_APP_VERSION
ARG POSTGRES_VERSION=9.6
FROM gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/dspace-app/2020.02.1:$DSPACE_APP_VERSION as dspace-app
FROM postgres:$POSTGRES_VERSION
ENV TERM linux
# APT(-GET) tweaks
# Set some sane defaults for apt inside docker
ENV DEBIAN_FRONTEND=noninteractive
#
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install git && \
rm -rf /var/lib/apt/lists/*
# copy int db script
RUN mkdir -p /docker-entrypoint-initdb.d
COPY init-dspace-dbs.sh /docker-entrypoint-initdb.d/
RUN chmod +x /docker-entrypoint-initdb.d/*
# FIXME: still needed?
# copy over modified config file
#COPY commul-customization/postgresql.conf /tmp/
#COPY commul-customization/updateConfig.sh /docker-entrypoint-initdb.d/_updateConfig.sh
# Adapt license definitions file
RUN mkdir /tmp/sql/
COPY --from=dspace-app /app/utilities/utilities.sql /tmp/sql/
COPY --from=dspace-app /app/utilities/license_definition.txt /tmp/sql
RUN chmod -R a+w /tmp/sql/ && \
perl -pi -e "s#afile :utildir '/license_definition.txt'#afile '/tmp/sql/license_definition.txt'#;" /tmp/sql/utilities.sql
# Usage: earthly --push --no-cache +docker
ARG DSPACE_APP_VERSION
docker-from-docker:
FROM DOCKERFILE --build-arg DSPACE_APP_VERSION=$DSPACE_APP_VERSION .
ARG DOCKER_BASE_URL="gitlab.inf.unibz.it:4567"
ARG EARTHLY_GIT_PROJECT_NAME # https://docs.earthly.dev/earthfile/builtin-args
ARG GIT_PROJECT_NAME="commul/docker/clarin-dspace"
ARG COMMUL_REGISTRY_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace/container_registry/"
ARG LABEL_VCS_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace"
ARG AUTHOR="Egon W. Stemle <egon.stemle@eurac.edu>"
ARG MAINTAINER="Egon W. Stemle <egon.stemle@eurac.edu>"
LABEL author="$AUTHOR"
LABEL maintainer="$MAINTAINER"
# An updated VERSION ARG triggers an update of the texlive installation
ARG EARTHLY_TARGET_TAG
ARG VERSION=$EARTHLY_TARGET_TAG
ARG EARTHLY_GIT_HASH
ARG GIT_HASH=$EARTHLY_GIT_HASH
ARG EARTHLY_TARGET_TAG_DOCKER
ARG TARGET_TAG_DOCKER=$EARTHLY_TARGET_TAG_DOCKER
ARG DOCKER_URL="$DOCKER_BASE_URL/$GIT_PROJECT_NAME/dspace-bundle/postgres"
LABEL org.label-schema.schema-version="1.0" \ # http://label-schema.org/rc1/
org.label-schema.version="$VERSION" \
org.label-schema.vcs-url="$LABEL_VCS_URL" \
org.commul.git-hash="$GIT_HASH" \
org.commul.registry-url="$COMMUL_REGISTRY_URL" \
org.commul.docker-url="$DOCKER_URL"
RUN echo $VERSION > /tmp/release
SAVE ARTIFACT --keep-ts /tmp/release AS LOCAL ./.release
SAVE IMAGE postgres:latest
SAVE IMAGE --push "$DOCKER_URL:latest"
SAVE IMAGE --push "$DOCKER_URL:$VERSION"
docker:
BUILD --build-arg DSPACE_APP_VERSION=$DSPACE_APP_VERSION +docker-from-docker
#!/bin/bash
set -e
VERSION=${1:-latest}
TYPE=${2:-staging}
docker build -t gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/$TYPE/dspace:$VERSION . -f Dockerfile.dspace
docker build -t gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/$TYPE/nginx:$VERSION . -f Dockerfile.nginx
docker build -t gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/$TYPE/postgres:$VERSION . -f Dockerfile.postgres
docker push gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/$TYPE/dspace:$VERSION
docker push gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/$TYPE/nginx:$VERSION
docker push gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/$TYPE/postgres:$VERSION
ERCC_TAG="$(git describe --tags --abbrev=0 $(git rev-list --tags --max-count=1))"
VERSION=${ERCC_TAG:-latest}
earthly --push +docker
echo sed ../kubernetes/*-deployment.yaml -e \"'s#\(.*image: gitlab.inf.unibz.it:4567/.*:\).*#\1'"${VERSION}#"\"
#!/bin/bash
#
# Wiki https://github.com/ufal/clarin-dspace/wiki/Installation
#
#
MAJOR=0
BUILD=2
VERSION="${MAJOR}.${BUILD}"
#set -ex
# let's define some variables
export DSPACE_INSTANCE_NAME=repository
export DSPACE_SOURCE_DIRECTORY=/opt/repository/sources/dspace
export DSPACE_WORKSPACE=/opt/repository/workspace
export DSPACE_INSTALLATION_DIRECTORY=/opt/repository/installations
AAI_CONFIGFILE="/opt/lindat-dspace/installation/webapps/xmlui/themes/UFAL/lib/js/aai_config.js"
DSPACE_CONFIGFILE="$DSPACE_WORKSPACE/sources/local.properties"
#
# functions
#
_logger () {
MSG=$1
if [ ${DEBUG} ]; then
echo -ne "${MSG}"
# else
# echo -ne "${MSG}" >> ${LogFile}
fi
}
_loggerDate() {
_logger "[$(date)] $*"
}
_exit() {
if [ -z $1 ]; then
E_CODE=0
else
E_CODE=$1
fi
rm -rf ${TemporaryPath}
_loggerDate "Script completed\n"
exit ${E_CODE}
}
_printVersion() {
echo "${BASENAME} version ${VERSION}"
}
_printHelp() {
echo "${BASENAME}"
echo "Assembly some stuff, creating things..."
echo
echo "Supported options:"
echo " -d|--debug enable debug"
echo " -V|--version report program version"
echo " -h|--help print this help"
echo
}
_printComment () {
MSG=$1
echo "<"'!'"-- ${MSG} -->"
}
_checkenv () {
set -x
_loggerDate "Checking env variables "
echo $*
tot_args=$#
echo $tot_args
count=0
while [ "$1" ]
do
echo "."
shift
((count++))
done
echo $tot_args $count
if [ "$tot_args" -ne "$count" ];then
exit 1
fi
set +x
}
#
# main script
#
# argument parsing
while [ $1 ]; do
case $1 in
-d|--debug) DEBUG=1
shift
;;
-V|--version) _printVersion
exit 0
;;
-h|--help) _printHelp
exit 0
;;
-t|--test) _notifyByIcingaPassiveCheck
exit 0
;;
*) _printHelp
exit 0
;;
esac
done
_loggerDate "Starting ${BASENAME}\n"
_loggerDate "Cloning lindat-dspace repository..."
if [ ! -d $DSPACE_SOURCE_DIRECTORY ]
then
_logger "in $DSPACE_SOURCE_DIRECTORY \n"
git clone https://github.com/ufal/lindat-dspace.git -b lindat $DSPACE_SOURCE_DIRECTORY
else
_logger "skip! $DSPACE_SOURCE_DIRECTORY already exists \n"
fi
cd $DSPACE_SOURCE_DIRECTORY/utilities/project_helpers
_loggerDate "Creating workspace..."
if [ ! -d $DSPACE_WORKSPACE ]
then
_logger "$DSPACE_WORKSPACE \n"
./setup.sh /opt/repository/workspace
else
_logger "skip! $DSPACE_WORKSPACE already exists \n"
fi
_loggerDate "Copy makefile..."
if [ ! -f $DSPACE_WORKSPACE/config/variable.makefile ]
then
cp /tmp/commul-customization/variable.makefile $DSPACE_WORKSPACE/config/
_logger "$DSPACE_WORKSPACE/config/variable.makefile\n"
else
_logger "skip! $DSPACE_WORKSPACE/config/variable.makefile already exists\n"
fi
_loggerDate "Copy local.properties..."
if [ ! -f $DSPACE_CONFIGFILE ]
then
set -x
cp /tmp/commul-customization/local.properties $DSPACE_CONFIGFILE
set +x
else
_logger "skip! $DSPACE_CONFIGFILE already exists\n"
fi
_loggerDate "Compilation and Deployment of DSpace..."
cd $DSPACE_WORKSPACE/scripts/
if [ ! -f $DSPACE_WORKSPACE/scripts/install_libs.done ]
then
make install_libs
touch $DSPACE_WORKSPACE/scripts/install_libs.done
else
_logger "already done \n"
fi
if [ ! -f $DSPACE_WORKSPACE/scripts/fresh_install.done ]
then
make compile
make fresh_install
touch $DSPACE_WORKSPACE/scripts/fresh_install.done
else
_logger "already done \n"
fi
if [ ! -f $DSPACE_WORKSPACE/scripts/postinstall.done ]
then
make postinstall
touch $DSPACE_WORKSPACE/scripts/postinstall.done
_logger "OK\n"
else
_logger "already done \n"
fi
_loggerDate "Copy aai_config.js..."
if [ ! -f $AAI_CONFIGFILE ]
then
set -x
cp /tmp/commul-customization/aai_config.js $AAI_CONFIGFILE
set +x
else
_logger "skip! $AAI_CONFIGFILE already exists\n"
fi
_loggerDate "Create dspace admin..."
if [ ! -f $DSPACE_WORKSPACE/scripts/tomcatadmin.done ]
then
su tomcat8 -c "/opt/lindat-dspace/installation/bin/dspace create-administrator"
touch $DSPACE_WORKSPACE/scripts/tomcatadmin.done
_logger "OK\n"
else
_logger "already done \n"
fi
_loggerDate "Starting Tomcat..."
/etc/init.d/tomcat8 start
sleep infinity
......@@ -18,6 +18,12 @@ spec:
labels:
io.kompose.service: dspace
spec:
initContainers:
- image: postgres
name: clarin-dspace-check-db-ready
command: ['sh', '-c',
'until pg_isready -h postgres -p 5432;
do echo waiting for database; sleep 2; done;']
containers:
- env:
- name: DSPACE_USER
......@@ -50,7 +56,7 @@ spec:
secretKeyRef:
key: mail.pass
name: dspace-secrets
image: gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/staging/dspace:1.3.2-RC1
image: gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/dspace-bundle/dspace:1.4.0-rc18
name: clarin-dspace
imagePullPolicy: Always
ports:
......@@ -62,15 +68,33 @@ spec:
volumeMounts:
- mountPath: /opt/lindat-dspace/installation/assetstore
name: dspace-assetstore
livenessProbe:
- mountPath: /opt/lindat-dspace/installation/log
name: log-dspace
- mountPath: /opt/tomcat8/logs
name: log-tomcat
- mountPath: /opt/shibboleth-sp-fastcgi/var/log/shibboleth
name: log-shibboleth
readinessProbe:
httpGet:
host: clarin-dev.eurac.edu
path: /repository/xmlui/
port: 443
scheme: HTTPS
initialDelaySeconds: 600
port: 8080
initialDelaySeconds: 120
failureThreshold: 7
periodSeconds: 15
timeoutSeconds: 5
livenessProbe:
exec:
command:
- /bin/sh
- -c
- REPLY=$(curl -s -o /dev/null -w %{http_code} https://clarin-dev.eurac.edu/repository/xmlui/);
[ "$REPLY" -lt 200 -o "$REPLY" -ge 400 ] && echo "REPLY was $REPLY" && exit 1;
ping -q -c3 -W3 postgres || exit 1;
ps aux | grep -v grep | grep -E "sleep|timeout" || exit 1;
initialDelaySeconds: 240
failureThreshold: 3
periodSeconds: 15
timeoutSeconds: 3
timeoutSeconds: 10
restartPolicy: Always
imagePullSecrets:
- name: gitlab-scientificnet-org-registry
......@@ -87,4 +111,40 @@ spec:
name: client.fs.commul.admin
user: fs.commul.admin
name: dspace-assetstore
- cephfs:
monitors:
- 10.8.55.201:6789
- 10.8.55.202:6789
- 10.8.55.203:6789
- 10.7.55.201:6789
- 10.7.55.202:6789
path: /eurac/commul/projects/clarin/kubernetes/dspace-dev/log/dspace
secretRef:
name: client.fs.commul.admin
user: fs.commul.admin
name: log-dspace
- cephfs:
monitors:
- 10.8.55.201:6789
- 10.8.55.202:6789
- 10.8.55.203:6789
- 10.7.55.201:6789
- 10.7.55.202:6789
path: /eurac/commul/projects/clarin/kubernetes/dspace-dev/log/tomcat
secretRef:
name: client.fs.commul.admin
user: fs.commul.admin
name: log-tomcat
- cephfs:
monitors:
- 10.8.55.201:6789
- 10.8.55.202:6789
- 10.8.55.203:6789
- 10.7.55.201:6789
- 10.7.55.202:6789
path: /eurac/commul/projects/clarin/kubernetes/dspace-dev/log/shibboleth
secretRef:
name: client.fs.commul.admin
user: fs.commul.admin
name: log-shibboleth
status: {}
......@@ -17,7 +17,7 @@ metadata:
if ($rewrite_https = 1) {
return 301 https://$server_name$request_uri;
}
ingress.kubernetes.io/secure-backends: "true"
kubernetes.io/tls-acme: "true"
name: dspace-ingress
namespace: dspace-dev
spec:
......@@ -26,10 +26,23 @@ spec:
http:
paths:
- backend:
# we are deliberately misusing port:443 *without* SSL, i.e. *NO*
# ingress.kubernetes.io/secure-backends: "true"
# This will result in https:// redirectes generated from shibboleth
# later on (without the need to change http:// to https://)
# see https://github.com/nginx-shib/nginx-http-shibboleth/issues/22
#
# However, make sure to disable all enforce-SSL settings, for example
# for the [dspace REST
# API](https://wiki.duraspace.org/display/DSDOC5x/REST+API).
#
# For a general overview for SP reverse proxy-ing
# see https://wiki.shibboleth.net/confluence/display/SHIB2/SPReverseProxy
#
serviceName: nginx
servicePort: 443
path: /
tls:
- hosts:
- clarin-dev.eurac.edu
secretName: host-tls-cert
secretName: clarin-dev-eurac-edu-tls
This diff is collapsed.
......@@ -11,9 +11,6 @@ metadata:
namespace: dspace-dev
spec:
ports:
- name: "80"
port: 80
targetPort: 80
- name: "443"
port: 443
targetPort: 443
......
......@@ -48,7 +48,7 @@ spec:
secretKeyRef:
key: dspace.utils.name
name: dspace-secrets
image: gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/staging/postgres:1.3.2-RC1
image: gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/dspace-bundle/postgres:1.4.0-rc18
imagePullPolicy: Always
name: clarin-postgres
resources: {}
......
pgadmin_1.png

45.9 KiB

pgadmin_2.png

209 KiB