Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpc-factory
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container 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
Dylan W Wheeler
hpc-factory
Commits
4aefdc03
Commit
4aefdc03
authored
11 months ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Split image clean up job to integration project
parent
4e881e50
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+16
-4
16 additions, 4 deletions
.gitlab-ci.yml
with
16 additions
and
4 deletions
.gitlab-ci.yml
+
16
−
4
View file @
4aefdc03
...
...
@@ -437,6 +437,8 @@ deploy_cheaha:
cleanup_knightly
:
stage
:
cleanup
environment
:
name
:
knightly
tags
:
-
build
script
:
...
...
@@ -445,6 +447,20 @@ cleanup_knightly:
SERVER_TO_BE_DELETE=($(openstack server list --name $OOD_INSTANCE_NAME --sort-column Image --sort-descending -f value -c ID
| awk -v NSTK=$NUM_SERVER_TO_KEEP '{count++}
{if (count>NSTK) print}'))
-
|
for svr in ${SERVER_TO_BE_DELETE[@]}; do
openstack server delete ${svr}
done
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "schedule"
when
:
always
cleanup_integration
:
stage
:
cleanup
tags
:
-
build
script
:
-
OS_PROJECT_ID=$(openstack application credential show $OS_APPLICATION_CREDENTIAL_ID -f value -c project_id)
-
openstack image list --sort-column Name --sort-descending -f value -c Name -c ID --property owner=$OS_PROJECT_ID > images.txt
-
>
OOD_IMAGE_TO_BE_DELETE=($(cat images.txt
...
...
@@ -466,10 +482,6 @@ cleanup_knightly:
| awk -v NITK=$NUM_IMAGE_TO_KEEP -v REGEX=gpu-$TIMESTAMP_REGEX
'{if ($0 ~ REGEX) result[count++] = $1}
END {for(i=NITK;i<count;i++) print result[i]}'))
-
|
for svr in ${SERVER_TO_BE_DELETE[@]}; do
openstack server delete ${svr}
done
-
|
for img in ${OOD_IMAGE_TO_BE_DELETE[@]}; do
openstack image delete ${img}
...
...
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