Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Software Heritage virtual environment packaging manifests
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
Container Registry
Model registry
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
Platform
Infrastructure
Software Heritage virtual environment packaging manifests
Commits
bf56fc48
Verified
Commit
bf56fc48
authored
1 year ago
by
Vincent Sellier
Browse files
Options
Downloads
Patches
Plain Diff
swh-scrubber: Refactor the entrypoint to not only support database scrubbers
Related to
swh/infra/sysadm-environment#5108
parent
c0d16fe9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/swh-scrubber/entrypoint.sh
+18
-27
18 additions, 27 deletions
apps/swh-scrubber/entrypoint.sh
with
18 additions
and
27 deletions
apps/swh-scrubber/entrypoint.sh
+
18
−
27
View file @
bf56fc48
#!/bin/bash
if
[
-e
"
${
SWH_CONFIG_FILENAME
}
"
]
;
then
echo
"The config file
${
SWH_CONFIG_FILENAME
}
does not exist."
exit
1
fi
ENV_VARS
=
"LOGLEVEL STATSD_TAGS OBJECT_TYPE PARTITION_COUNT FIRST_PARTITION LAST_PARTITION"
ERROR
=
0
for
VAR
in
${
ENV_VARS
}
;
do
if
[
-z
"
${
!VAR
}
"
]
;
then
echo
"The
${
VAR
}
environment variable must be set"
ERROR
=
1
fi
done
if
[
$ERROR
-ne
0
]
;
then
exit
1
fi
echo
"Starting scrubber for OBJECT_TYPE=
${
OBJECT_TYPE
}
from FIRST_PARTITION=
${
FIRST_PARTITION
}
to LAST_PARTITION=
${
LAST_PARTITION
}
"
exec
swh
\
--log-level
$LOGLEVEL
\
scrubber check storage
\
--object-type
${
OBJECT_TYPE
}
\
--nb-partitions
${
NB_PARTITIONS
}
\
--start-partition-id
${
START_OBJECT
}
\
--end-partition-id
${
END_OBJECT
}
case
"
$1
"
in
"shell"
)
shift
if
((
$#
==
0
))
;
then
exec
bash
-i
else
"
$@
"
fi
;;
"swh"
)
shift
echo
"Running swh command
$@
"
exec
swh
$@
;;
*
)
echo
Unknown
command
$@
exit
1
esac
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