Skip to content
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

Add 2 options to runcontainer.sh #1

Merged

Conversation

nhosoi
Copy link

@nhosoi nhosoi commented Jun 26, 2023

New options:

  • --extra-rpm : specifies an additional rpm package to install in the container. Default to none. E.g., --extra-rpm diffutils --extra-rpm sudo
  • --extra-skip-tag : specifies a tag to skip. Default to none. E.g., --extra-skip-tag "tests::use_selinux_role"

Sample command line using the new options:

tox -e container-ansible-core-2.15 -- --erase-old-snapshot --extra-rpm diffutils \
--extra-skip-tag "tests::use_selinux_role" --parallel 4 \
--image-name centos-9 tests/tests_*.yml

Duration per parallel count:

==> /tmp/logging_tests.out.parallel_1 <==
  container-ansible-core-2.15: commands succeeded
  congratulations :)

real	32m7.484s
user	7m17.919s
sys	5m12.431s

==> /tmp/logging_tests.out.parallel_2 <==
  container-ansible-core-2.15: commands succeeded
  congratulations :)

real	22m1.151s
user	7m52.177s
sys	5m35.914s

==> /tmp/logging_tests.out.parallel_3 <==
  container-ansible-core-2.15: commands succeeded
  congratulations :)

real	21m0.654s
user	8m29.469s
sys	5m39.771s

==> /tmp/logging_tests.out.parallel_4 <==
  container-ansible-core-2.15: commands succeeded
  congratulations :)

real	19m55.639s
user	8m51.909s
sys	5m19.470s

==> /tmp/logging_tests.out.parallel_5 <==
  container-ansible-core-2.15: commands succeeded
  congratulations :)

real	21m2.216s
user	9m35.384s
sys	5m52.188s

The tests were executed on my laptop. We could see the improvement up to parallel == 4.

- --extra-rpm <RPM>: specifies an additional rpm package to install
      in the container. Default to none. E.g.,
      --extra-rpm diffutils --extra-rpm sudo
- --extra-skip-tag <TAG>: specifies a tag to skip. Default to none.
      E.g., --extra-skip-tag "tests::use_selinux_role"

If no `--parallel` option is given, it runs all the tests in one
ansible-playbook command line that is the original behavior.
If `--parallel` option is given, it runs each test per command
line. To run *.yml per command line in one container, '--parallel 1`
option is required.
@nhosoi nhosoi force-pushed the container-improvements.new branch from 654d23a to 5bc009f Compare June 28, 2023 19:19
@nhosoi
Copy link
Author

nhosoi commented Jun 28, 2023

Shall I add tests::use_selinux_role tag to the other roles as in this pr for the logging?
linux-system-roles/logging#338
Or we'd better leave it to each role owner?

@richm
Copy link
Owner

richm commented Jun 28, 2023

Shall I add tests::use_selinux_role tag to the other roles as in this pr for the logging? linux-system-roles/logging#338 Or we'd better leave it to each role owner?

I would prefer to use the tag named tests::uses_selinux because a test might not use the selinux role, but might use one of the selinux modules or commands directly (like the selinux role itself)

You can submit PRs for all of the roles if you like - I don't think individual role owners will mind, in fact I think they will welcome the help.

@richm richm merged commit 9c856ab into richm:container-improvements Jun 28, 2023
richm pushed a commit that referenced this pull request Jun 29, 2023
- --extra-rpm <RPM>: specifies an additional rpm package to install
      in the container. Default to none. E.g.,
      --extra-rpm diffutils --extra-rpm sudo
- --extra-skip-tag <TAG>: specifies a tag to skip. Default to none.
      E.g., --extra-skip-tag "tests::use_selinux_role"

If no `--parallel` option is given, it runs all the tests in one
ansible-playbook command line that is the original behavior.
If `--parallel` option is given, it runs each test per command
line. To run *.yml per command line in one container, '--parallel 1`
option is required.
richm pushed a commit that referenced this pull request Jul 18, 2023
- --extra-rpm <RPM>: specifies an additional rpm package to install
      in the container. Default to none. E.g.,
      --extra-rpm diffutils --extra-rpm sudo
- --extra-skip-tag <TAG>: specifies a tag to skip. Default to none.
      E.g., --extra-skip-tag "tests::use_selinux_role"

If no `--parallel` option is given, it runs all the tests in one
ansible-playbook command line that is the original behavior.
If `--parallel` option is given, it runs each test per command
line. To run *.yml per command line in one container, '--parallel 1`
option is required.
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.

2 participants