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
efa8ab3c
Commit
efa8ab3c
authored
5 years ago
by
Julien Leduc
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup leftover namespaces before launching the kubernetes CI tests
parent
64ff27f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+3
-3
3 additions, 3 deletions
.gitlab-ci.yml
continuousintegration/orchestration/run_systemtest.sh
+13
-3
13 additions, 3 deletions
continuousintegration/orchestration/run_systemtest.sh
with
16 additions
and
6 deletions
.gitlab-ci.yml
+
3
−
3
View file @
efa8ab3c
...
...
@@ -237,7 +237,7 @@ archiveretrieve:
retry
:
1
script
:
-
export NAMESPACE="archiveretrieve-${CTA_BUILD_ID}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)"
-
cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s tests/archive_retrieve.sh -O -D -t
2400
-
cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s tests/archive_retrieve.sh -O -D -t 2400
-C
artifacts
:
when
:
always
expire_in
:
30 days
...
...
@@ -254,7 +254,7 @@ repack:
retry
:
1
script
:
-
export NAMESPACE="repack-${CTA_BUILD_ID}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)"
-
cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s tests/repack_systemtest_wrapper.sh -O -D -t
2400
-
cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s tests/repack_systemtest_wrapper.sh -O -D -t 2400
-C
artifacts
:
when
:
always
expire_in
:
30 days
...
...
@@ -271,7 +271,7 @@ dbunittests_oracle:
retry
:
1
script
:
-
export NAMESPACE="dbunittestsoracle-${CTA_BUILD_ID}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)"
-
cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s /usr/bin/true -O -D -U -t
600
-
cd continuousintegration/orchestration/; ./run_systemtest.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -s /usr/bin/true -O -D -U -t 600
-C
artifacts
:
when
:
always
expire_in
:
30 days
...
...
This diff is collapsed.
Click to expand it.
continuousintegration/orchestration/run_systemtest.sh
+
13
−
3
View file @
efa8ab3c
...
...
@@ -26,7 +26,8 @@ PREFLIGHTTEST_SCRIPT='tests/preflighttest.sh'
PREFLIGHTTEST_TIMEOUT
=
60
# default systemtest timeout is 1 hour
SYSTEMTEST_TIMEOUT
=
3600
# by default do not cleanup leftover namespaces
cleanup_namespaces
=
0
die
()
{
echo
"
$@
"
1>&2
;
exit
1
;
}
...
...
@@ -43,7 +44,7 @@ Options:
-S Use systemd to manage services inside containers
-a additional kubernetes resources added to the kubernetes namespace
-U Run database unit test only
-C Cleanup leftover kubernetes namespaces
Create a kubernetes instance and launch the system test script specified.
Makes sure the created instance is cleaned up at the end and return the status of the system test.
...
...
@@ -56,7 +57,7 @@ exit 1
# always delete DB and OBJECTSTORE for tests
CREATE_OPTS
=
"-D -O"
while
getopts
"n:d:s:p:b:e:a:B:t:kDOSU"
o
;
do
while
getopts
"n:d:s:p:b:e:a:B:t:kDOSU
C
"
o
;
do
case
"
${
o
}
"
in
s
)
systemtest_script
=
${
OPTARG
}
...
...
@@ -103,6 +104,9 @@ while getopts "n:d:s:p:b:e:a:B:t:kDOSU" o; do
CREATE_OPTS
=
"
${
CREATE_OPTS
}
-U"
PREFLIGHTTEST_SCRIPT
=
'/usr/bin/true'
# we do not run preflight test in the context of unit tests
;;
C
)
cleanup_namespaces
=
1
;;
*
)
usage
;;
...
...
@@ -155,6 +159,12 @@ fi
log_dir
=
"
${
orchestration_dir
}
/../../pod_logs/
${
namespace
}
"
mkdir
-p
${
log_dir
}
if
[
$cleanup_namespaces
==
1
]
;
then
echo
"Cleaning up old namespaces:"
kubectl get namespace
-o
json | jq
'.items[].metadata | select(.name != "default" and .name != "kube-system") | .name'
| egrep
'\-[0-9]+git'
kubectl get namespace
-o
json | jq
'.items[].metadata | select(.name != "default" and .name != "kube-system") | .name'
| egrep
'\-[0-9]+git'
| xargs
-itoto
./delete_instance.sh
-n
toto
-D
echo
DONE
fi
function
execute_log
{
mycmd
=
$1
...
...
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