From 887aee3e57ab2b9b63c5f3be06b8ea5a523359f9 Mon Sep 17 00:00:00 2001 From: Michael Davis <michael.davis@cern.ch> Date: Thu, 1 Feb 2018 17:16:04 +0100 Subject: [PATCH] [kill-bash] Moves setting workflow from ctaeos-mgm.sh to create_instance.sh The workflow now includes the endpoint, which includes the Kubernetes namespace that the pod is running in. --- .../ctafrontend/cc7/opt/run/bin/ctaeos-mgm.sh | 21 +------------------ .../orchestration/create_instance.sh | 15 +++++++++++++ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/continuousintegration/docker/ctafrontend/cc7/opt/run/bin/ctaeos-mgm.sh b/continuousintegration/docker/ctafrontend/cc7/opt/run/bin/ctaeos-mgm.sh index 73ac3c6c34..db305fa7aa 100755 --- a/continuousintegration/docker/ctafrontend/cc7/opt/run/bin/ctaeos-mgm.sh +++ b/continuousintegration/docker/ctafrontend/cc7/opt/run/bin/ctaeos-mgm.sh @@ -179,29 +179,10 @@ test -e /usr/lib64/libjemalloc.so.1 && export LD_PRELOAD=/usr/lib64/libjemalloc. # set interval in which the WFE engine is running #eos space config default space.wfe.interval=1 -# ATTENTION -# for sss authorisation unix has to be replaced by sss - -# Set the worfklow rule for archiving files to tape -eos attr set sys.workflow.closew.default="proto/cta:ctafrontend:10955 <parent/file>" ${CTA_WF_DIR} - -# Set the worflow rule for creating tape file replicas in the EOS namespace. -eos attr set sys.workflow.archived.default="proto/cta:ctafrontend:10955 <parent/file>" ${CTA_WF_DIR} - -# Set the workflow rule for retrieving file from tape. -eos attr set sys.workflow.sync::prepare.default="proto/cta:ctafrontend:10955 <parent/file>" ${CTA_WF_DIR} - -# Set the workflow rule for the closew event of the CTA_retrieve workflow. -# Using the CTA_retrieve workflow will prevent the default workflow from -# receiving the closew event. Triggering the default workflow in this way would -# haved causes the unwanted action of copying the disk file to tape again. -# The action of the CTA_retrieve workflow when triggered by the closew event is -# to set the CTA_retrieved_timestamp attribute. -eos attr set sys.workflow.closew.CTA_retrieve="proto/cta:ctafrontend:10955 <parent/file>" ${CTA_WF_DIR} - # configure preprod directory separately /opt/run/bin/eos_configure_preprod.sh echo "### ctaeos mgm ready ###" /bin/bash + diff --git a/continuousintegration/orchestration/create_instance.sh b/continuousintegration/orchestration/create_instance.sh index fa386d25c6..9b09a44053 100755 --- a/continuousintegration/orchestration/create_instance.sh +++ b/continuousintegration/orchestration/create_instance.sh @@ -297,6 +297,21 @@ kubectl --namespace=${instance} logs ctaeos | grep -q "### ctaeos mgm ready ### echo OK +# Set the workflow rules for archiving, creating tape file replicas in the EOS namespace, retrieving +# files from tape and deleting files. +# +# The closew.CTA_retrieve workflow prevents the default workflow from receiving the closew event, as +# we don't want to trigger the action of copying the retrived disk file to tape again. The +# closew.CTA_retrieve workflow sets the CTA_retrieved_timestamp attribute. +echo "Setting workflows in namespace ${instance} pod ctaeos:" +CTA_ENDPOINT=ctafrontend.${instance}.svc.cluster.local:10955 +for WORKFLOW in closew.default archived.default sync::prepare.default closew.CTA_retrieve sync::delete.default +do + echo "eos attr set sys.workflow.${WORKFLOW}=\"proto/cta:${CTA_ENDPOINT} <parent/file>\" ${CTA_WF_DIR}" + kubectl --namespace=${instance} exec ctaeos -- bash -c "eos attr set sys.workflow.${WORKFLOW}=\"proto/cta:${CTA_ENDPOINT} <parent/file>\" ${CTA_WF_DIR}" +done + + echo -n "Copying eos SSS on ctacli and client pods to allow recalls" kubectl --namespace=${instance} exec ctaeos cat /etc/eos.keytab | kubectl --namespace=${instance} exec -i ctacli -- bash -c "cat > /etc/eos.keytab; chmod 600 /etc/eos.keytab" kubectl --namespace=${instance} exec ctaeos cat /etc/eos.keytab | kubectl --namespace=${instance} exec -i client -- bash -c "cat > /etc/eos.keytab; chmod 600 /etc/eos.keytab" -- GitLab