Commit 9fed5884 authored by Julien Leduc's avatar Julien Leduc
Browse files

Adding configmap entry point for eos namespaces configuration

parent 431c996b
......@@ -58,7 +58,8 @@ mgmofs.autosaveconfig true
#-------------------------------------------------------------------------------
# Set the namespace plugin implementation
#-------------------------------------------------------------------------------
mgmofs.nslib /usr/lib64/libEosNsInMemory.so
# Done in configmap
# mgmofs.nslib /usr/lib64/libEosNsInMemory.so
# Set the endpoint and resources for EOS/CTA Workflows
mgmofs.protowfendpoint ctafrontend:10955
......
......@@ -54,6 +54,9 @@ EOS_TMP_DIR=/eos/${EOS_INSTANCE}/tmp
echo "mgmofs.protowfendpoint ctafrontend:10955" >> /etc/xrd.cf.mgm
echo "mgmofs.protowfresource /ctafrontend" >> /etc/xrd.cf.mgm
# Add configmap based configuration (initially Namespace)
test -f /etc/config/eos/xrd.cf.mgm && cat /etc/config/eos/xrd.cf.mgm >> /etc/xrd.cf.mgm
# prepare eos startup
# skip systemd for eos initscripts
export SYSTEMCTL_SKIP_REDIRECT=1
......
......@@ -9,6 +9,8 @@ config_objectstore="./objectstore-file.yaml"
config_database="./database-sqlite.yaml"
# default library model
model="mhvtl"
# defaults MGM namespace to inMemory
config_eos="./eos-config-inmemory.yaml"
# EOS short instance name
EOSINSTANCE=ctaeos
......@@ -23,6 +25,7 @@ keepobjectstore=1
usage() { cat <<EOF 1>&2
Usage: $0 -n <namespace> [-o <objectstore_configmap>] [-d <database_configmap>] \
[-e <eos_configmap>] \
[-p <gitlab pipeline ID> | -b <build tree base> -B <build tree subdir> ] \
[-S] [-D] [-O] [-m [mhvtl|ibm]]
......@@ -39,7 +42,7 @@ exit 1
die() { echo "$@" 1>&2 ; exit 1; }
while getopts "n:o:d:p:b:B:SDOm:" o; do
while getopts "n:o:d:e:p:b:B:SDOm:" o; do
case "${o}" in
o)
config_objectstore=${OPTARG}
......@@ -49,6 +52,10 @@ while getopts "n:o:d:p:b:B:SDOm:" o; do
config_database=${OPTARG}
test -f ${config_database} || error="${error}Database configmap file ${config_database} does not exist\n"
;;
e)
config_eos=${OPTARG}
test -f ${config_eos} || error="${error}EOS configmap file ${config_eos} does not exist\n"
;;
m)
model=${OPTARG}
if [ "-${model}-" != "-ibm-" ] && [ "-${model}-" != "-mhvtl-" ] ; then error="${error}Library model ${model} does not exist\n"; fi
......@@ -178,6 +185,7 @@ echo "creating configmaps in instance"
kubectl create -f ${config_objectstore} --namespace=${instance}
kubectl create -f ${config_database} --namespace=${instance}
kubectl create -f ${config_eos} --namespace=${instance}
echo -n "Requesting an unused ${model} library"
......@@ -344,6 +352,16 @@ kubectl --namespace=${instance} exec ctaeos cat /etc/eos.keytab | kubectl --name
echo OK
echo -n "Waiting for cta-frontend to be Ready"
for ((i=0; i<300; i++)); do
echo -n "."
kubectl --namespace=${instance} exec ctafrontend -- bash -c 'test -f /var/log/cta/cta-frontend.log && grep -q "cta-frontend started" /var/log/cta/cta-frontend.log' && break
sleep 1
done
kubectl --namespace=${instance} exec ctafrontend -- bash -c 'grep -q "cta-frontend started" /var/log/cta/cta-frontend.log' || die "TIMED OUT"
echo OK
echo "Instance ${instance} successfully created:"
kubectl get pods -a --namespace=${instance}
......
apiVersion: v1
kind: ConfigMap
metadata:
name: eos-config
labels:
config: eos
data:
xrd.cf.mgm: |
mgmofs.nslib /usr/lib64/libEosNsInMemory.so
......@@ -44,6 +44,8 @@ spec:
name: logstorage
- mountPath: /fst
name: stgstorage
- mountPath: /etc/config/eos
name: eosconfig
securityContext:
privileged: true
......@@ -57,6 +59,9 @@ spec:
- name: stgstorage
persistentVolumeClaim:
claimName: claimstg
- name: eosconfig
configMap:
name: eos-config
imagePullSecrets:
- name: ctaregsecret
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment