Skip to content

Adding showunique parameter to list templates and isos#4140

Merged
yadvr merged 10 commits into
apache:4.13from
shapeblue:adding-unique-template-flag
Jun 18, 2020
Merged

Adding showunique parameter to list templates and isos#4140
yadvr merged 10 commits into
apache:4.13from
shapeblue:adding-unique-template-flag

Conversation

@davidjumani
Copy link
Copy Markdown
Contributor

Description

Adds a new parameter showunique to listTemplate and listIsos to return only unique templates / isos across all zones

Fixes #4041

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1332

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-1669)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34408 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4140-t1669-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Smoke tests completed. 76 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_vpc_privategw_static_routes Failure 237.41 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 213.80 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 288.37 test_privategw_acl.py

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 11, 2020

@davidjumani have you checked if this also addresses the pagination issue?

To test, you can deploy two simulator zones and register some (fake) templates and isos. The expected outcome is listTemplates and listIsos should return unique templates/isos as well as honour pagination (test using page=1 and pagesize=1, page=2... vary both page and pagesize to see expected returns are seen).

Copy link
Copy Markdown
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

Changes/tests asked.

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 12, 2020

@davidjumani you need to package before you kick tests, esp after any code changes

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1362

@RodrigoDLopez
Copy link
Copy Markdown
Contributor

@davidjumani
I tested this enhancement with Cloudmonkey and used JQ to parse the output.
My Environment have 2 Zones and some fake templates named T copied into both zones

  • Test 01
cloudmonkey -p acs listtemplates \
templatefilter=self \
showunique=true \
| jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

Expected result: List all my templates without duplicate entries.
Result: the output brought all templates duplicates too

name:	T1	id: 422b3235-ad7f-49fa-93ec-2c2df9140569	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T2	id: 6d224f3a-057e-4be3-bf27-ea911a77b87d	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T3	id: f302a9f9-50e6-4990-a746-3185be9fa6fb	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T4	id: a10d6bb8-dea5-45a9-8e45-4fec5456c885	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T5	id: 584317d2-009e-46eb-a5b0-ef005231bd14	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T6	id: 07994afd-ec0d-4098-ba86-c5ae1a4198df	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T7	id: 09face5a-f496-47cf-a367-1e872bb1c659	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T8	id: f6e92bc2-5dbd-4c9a-bba6-1ec4f1402667	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T9	id: c79b03a0-c9c8-431a-a4a4-a11164ea2f09	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T10	id: c3c8e05c-f8b9-44f7-91c8-b9679de95b30	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T11	id: bd552d64-7354-4e51-9c57-b7991f5d3a95	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T12	id: b21ffae9-cf69-4c3e-b204-3ea9202a662a	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T3	id: f302a9f9-50e6-4990-a746-3185be9fa6fb	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T4	id: a10d6bb8-dea5-45a9-8e45-4fec5456c885	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T5	id: 584317d2-009e-46eb-a5b0-ef005231bd14	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T6	id: 07994afd-ec0d-4098-ba86-c5ae1a4198df	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T7	id: 09face5a-f496-47cf-a367-1e872bb1c659	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T8	id: f6e92bc2-5dbd-4c9a-bba6-1ec4f1402667	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T9	id: c79b03a0-c9c8-431a-a4a4-a11164ea2f09	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T10	id: c3c8e05c-f8b9-44f7-91c8-b9679de95b30	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T11	id: bd552d64-7354-4e51-9c57-b7991f5d3a95	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T12	id: b21ffae9-cf69-4c3e-b204-3ea9202a662a	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
  • Test 02
cloudmonkey -p acs listtemplates \
templatefilter=self \
pagesize=5 \
page=1 \
showunique=true \
| jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

Expected result: List only 5 templates
Result: All good, as expected

name:	T1	id: 422b3235-ad7f-49fa-93ec-2c2df9140569	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T2	id: 6d224f3a-057e-4be3-bf27-ea911a77b87d	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T3	id: f302a9f9-50e6-4990-a746-3185be9fa6fb	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T4	id: a10d6bb8-dea5-45a9-8e45-4fec5456c885	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T5	id: 584317d2-009e-46eb-a5b0-ef005231bd14	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
  • Test 03
cloudmonkey -p acs listtemplates \
templatefilter=self \
pagesize=7 \
page=1 \
showunique=true \
| jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

Expected result: List only 7 templates
Result: All good, as expected


name:	T1	id: 422b3235-ad7f-49fa-93ec-2c2df9140569	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T2	id: 6d224f3a-057e-4be3-bf27-ea911a77b87d	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T3	id: f302a9f9-50e6-4990-a746-3185be9fa6fb	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T4	id: a10d6bb8-dea5-45a9-8e45-4fec5456c885	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T5	id: 584317d2-009e-46eb-a5b0-ef005231bd14	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T6	id: 07994afd-ec0d-4098-ba86-c5ae1a4198df	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T7	id: 09face5a-f496-47cf-a367-1e872bb1c659	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
  • Test 04
cloudmonkey -p acs listtemplates \
templatefilter=self \
pagesize=9 \
page=1 \
showunique=true \
| jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

Expected result: List only 9 templates
Result: the output brought 16 templates and some duplicate entries

