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
Eesaan Atluri
hpc-factory
Commits
0c987a24
Commit
0c987a24
authored
1 month ago
by
Eesaan Atluri
Browse files
Options
Downloads
Patches
Plain Diff
Delete the old instances before new instance deploy
parent
194f07f5
No related branches found
No related tags found
No related merge requests found
Pipeline
#14113
canceled with stages
Stage: build
Stage: deploy
in 22 minutes and 32 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+21
-0
21 additions, 0 deletions
.gitlab-ci.yml
with
21 additions
and
0 deletions
.gitlab-ci.yml
+
21
−
0
View file @
0c987a24
...
@@ -26,6 +26,7 @@ variables:
...
@@ -26,6 +26,7 @@ variables:
INSTANCE_FLAVOR
:
"
m1.medium-ruffner"
INSTANCE_FLAVOR
:
"
m1.medium-ruffner"
HTTP_PROXY_INSTANCE_NAME
:
"
http-proxy"
HTTP_PROXY_INSTANCE_NAME
:
"
http-proxy"
SSH_PROXY_INSTANCE_NAME
:
"
ssh-proxy"
SSH_PROXY_INSTANCE_NAME
:
"
ssh-proxy"
NUM_SERVERS_TO_KEEP
:
"
1"
stages
:
stages
:
-
build
-
build
...
@@ -379,6 +380,26 @@ deploy_ood_node:
...
@@ -379,6 +380,26 @@ deploy_ood_node:
name
:
$ENV
name
:
$ENV
tags
:
tags
:
-
build
-
build
before_script
:
-
|
for OOD_FLOATING_IP in ${OOD_FLOATING_IP_LIST[@]}; do
CURRENT_INSTANCE_ID=$(
openstack server list \
--name $OOD_INSTANCE_NAME --ip $OOD_FLOATING_IP -c ID -f value)
break
done
SERVERS_TO_BE_DELETED=($(
openstack server list --name $OOD_INSTANCE_NAME \
--sort-column Image --sort-descending -f value -c ID | \
awk -v NSTK=$NUM_SERVERS_TO_KEEP -v CID=$CURRENT_INSTANCE_ID \
'$0 != CID {count++} \
$0 != CID && count>NSTK {print}'
))
-
|
for svr in ${SERVERS_TO_BE_DELETED[@]}; do
echo "Deleting server $svr"
openstack server delete ${svr}
done
script
:
script
:
-
OOD_IMAGE_ID="${BUILT_OOD_IMAGE_ID:-$OOD_IMAGE_ID}"
-
OOD_IMAGE_ID="${BUILT_OOD_IMAGE_ID:-$OOD_IMAGE_ID}"
-
openstack image set --accept $OOD_IMAGE_ID ||
true
-
openstack image set --accept $OOD_IMAGE_ID ||
true
...
...
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