Skip to content

Support ansible-init for remote collections #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Aug 7, 2024
Merged

Conversation

sjpb
Copy link
Collaborator

@sjpb sjpb commented Jul 16, 2024

Enables remote ansible collections to be configured via cloud-init metadata and run via the ansible-init role.

Note that:

  1. Any pre hook can run immediately but bootstrap.yml is blocked until ansible-init has run on each node where it is installed.
  2. As ansible-init requires network access to download the specified remote collections, clusters using this functionality must have usable networking on instance boot and e.g. must not require the resolv_conf and/or proxy roles from bootstrap.yml.
  • Add linux-ansible-init role to requirements.yml

  • Run linux-ansible-init role during build so it is installed in the image - requires changes to groups and plays

  • Update the ansible/roles/cluster_infra TF templates to take variables ansible_init_collections and azimuth_init_playbooks in the caas environment and define metadata: e.g. similar to this PR for the workstation: https://github.com/stackhpc/caas-workstation/pull/22/files

  • Use defaults in the cluster_infra role for the ansible_init_* template vars instead of "if defined" guards everwhere.

  • Modify site.yml to only run once ansible-init has completed, as detected via sentinel file, when relevant.

  • Resolve name and role/collection status for ansible-init

  • Build CI image

  • Bump CI image

  • Aside: look into this:

[WARNING]: Invalid characters were found in group names but not replaced, use
-vvvv to see details

@bertiethorpe
Copy link
Member

@bertiethorpe
Copy link
Member

@bertiethorpe
Copy link
Member

@bertiethorpe
Copy link
Member

@bertiethorpe
Copy link
Member

bertiethorpe
bertiethorpe previously approved these changes Jul 25, 2024
@bertiethorpe
Copy link
Member

@bertiethorpe
Copy link
Member

@bertiethorpe bertiethorpe marked this pull request as ready for review July 26, 2024 09:21
@bertiethorpe bertiethorpe requested a review from a team as a code owner July 26, 2024 09:21
@sjpb
Copy link
Collaborator Author

sjpb commented Aug 6, 2024

Tested on a CaaS deployment using

# requirements.yml:
collections:
  - name: https://github.com/stackhpc/ansible-collection-azimuth-ops.git
    type: git
    version: feat/ansible-init-slurm
# .github/environments/arcus/inventory/group_vars/all/z_devel.yml:

infra_flavor_id: 79defe96-d6ea-4130-855f-c247bb08b6b9 #vm.ska.cpu.general.quarter

#azimuth_caas_stackhpc_slurm_appliance_git_version
azimuth_caas_stackhpc_slurm_appliance_image: db91ac07-5a40-4e78-ab69-3290b56d3322 # openhpc-ofed-RL9-240725-1710-325c7b47
admin_dashboard_ingress_basic_auth_password: <redacted>

# enable existing project manila:
azimuth_openstack_manila_project_share_gb: 40
azimuth_caas_stackhpc_slurm_appliance_home_manila_share: true
azimuth_caas_stackhpc_slurm_appliance_extra_vars_overrides:
  cluster_home_manila_share_type: ceph01_cephfs

# test ansible-init remote collections:
azimuth_caas_stackhpc_slurm_appliance_init_collections_extra:
  - type: git
    name: https://github.com/stackhpc/ansible-collection-test.git
    version: main
azimuth_caas_stackhpc_slurm_appliance_init_playbooks_extra: 
  - name: stackhpc.test_collection.test
    stage: pre

Copy link

@mkjpryor mkjpryor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sjpb sjpb merged commit eea9b74 into main Aug 7, 2024
1 check passed
@sjpb sjpb deleted the feat/linux-ansible-init branch August 7, 2024 09:06
bertiethorpe added a commit that referenced this pull request Aug 9, 2024
* Add ansible-init role to requirements.yml

* Add ansible-init to groups and plays

* Configure cluster_infra ansible-init metadata

* Only run site.yml once ansible-init has completed

* Wait for ansible init to finish before running bootstrap

* revert to using cluster_infra metadata defaults

* update image

* revert sausage bastion changes

* set ansible_init_wait as common var

* use run_number as a shorter ID for CI

* install ood apps in fatimage

* add ood jupyter install to fatimage

* bump image

* jupyter_compute ood into fatimage

* bump fatimage for jupyter_compute ood

* Update stackhpc.yml

* duplicate tuned inventory group name

* Fix invalid group name for slurmci

* Update stackhpc.yml

undo groupname changes

* slurmci group name warning

* rm ood changes

* bump fatimage

* change azimuth collection in bootstrap

* update azimuth image utils version

* update requirements

* Update bastion.yml

* Use azimuth image utils collection for ansible-init

* bump fatimage

---------

Co-authored-by: bertie <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>
sjpb added a commit that referenced this pull request Aug 14, 2024
* add trivy image scanning

* bump fatimage workflow to ubuntu 22.04

* make setup script work in CI TODO: FIXME

* fix libguestfs install

* run only 1x build per matrix entry, & only builds required

* fix packer README

* fix image download

