infiniband_container_image.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Image creation (It may take 5-10 mins)
  16. command: "buildah bud -t {{ infiniband_image_name }}:{{ infiniband_image_tag }} --network host ."
  17. changed_when: true
  18. args:
  19. chdir: "{{ role_path }}/files/"
  20. - name: Update image name in k8s_infiniband.yml
  21. replace:
  22. path: "{{ ib_kube_config_file }}"
  23. regexp: 'localhost/infiniband-container:latest'
  24. replace: "localhost/{{ infiniband_image_name }}:{{ infiniband_image_tag }}"
  25. - name: Update omnia project path in k8s_infiniband.yml
  26. replace:
  27. path: "{{ ib_kube_config_file }}"
  28. regexp: ' - name: omnia-storage\n hostPath:\n path:.*'
  29. replace: " - name: omnia-storage\n hostPath:\n path: {{ role_path.split('control_plane')[0] }}"
  30. - name: Replace container name in sm config file
  31. replace:
  32. path: "{{ ib_kube_config_file }}"
  33. regexp: " containers:\n - name:.*"
  34. replace: " containers:\n - name: {{ ib_container_name }}"
  35. - name: Replace image name in sm config file
  36. replace:
  37. path: "{{ ib_kube_config_file }}"
  38. regexp: " image:.*"
  39. replace: " image: 'localhost/{{ infiniband_image_name }}:{{ infiniband_image_tag}}'"
  40. - name: Replace cache directory in sm config file
  41. replace:
  42. path: "{{ ib_kube_config_file }}"
  43. regexp: " - name: opensm-cache\n hostPath:\n path:.*"
  44. replace: " - name: opensm-cache\n hostPath:\n path: {{ subnet_manager.cache_directory }} "
  45. - name: Replace cache directory in sm config file
  46. replace:
  47. path: "{{ ib_kube_config_file }}"
  48. regexp: " - name: opensm-logs\n hostPath:\n path:.*"
  49. replace: " - name: opensm-logs\n hostPath:\n path: {{ subnet_manager.log_directory }} "
  50. - name: Deploy infiniband pod
  51. command: "kubectl apply -f {{ ib_kube_config_file }}"
  52. changed_when: true