Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpc-factory
Manage
Activity
Members
Labels
Plan
Issues
77
Issue boards
Milestones
Wiki
Code
Merge requests
14
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
rc
hpc-factory
Commits
b3a983af
Commit
b3a983af
authored
1 year ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add debug flag
parent
33224d21
No related branches found
No related tags found
1 merge request
!76
Add debug flag
Pipeline
#9870
failed with stages
Stage: build
Stage: test
Stage: deploy
in 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+48
-0
48 additions, 0 deletions
.gitlab-ci.yml
with
48 additions
and
0 deletions
.gitlab-ci.yml
+
48
−
0
View file @
b3a983af
...
...
@@ -85,6 +85,9 @@ build_docker_image:
-
*get_build_date
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
docker build -t $CI_REGISTRY_IMAGE:$BUILD_DATE -t $CI_REGISTRY_IMAGE:latest .
-
>
docker run --rm $CI_REGISTRY_IMAGE bash -c
...
...
@@ -94,6 +97,9 @@ build_docker_image:
s3cmd --version &&
terraform --version'
-
docker push --all-tags $CI_REGISTRY_IMAGE
-
if [ "$DEBUG" =
true
]; then
set +x
fi
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
changes
:
...
...
@@ -105,6 +111,9 @@ build_base_image:
tags
:
-
build
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
|
if [ -n "${BUILT_BASE_IMAGE_ID}" ]; then
exit 0
...
...
@@ -127,6 +136,9 @@ build_base_image:
-
export BUILT_BASE_IMAGE_ID=$(grep 'Image:' base_build.log | awk '{print $4}')
-
echo BUILT_BASE_IMAGE_ID=${BUILT_BASE_IMAGE_ID} | tee -a $CI_PROJECT_DIR/image.env
-
openstack image unset --property signature_verified $BUILT_BASE_IMAGE_ID
-
if [ "$DEBUG" =
true
]; then
set +x
fi
artifacts
:
reports
:
dotenv
:
image.env
...
...
@@ -138,6 +150,9 @@ build_compute_image:
tags
:
-
build
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
*update_ansible_repo
-
*get_ansible_files
-
export PKR_VAR_source_image=${BUILT_BASE_IMAGE_ID}
...
...
@@ -154,6 +169,9 @@ build_compute_image:
-
packer init openstack-compute
-
packer validate openstack-compute
-
packer build -machine-readable openstack-compute | tee compute_build.log
-
if [ "$DEBUG" =
true
]; then
set +x
fi
build_gpu_image
:
stage
:
build
...
...
@@ -161,6 +179,9 @@ build_gpu_image:
tags
:
-
build
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
*update_ansible_repo
-
*get_ansible_files
-
FAILED=false
...
...
@@ -187,6 +208,9 @@ build_gpu_image:
if [ "$FAILED" = true ]; then
exit 1
fi
-
if [ "$DEBUG" =
true
]; then
set +x
fi
rules
:
-
if
:
$SKIP_GPU_BUILD == "true"
when
:
never
...
...
@@ -199,6 +223,9 @@ build_ood_image:
tags
:
-
build
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
*update_ansible_repo
-
*get_ansible_files
-
>
...
...
@@ -234,6 +261,9 @@ build_ood_image:
-
export BUILT_OOD_IMAGE_ID=$(grep 'Image:' ood_build.log | awk '{print $4}')
-
echo BUILT_OOD_IMAGE_ID=${BUILT_OOD_IMAGE_ID} | tee -a $CI_PROJECT_DIR/image.env
-
openstack image set --property CRI_XCBC_prod=${CRI_XCBC_prod} --property CRI_XCBC_dev=${CRI_XCBC_dev} --property PACKER_IMAGE_HEAD=${PACKER_IMAGE_HEAD} ${BUILT_OOD_IMAGE_ID}
-
if [ "$DEBUG" =
true
]; then
set +x
fi
artifacts
:
reports
:
dotenv
:
image.env
...
...
@@ -246,6 +276,9 @@ test_ood_image:
tags
:
-
build
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
FAILED=false
-
|
eval $(ssh-agent -s)
...
...
@@ -312,6 +345,9 @@ test_ood_image:
if [ $CI_PIPELINE_SOURCE = "schedule" ]; then
openstack server remove floating ip $NEW_INSTANCE_ID $FLOATING_IP
fi
-
if [ "$DEBUG" =
true
]; then
set +x
fi
artifacts
:
reports
:
dotenv
:
instance.env
...
...
@@ -333,9 +369,15 @@ deploy_review:
stop_review
:
stage
:
deploy
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
openstack server delete $NEW_INSTANCE_ID
-
openstack image delete $BUILT_OOD_IMAGE_ID
-
openstack floating ip delete $FLOATING_IP
-
if [ "$DEBUG" =
true
]; then
set +x
fi
environment
:
name
:
review/$CI_COMMIT_REF_SLUG
action
:
stop
...
...
@@ -352,6 +394,9 @@ deploy_knightly:
tags
:
-
build
script
:
-
if [ "$DEBUG" =
true
]; then
set -x
fi
-
|
if [ ! -z $OLD_INSTANCE_ID ]; then
openstack server remove floating ip $OLD_INSTANCE_ID $CAMPUS_IP
...
...
@@ -371,6 +416,9 @@ deploy_knightly:
for img in ${IMAGE_TO_BE_DELETE[@]}; do
openstack image delete ${img}
done
-
if [ "$DEBUG" =
true
]; then
set +x
fi
only
:
-
schedules
...
...
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