Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
61344d9d
Commit
61344d9d
authored
5 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[ci] Get the list of vids once and run tapefile_ls() on the same list each time
parent
caccceea
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
continuousintegration/orchestration/tests/client_ar.sh
+14
-13
14 additions, 13 deletions
continuousintegration/orchestration/tests/client_ar.sh
with
14 additions
and
13 deletions
continuousintegration/orchestration/tests/client_ar.sh
+
14
−
13
View file @
61344d9d
...
@@ -56,26 +56,26 @@ annotate() {
...
@@ -56,26 +56,26 @@ annotate() {
}
}
# Provide an EOS directory and list all filenames under that directory which are on tape. Output is sent to stdout.
# Provide an EOS directory and return the list of tapes containing files under that directory
# This replaces "cta-admin archivefile ls" which is deprecated in favour of "tapefile ls"
nsls_tapes
()
tapefile_ls
()
{
{
EOS_DIR
=
${
1
:-${
EOS_BASEDIR
}}
EOS_DIR
=
${
1
:-${
EOS_BASEDIR
}}
# 1. Query EOS namespace to get a list of file IDs
# 1. Query EOS namespace to get a list of file IDs
# 2. Pipe to "tape ls" to get the list of tapes where those files are archived
# 2. Pipe to "tape ls" to get the list of tapes where those files are archived
VIDLIST
=
$(
eos root://
${
EOSINSTANCE
}
find
--fid
${
EOS_DIR
}
|
\
eos root://
${
EOSINSTANCE
}
find
--fid
${
EOS_DIR
}
|
\
admin_cta
--json
tape
ls
--fidfile
/dev/stdin |
\
admin_cta
--json
tape
ls
--fidfile
/dev/stdin |
\
jq
'.[] | .vid'
|
sed
's/"//g'
)
jq
'.[] | .vid'
|
sed
's/"//g'
# 3. Feed vids to "tapefile ls" to list the contents of those tapes
}
for
vid
in
${
VIDLIST
}
# Provide a list of tapes and list the filenames of the files stored on those tapes
tapefile_ls
()
{
for
vid
in
$*
do
do
admin_cta
--json
tapefile
ls
--lookupnamespace
--vid
${
vid
}
|
\
admin_cta
--json
tapefile
ls
--lookupnamespace
--vid
${
vid
}
|
\
jq
'.[] | .df.path'
jq
'.[] | .df.path'
done
done
# If gRPC is configured in CI, we could filter to ensure we only list files in the specified
# directory and not other files which may be on the same tape:
# | grep "^${EOS_DIR}"
}
}
...
@@ -507,7 +507,8 @@ if [[ $REMOVE == 1 ]]; then
...
@@ -507,7 +507,8 @@ if [[ $REMOVE == 1 ]]; then
die
"Could not launch cta-admin command."
die
"Could not launch cta-admin command."
fi
fi
# recount the files on tape as the workflows may have gone further...
# recount the files on tape as the workflows may have gone further...
INITIALFILESONTAPE
=
$(
tapefile_ls
${
EOS_DIR
}
|
wc
-l
)
VIDLIST
=
$(
nsls_tapes
${
EOS_DIR
}
)
INITIALFILESONTAPE
=
$(
tapefile_ls
${
VIDLIST
}
|
wc
-l
)
echo
"Before starting deletion there are
${
INITIALFILESONTAPE
}
files on tape."
echo
"Before starting deletion there are
${
INITIALFILESONTAPE
}
files on tape."
#XrdSecPROTOCOL=sss eos -r 0 0 root://${EOSINSTANCE} rm -Fr ${EOS_DIR} &
#XrdSecPROTOCOL=sss eos -r 0 0 root://${EOSINSTANCE} rm -Fr ${EOS_DIR} &
KRB5CCNAME
=
/tmp/
${
EOSPOWER_USER
}
/krb5cc_0
XrdSecPROTOCOL
=
krb5 eos root://
${
EOSINSTANCE
}
rm
-Fr
${
EOS_DIR
}
&
KRB5CCNAME
=
/tmp/
${
EOSPOWER_USER
}
/krb5cc_0
XrdSecPROTOCOL
=
krb5 eos root://
${
EOSINSTANCE
}
rm
-Fr
${
EOS_DIR
}
&
...
@@ -534,7 +535,7 @@ if [[ $REMOVE == 1 ]]; then
...
@@ -534,7 +535,7 @@ if [[ $REMOVE == 1 ]]; then
echo
"Timed out after
${
WAIT_FOR_DELETED_FILE_TIMEOUT
}
seconds waiting for file to be deleted from tape"
echo
"Timed out after
${
WAIT_FOR_DELETED_FILE_TIMEOUT
}
seconds waiting for file to be deleted from tape"
break
break
fi
fi
FILESONTAPE
=
$(
tapefile_ls
${
EOS_DIR
}
>
>(
wc
-l
)
2>
>(
cat
>
/tmp/ctaerr
)
)
FILESONTAPE
=
$(
tapefile_ls
${
VIDLIST
}
>
>(
wc
-l
)
2>
>(
cat
>
/tmp/ctaerr
)
)
if
[[
$(
cat
/tmp/ctaerr |
wc
-l
)
-gt
0
]]
;
then
if
[[
$(
cat
/tmp/ctaerr |
wc
-l
)
-gt
0
]]
;
then
echo
"cta-admin COMMAND FAILED!!"
echo
"cta-admin COMMAND FAILED!!"
echo
"ERROR CTA ERROR MESSAGE:"
echo
"ERROR CTA ERROR MESSAGE:"
...
@@ -554,7 +555,7 @@ if [[ $REMOVE == 1 ]]; then
...
@@ -554,7 +555,7 @@ if [[ $REMOVE == 1 ]]; then
if
[[
${
RETRIEVED
}
-gt
${
DELETED
}
]]
;
then
if
[[
${
RETRIEVED
}
-gt
${
DELETED
}
]]
;
then
LASTCOUNT
=
${
DELETED
}
LASTCOUNT
=
${
DELETED
}
echo
"Some files have not been deleted:"
echo
"Some files have not been deleted:"
tapefile_ls
${
EOS_DIR
}
tapefile_ls
${
VIDLIST
}
else
else
echo
"All files have been deleted"
echo
"All files have been deleted"
LASTCOUNT
=
${
RETRIEVED
}
LASTCOUNT
=
${
RETRIEVED
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment