Skip to content

Add parallel argument to terraform gluescript command#346

Merged
mpagot merged 1 commit intoSUSE:mainfrom
mpagot:parallelism
Apr 14, 2025
Merged

Add parallel argument to terraform gluescript command#346
mpagot merged 1 commit intoSUSE:mainfrom
mpagot:parallelism

Conversation

@mpagot
Copy link
Copy Markdown
Collaborator

@mpagot mpagot commented Apr 11, 2025

Add --parallel to be able to control inner terraform -parallelism=N in plan and apply

Ticket: https://jira.suse.com/browse/TEAM-10214

Verification

https://openqaworker15.qa.suse.cz/tests/321203 🍏 deployment part is fine

e2e test has an example of how the --parallel feature works:

It is using this new .tf file https://github.com/SUSE/qe-sap-deployment/pull/346/files#diff-23b7f123238e99116b1db37bd902b2b36a0503f8a63da1aa6e9ff4968c168b47R1

The file is about creating 10 files and write in them the timestamp of the time they has been created.

The deployment is executed two times: with and without --parallel

Without --parallel https://github.com/SUSE/qe-sap-deployment/actions/runs/14411886450/job/40421466983?pr=346#step:10:975

File content is in https://github.com/SUSE/qe-sap-deployment/actions/runs/14411886450/job/40421466983?pr=346#step:10:1060

#./test_repo/terraform/fragola/foo.0.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.1.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.2.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.3.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.4.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.5.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.6.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.7.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.8.bar --> 2025-04-11T20:57:45Z foo!#
#./test_repo/terraform/fragola/foo.9.bar --> 2025-04-11T20:57:45Z foo!#

All of them has been created at the same time as Terraform default parallelization level is 10

Here is a second deployment with --parallel 1 https://github.com/SUSE/qe-sap-deployment/actions/runs/14411886450/job/40421466983?pr=346#step:10:1460

Each file has a different timestamp

#./test_repo/terraform/fragola/foo.0.bar --> 2025-04-11T20:58:00Z foo!#
#./test_repo/terraform/fragola/foo.1.bar --> 2025-04-11T20:58:02Z foo!#
#./test_repo/terraform/fragola/foo.2.bar --> 2025-04-11T20:57:54Z foo!#
#./test_repo/terraform/fragola/foo.3.bar --> 2025-04-11T20:57:58Z foo!#
#./test_repo/terraform/fragola/foo.4.bar --> 2025-04-11T20:57:56Z foo!#
#./test_repo/terraform/fragola/foo.5.bar --> 2025-04-11T20:57:48Z foo!#
#./test_repo/terraform/fragola/foo.6.bar --> 2025-04-11T20:57:50Z foo!#
#./test_repo/terraform/fragola/foo.7.bar --> 2025-04-11T20:58:06Z foo!#
#./test_repo/terraform/fragola/foo.8.bar --> 2025-04-11T20:57:52Z foo!#
#./test_repo/terraform/fragola/foo.9.bar --> 2025-04-11T20:58:04Z foo!#

@mpagot mpagot marked this pull request as ready for review April 14, 2025 09:49
Comment thread scripts/qesap/lib/cmds.py Outdated
look for the Terraform files
destroy (bool): destroy
dryrun (bool): enable dryrun execution mode
workspace (str): name of the workspace to activate before running th edeployment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

th edeployment => the deployment

Copy link
Copy Markdown
Collaborator

@BillAnastasiadis BillAnastasiadis left a comment

Choose a reason for hiding this comment

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

LGTM except one typo

Add --parallel to be able to control inner terraform -parallelism=N in
plan and apply
commit also include UT and e2e test. In particular the e2e test has a
debug output showing the effect of the parallelism within terraform
itself.
@mpagot mpagot merged commit 1023fb5 into SUSE:main Apr 14, 2025
3 checks passed
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