Skip to content

Commit

Permalink
[maas] Download only used subarches images
Browse files Browse the repository at this point in the history
- reduce download size/time for MaaS images by downloading only the
  subarch images we use;
- fix stop condition in MaaS artifact download script;
- stop importing images before updating the boot resources to prevent
  race conditions;

Change-Id: I3b15fae3463bc6c54be2cc06e0cb31edcbd307cb
Signed-off-by: Alexandru Avadanii <[email protected]>
(cherry picked from commit 7f797f1)
  • Loading branch information
alexandruavadanii committed May 25, 2018
1 parent 58615ef commit e29220a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mcp/patches/0003-maas-region-force-artifact-download.patch
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ new file mode 100644
+wait_for 30 "maas opnfv boot-resources import"
+wait_for 90 "! maas opnfv boot-resources is-importing | grep -q 'true'"
+maas opnfv rack-controllers import-boot-images || exit 3
+wait_for 30 "true {%- for arch in region.opnfv_arches %} && test -d /var/lib/maas/boot-resources/current/ubuntu/{{ arch }}{%- endfor %}"
+wait_for 30 "true {%- for arch in region.opnfv_arches.split(' ') %} && test -d /var/lib/maas/boot-resources/current/ubuntu/{{ arch }}{%- endfor %}"
2 changes: 1 addition & 1 deletion mcp/patches/0016-Set-boot-source-selections.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ diff --git a/maas/region.sls b/maas/region.sls

+boot_source_selections:
+ cmd.run:
+ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv boot-source-selection update 1 1 release='{{ region.maas_config.default_distro_series }}' {%- for arch in region.opnfv_arches.split(' ') %} arches='{{ arch }}' {%- endfor %}"
+ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv boot-resources stop-import && maas opnfv boot-source-selection update 1 1 release='{{ region.maas_config.default_distro_series }}' {%- for arch in region.opnfv_arches.split(' ') %} arches='{{ arch }}' subarches='generic' subarches='ga-16.04' subarches='hwe-16.04' {%- endfor %}"
+ - require:
+ - cmd: maas_login_admin
+ - unless: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv boot-source-selections read 1 | grep -q {{ region.maas_config.default_distro_series }}"
Expand Down

0 comments on commit e29220a

Please sign in to comment.