* Use shorter names for CI clusters (#415)

* use run_number as a shorter ID for CI

* slurmci group name warning

* Revert "slurmci group name warning"  - underscores not valid linux hostname and stripped in host, leading to slurmdbd config failure

This reverts commit 61dfad6.

---------

Co-authored-by: Bertie <[email protected]>

* install ood apps in fatimage

* add ood jupyter install to fatimage

* jupyter_compute ood into fatimage

* bump fatimage

* allow items in compute mapping to have different keys e.g. only specify image_id for some compute groups (#412)

* Support ansible-init for remote collections (#411)

* Add ansible-init role to requirements.yml

* Add ansible-init to groups and plays

* Configure cluster_infra ansible-init metadata

* Only run site.yml once ansible-init has completed

* Wait for ansible init to finish before running bootstrap

* revert to using cluster_infra metadata defaults

* update image

* revert sausage bastion changes

* set ansible_init_wait as common var

* use run_number as a shorter ID for CI

* install ood apps in fatimage

* add ood jupyter install to fatimage

* bump image

* jupyter_compute ood into fatimage

* bump fatimage for jupyter_compute ood

* Update stackhpc.yml

* duplicate tuned inventory group name

* Fix invalid group name for slurmci

* Update stackhpc.yml

undo groupname changes

* slurmci group name warning

* rm ood changes

* bump fatimage

* change azimuth collection in bootstrap

* update azimuth image utils version

* update requirements

* Update bastion.yml

* Use azimuth image utils collection for ansible-init

* bump fatimage

---------

Co-authored-by: bertie <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>

* avoid python-openstackclient v7 due to rebuild bug (#420)

* Update hpctests to obey UCX_NET_DEVICES when RoCE devices present (#421)

* Turn off higher priority MPI net devices

* Update pingmatrix.sh.j2

* Update pingmatrix.sh.j2

* Update pingpong.sh.j2

* Replace j2 comments with bash

* Update pingpong.sh.j2

---------

Co-authored-by: Steve Brasier <[email protected]>

* delete trivy scanned vulnerabilities

* update grafana

* bump image

* Update environments/.stackhpc/hooks/post.yml

Co-authored-by: Steve Brasier <[email protected]>

* Update setup-env.sh

---------

Co-authored-by: Bertie <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>
MaxBed4d pushed a commit that referenced this pull request Oct 15, 2024
* Add ansible-init role to requirements.yml

* Add ansible-init to groups and plays

* Configure cluster_infra ansible-init metadata

* Only run site.yml once ansible-init has completed

* Wait for ansible init to finish before running bootstrap

* revert to using cluster_infra metadata defaults

* update image

* revert sausage bastion changes

* set ansible_init_wait as common var

* use run_number as a shorter ID for CI

* install ood apps in fatimage

* add ood jupyter install to fatimage

* bump image

* jupyter_compute ood into fatimage

* bump fatimage for jupyter_compute ood

* Update stackhpc.yml

* duplicate tuned inventory group name

* Fix invalid group name for slurmci

* Update stackhpc.yml

undo groupname changes

* slurmci group name warning

* rm ood changes

* bump fatimage

* change azimuth collection in bootstrap

* update azimuth image utils version

* update requirements

* Update bastion.yml

* Use azimuth image utils collection for ansible-init

* bump fatimage

---------

Co-authored-by: bertie <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>
MaxBed4d pushed a commit that referenced this pull request Oct 15, 2024
* add trivy image scanning

* bump fatimage workflow to ubuntu 22.04

* make setup script work in CI TODO: FIXME

* fix libguestfs install

* run only 1x build per matrix entry, & only builds required

* fix packer README

* fix image download

* Use shorter names for CI clusters (#415)

* use run_number as a shorter ID for CI

* slurmci group name warning

* Revert "slurmci group name warning"  - underscores not valid linux hostname and stripped in host, leading to slurmdbd config failure

This reverts commit 61dfad6.

---------

Co-authored-by: Bertie <[email protected]>

* install ood apps in fatimage

* add ood jupyter install to fatimage

* jupyter_compute ood into fatimage

* bump fatimage

* allow items in compute mapping to have different keys e.g. only specify image_id for some compute groups (#412)

* Support ansible-init for remote collections (#411)

* Add ansible-init role to requirements.yml

* Add ansible-init to groups and plays

* Configure cluster_infra ansible-init metadata

* Only run site.yml once ansible-init has completed

* Wait for ansible init to finish before running bootstrap

* revert to using cluster_infra metadata defaults

* update image

* revert sausage bastion changes

* set ansible_init_wait as common var

* use run_number as a shorter ID for CI

* install ood apps in fatimage

* add ood jupyter install to fatimage

* bump image

* jupyter_compute ood into fatimage

* bump fatimage for jupyter_compute ood

* Update stackhpc.yml

* duplicate tuned inventory group name

* Fix invalid group name for slurmci

* Update stackhpc.yml

undo groupname changes

* slurmci group name warning

* rm ood changes

* bump fatimage

* change azimuth collection in bootstrap

* update azimuth image utils version

* update requirements

* Update bastion.yml

* Use azimuth image utils collection for ansible-init

* bump fatimage

---------

Co-authored-by: bertie <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>

* avoid python-openstackclient v7 due to rebuild bug (#420)

* Update hpctests to obey UCX_NET_DEVICES when RoCE devices present (#421)

* Turn off higher priority MPI net devices

* Update pingmatrix.sh.j2

* Update pingmatrix.sh.j2

* Update pingpong.sh.j2

* Replace j2 comments with bash

* Update pingpong.sh.j2

---------

Co-authored-by: Steve Brasier <[email protected]>

* delete trivy scanned vulnerabilities

* update grafana

* bump image

* Update environments/.stackhpc/hooks/post.yml

Co-authored-by: Steve Brasier <[email protected]>

* Update setup-env.sh

---------

Co-authored-by: Bertie <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>
Co-authored-by: bertiethorpe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants