Skip to content

add --not-reinstall-collections for quicker deployment#280

Open
Yong HU (huyong1979) wants to merge 2 commits into
NSLS2:mainfrom
huyong1979:install_collection
Open

add --not-reinstall-collections for quicker deployment#280
Yong HU (huyong1979) wants to merge 2 commits into
NSLS2:mainfrom
huyong1979:install_collection

Conversation

@huyong1979

Copy link
Copy Markdown
Contributor

An improvement for issue #275.
By default, pixi run deployment -l ioc_full_host_name -c ../ioc_host_vars/acc_or_xf/ioc_full_host_name/ioc_instance_name.yml still re-installs the latest Galaxy collections by the command ansible-galaxy collection install ..., that takes more than 90 seconds, the majority of deployment time. For a quicker testing, one can use the option --not-reinstall-collections to skip the re-installation of the Galaxy collections if he/she is pretty sure the collections are already up-to-date.

Copilot AI review requested due to automatic review settings July 9, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds an opt-out switch to speed up local deployments by avoiding a forced reinstall/rebuild of the local nsls2.ioc_deploy Ansible collection on each run, addressing the long ansible-galaxy collection install ... --force step reported in issue #275.

Changes:

  • Introduces --not-reinstall-collections to skip reinstalling/rebuilding the local nsls2.ioc_deploy collection.
  • Refactors the local collection install step into a helper (install_local_collection) and makes it conditional on the new flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/deploy_local_config.py
@jwlodek

Copy link
Copy Markdown
Collaborator

Yong HU (@huyong1979) I think adding the flag is fine - the reason we need to re-install the collection is if you make updates to the roles they will not be used unless the collection is installed. A lot of the time it takes is because you are likely running from runansible in your home directory which is a network file system, and the install makes lots of file operations. I suspect if you copy your project structure to /tmp it will take less time. Another potential option would be to create the collections directory manually, and then make softlinks to all the necessary directories (the collection install basically is just copying roles/ vars/ etc.)

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