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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Molecule testing for Singularity, plus infra for more roles #1088
Conversation
676d129
to
75d2fbf
Compare
cdaac35
to
bcdb847
Compare
Summary ------- - Fixes the ability to install Singularity on EL8 by enabling the necessary repos - Move the pre-execution logic for the Singularity Galaxy role into a new DeepOps role, singularity_wrapper - Modify the playbook to use singularity_wrapper - Add Molecule tests to singularity_wrapper role - Add a Github Action configuration to execute this and other Molecule tests of DeepOps roles - Add documentation to `docs/deepops/testing.md` to describe these tests and provide instructions on adding more Test plan --------- Clean execution of the Github action for this role Future work ----------- This change adds a lot of infrastructure that should make it easier to add testing to additional roles. Future changes should enable testing of more of the roles in DeepOps, but I didn't want to get *too* carried away in this one. 馃槈
Annoyingly, includes in requirements.yml seem to be relative to the cwd of ansible-galaxy, rather than relative to the requirements file. ansible/ansible#46385 Made changes to setup.sh in order to ensure we can install requirements even if we use includes.
Just check that we actually install Singularity
fe750de
to
123ae29
Compare
@dholt : This should be ready to test now! I simplified the requirements file handling for Github actions. |
scripts/setup.sh
Outdated
as_user ansible-galaxy collection install --force -r "${ROOT_DIR}/roles/requirements.yml" >/dev/null | ||
as_user ansible-galaxy role install --force -r "${ROOT_DIR}/roles/requirements.yml" >/dev/null | ||
as_user ansible-galaxy collection install --force -i -r "${ROOT_DIR}/config/requirements.yml" >/dev/null | ||
as_user ansible-galaxy role install --force -i -r "${ROOT_DIR}/config/requirements.yml" >/dev/null | ||
initial_dir="$(pwd)" | ||
roles_path="${ROOT_DIR}/roles/galaxy" | ||
collections_path="${ROOT_DIR}/collections" | ||
|
||
# First, install requirements from role requirements. | ||
# Note: due to a known issue in ansible-galaxy, this works best when the | ||
# cwd is the same as the directory where the file is located. | ||
# https://github.com/ansible/ansible/issues/46385 | ||
cd "${ROOT_DIR}/roles" | ||
as_user ansible-galaxy collection install -p "${collections_path}" --force -r "requirements.yml" >/dev/null | ||
as_user ansible-galaxy role install -p "${roles_path}" --force -r "requirements.yml" >/dev/null | ||
|
||
# Install any user-defined config requirements | ||
if [ -d "${CONFIG_DIR}" ]; then | ||
cd "${CONFIG_DIR}" | ||
as_user ansible-galaxy collection install -p "${collections_path}" --force -i -r "requirements.yml" >/dev/null | ||
as_user ansible-galaxy role install -p "${roles_path}" --force -i -r "requirements.yml" >/dev/null | ||
fi | ||
cd "${initial_dir}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still getting this warning and these errors when running the setup script:
Not entirely sure about this one since it seems properly set in the ansible.cfg
file. Is the setup script no longer using the virtual env?
[WARNING]: The specified collections path '/home/ubuntu/deepops/collections' is not part of the configured Ansible collections paths '/home/ubuntu/.ansible/collections:/usr/share/ansible/collections'. The installed collection won't be picked up in an Ansible run.
Wondering if this is because the collections
and roles
vars in the config/requirements.yml
file are empty?
ERROR! Unexpected Exception, this is probably a bug: 'NoneType' object is not iterable
ERROR! Unexpected Exception, this is probably a bug: 'NoneType' object is not iterable
Summary
necessary repos
new DeepOps role, singularity_wrapper
singularity_wrapper role, and include this from
roles/requirements.yml
tests of DeepOps roles
docs/deepops/testing.md
to describe these testsand provide instructions on adding more
Test plan
Future work
This change adds a lot of infrastructure that should make it easier to
add testing to additional roles. Future changes should enable testing of
more of the roles in DeepOps, but I didn't want to get too carried
away in this one. 馃槈