name:	T1	id: 422b3235-ad7f-49fa-93ec-2c2df9140569	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T2	id: 6d224f3a-057e-4be3-bf27-ea911a77b87d	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T3	id: f302a9f9-50e6-4990-a746-3185be9fa6fb	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T4	id: a10d6bb8-dea5-45a9-8e45-4fec5456c885	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T5	id: 584317d2-009e-46eb-a5b0-ef005231bd14	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T6	id: 07994afd-ec0d-4098-ba86-c5ae1a4198df	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T7	id: 09face5a-f496-47cf-a367-1e872bb1c659	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T8	id: f6e92bc2-5dbd-4c9a-bba6-1ec4f1402667	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T9	id: c79b03a0-c9c8-431a-a4a4-a11164ea2f09	zoneid: bfa05e73-7948-419f-a47d-29b498bf3ef9
name:	T3	id: f302a9f9-50e6-4990-a746-3185be9fa6fb	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T4	id: a10d6bb8-dea5-45a9-8e45-4fec5456c885	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T5	id: 584317d2-009e-46eb-a5b0-ef005231bd14	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T6	id: 07994afd-ec0d-4098-ba86-c5ae1a4198df	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T7	id: 09face5a-f496-47cf-a367-1e872bb1c659	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T8	id: f6e92bc2-5dbd-4c9a-bba6-1ec4f1402667	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T9	id: c79b03a0-c9c8-431a-a4a4-a11164ea2f09	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a

Whithout showunique parameter, I receive duplicate entries as well, but the pagesize was respected

  • Test 05
cloudmonkey -p acs listtemplates \
templatefilter=self \
pagesize=10 \
page=1 \
showunique=true \
| jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

Expected result: List only 10 templates
Result: As the test 04, I received duplicate entries, and the pagesize was not respected.
But the second page seems to be okay.

cloudmonkey -p acs listtemplates \
templatefilter=self \
pagesize=10 \
page=2 \
showunique=true \
| jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

Expected result: List the remaining templates, without duplicates.
Result: all good, bring the remaining templates, without duplicate entries

name:	T11	id: bd552d64-7354-4e51-9c57-b7991f5d3a95	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a
name:	T12	id: b21ffae9-cf69-4c3e-b204-3ea9202a662a	zoneid: 8e4d0af1-fd82-4a25-bf90-e0adfb0a4e8a

@davidjumani
Copy link
Copy Markdown
Contributor Author

@RodrigoDLopez could you try it on the latest commit. I ran it and it worked as expected :

Just the flag
cmk listtemplates templatefilter=all showunique=true | jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

name:	SystemVM Template (simulator)	id: 1e097a9f-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e
name:	CentOS 5.6 (64-bit) no GUI (Simulator)	id: 1e09b0c9-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e

With pagination
cmk listtemplates templatefilter=all showunique=true page=1 pagesize=1 | jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

name:	SystemVM Template (simulator)	id: 1e097a9f-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e

cmk listtemplates templatefilter=all showunique=true page=2 pagesize=1 | jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

name:	CentOS 5.6 (64-bit) no GUI (Simulator)	id: 1e09b0c9-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e

cmk listtemplates templatefilter=all showunique=true page=1 pagesize=2 | jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

name:	SystemVM Template (simulator)	id: 1e097a9f-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e
name:	CentOS 5.6 (64-bit) no GUI (Simulator)	id: 1e09b0c9-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e

All the templates

cmk listtemplates templatefilter=all | jq -r '.template[] | "name:\t\(.name)\tid: \(.id)\tzoneid: \(.zoneid)"'

name:	SystemVM Template (simulator)	id: 1e097a9f-aafb-11ea-a5c3-50eb71576f75	zoneid: 7eea393a-2738-46b2-a85e-12c25ccf5913
name:	SystemVM Template (simulator)	id: 1e097a9f-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e
name:	CentOS 5.6 (64-bit) no GUI (Simulator)	id: 1e09b0c9-aafb-11ea-a5c3-50eb71576f75	zoneid: 7eea393a-2738-46b2-a85e-12c25ccf5913
name:	CentOS 5.6 (64-bit) no GUI (Simulator)	id: 1e09b0c9-aafb-11ea-a5c3-50eb71576f75	zoneid: a82d7a28-e405-4456-b095-62c635951b0e

@RodrigoDLopez
Copy link
Copy Markdown
Contributor

RodrigoDLopez commented Jun 12, 2020

@davidjumani I'm already using the last commit.
I will retest. and update you

@RodrigoDLopez
Copy link
Copy Markdown
Contributor

Hi @davidjumani
I did those tests again.
Everything as expected.

My first test was fail, because those templates was not in the right state, caused by an error into my environment. My misstake.

LGTM based on manual tests

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 12, 2020

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@apache apache deleted a comment from blueorangutan Jun 13, 2020
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 13, 2020

@blueorangutan test

@davidjumani davidjumani force-pushed the adding-unique-template-flag branch from 9c71dae to b271cb3 Compare June 17, 2020 04:42
@davidjumani
Copy link
Copy Markdown
Contributor Author

davidjumani commented Jun 17, 2020

@GabrielBrascher @rhtyd comments addressed!
@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos7 ✖debian. JID-1404

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 17, 2020

@davidjumani can you merge latest master and try packaging again?

@davidjumani davidjumani force-pushed the adding-unique-template-flag branch from b271cb3 to 35b5bfa Compare June 17, 2020 05:07
@davidjumani davidjumani force-pushed the adding-unique-template-flag branch from 35b5bfa to 28137f6 Compare June 17, 2020 05:18
@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos7 ✖debian. JID-1406

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 17, 2020

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1409

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 17, 2020

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-1754)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 36757 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4140-t1754-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Smoke tests completed. 76 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_vpc_privategw_static_routes Failure 252.54 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 240.65 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 310.45 test_privategw_acl.py

@yadvr yadvr merged commit e9f59e2 into apache:4.13 Jun 18, 2020
@davidjumani davidjumani deleted the adding-unique-template-flag branch October 27, 2020 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants