Skip to content
Snippets Groups Projects
Commit ddd845f0 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Reclaim the gpu even if pipeline fail

parent b6116da0
No related branches found
No related tags found
1 merge request!1Update ravi89 main
...@@ -158,6 +158,7 @@ build_gpu_image: ...@@ -158,6 +158,7 @@ build_gpu_image:
script: script:
- *update_ansible_repo - *update_ansible_repo
- *get_ansible_files - *get_ansible_files
- FAILED=false
- export GPU_PLACEHOLDER_NAME="gpu1-placeholder" - export GPU_PLACEHOLDER_NAME="gpu1-placeholder"
- export GPU_PLACEHOLDER_FLAVOR="gpu1.medium" - export GPU_PLACEHOLDER_FLAVOR="gpu1.medium"
- export GPU_PLACEHOLDER_IMAGE="CentOS-7-x86_64-GenericCloud-2009" - export GPU_PLACEHOLDER_IMAGE="CentOS-7-x86_64-GenericCloud-2009"
...@@ -174,8 +175,12 @@ build_gpu_image: ...@@ -174,8 +175,12 @@ build_gpu_image:
fi fi
- packer validate openstack-gpu - packer validate openstack-gpu
- openstack server delete --wait $GPU_PLACEHOLDER_NAME - openstack server delete --wait $GPU_PLACEHOLDER_NAME
- packer build -machine-readable openstack-gpu | tee gpu_build.log - packer build -machine-readable openstack-gpu | tee gpu_build.log || FAILED=true
- openstack server create --image $GPU_PLACEHOLDER_IMAGE --network cicd-net --flavor $GPU_PLACEHOLDER_FLAVOR $GPU_PLACEHOLDER_NAME - openstack server create --image $GPU_PLACEHOLDER_IMAGE --network cicd-net --flavor $GPU_PLACEHOLDER_FLAVOR $GPU_PLACEHOLDER_NAME
- |
if [ "$FAILED" = true ]; then
exit 1
fi
build_ood_image: build_ood_image:
stage: build stage: build
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment