Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR builds two jars for utils project

  • cloud-utils-4.19.0.0-SNAPSHOT.jar : will be built into cloudstack-4.19.0.0-SNAPSHOT.jar (installed on management server) and systemvm/target/agent.zip (copied into system vms).
  • cloud-utils-4.19.0.0-SNAPSHOT-SHADED.jar , will be installed as /usr/share/cloudstack-common/lib/cloudstack-utils.jar

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6891

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@weizhouapache
Copy link
Member Author

weizhouapache commented Aug 25, 2023

@blueorangutan test matrix

@blueorangutan
Copy link

@weizhouapache a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@weizhouapache
Copy link
Member Author

@blueorangutan test ubuntu22 kvm-ubuntu22

@blueorangutan
Copy link

@weizhouapache a [SF] Trillian-Jenkins test job (ubuntu22 mgmt + kvm-ubuntu22) has been kicked to run smoke tests

@yadvr
Copy link
Member

yadvr commented Aug 25, 2023

Hi @weizhouapache thanks for the PR - can you explain, the advantage of this, for systemvms aren't we copying all dependency jars?

@DaanHoogland
Copy link
Contributor

can you explain why @weizhouapache ? It seems the jars are the same and only one needs to be built.

@weizhouapache
Copy link
Member Author

weizhouapache commented Aug 25, 2023

@rohityadavcloud @DaanHoogland

  • Without this PR (main)

During build, it creates cloud-utils-4.19.0.0-SNAPSHOT.jar which contains some dependencies, see below

cloudstack/utils/pom.xml

Lines 267 to 273 in 3b05797

<include>ch.qos.reload4j</include>
<include>com.google.crypto.tink:tink</include>
<include>com.google.protobuf:protobuf-java</include>
<include>commons-cli:commons-cli</include>
<include>commons-codec:commons-codec</include>
<include>org.apache.commons:commons-lang3</include>
<include>org.jasypt:jasypt</include>

The jar will be installed as /usr/share/cloudstack-common/lib/cloudstack-utils.jar so we can use it to encrypt/decrypt values, for example,

# java -classpath /usr/share/cloudstack-common/lib/cloudstack-utils.jar com.cloud.utils.crypt.EncryptionCLI -p password -i testinput -v
Input: testinput
Encrypted: 0SrcIiIutYYQ43s4pc9e93MUCXELM0T7uHj4UFB5sfD+IhW9rQ==

# java -classpath /usr/share/cloudstack-common/lib/cloudstack-utils.jar com.cloud.utils.crypt.EncryptionCLI -p password -i 0SrcIiIutYYQ43s4pc9e93MUCXELM0T7uHj4UFB5sfD+IhW9rQ== -d -v
Input: 0SrcIiIutYYQ43s4pc9e93MUCXELM0T7uHj4UFB5sfD+IhW9rQ==
Encrypted: testinput

This jar file will be copied to system vms (as /usr/local/cloud/systemvm/cloud-utils-4.19.0.0-SNAPSHOT.jar).

There are two issues
(1) The dependencies are also included in cloud-client-ui-4.19.0.0-SNAPSHOT.jar and deployed to management server (as part of /usr/share/cloudstack-management/lib/cloudstack-4.19.0.0-SNAPSHOT.jar). so it is not needed to built into cloudstack-4.19.0.0-SNAPSHOT.jar twice.
(2) In the testing of PR #7131, it causes that system vms do not have any logs (see discussions after #7131 (comment)) , which because log4j jars (log4j-core and log4j-api) exist in the directory /usr/local/cloud/systemvm/ and are also built into cloud-utils-4.19.0.0-SNAPSHOT.jar

  • With this PR

During build, there are two jars
(1) cloud-utils-4.19.0.0-SNAPSHOT.jar : will be built into cloudstack-4.19.0.0-SNAPSHOT.jar (installed on management server) and systemvm/target/agent.zip (copied into system vms). This does not have any dependencies. The system vm log issue with #7131 can be solved.
(2) cloud-utils-4.19.0.0-SNAPSHOT-SHADED.jar , will be installed as /usr/share/cloudstack-common/lib/cloudstack-utils.jar. This package has some dependencies and can be used separately (no need to include log4j jars in the path, like shapeblue/Trillian@master...log4j2)

(main)$ ls -l utils/target/cloud-utils-4.19.0.0-SNAPSHOT*
-rw-rw-r-- 1 weizhou weizhou  424958 Aug 25 11:07 utils/target/cloud-utils-4.19.0.0-SNAPSHOT.jar
-rw-rw-r-- 1 weizhou weizhou 6956151 Aug 25 11:07 utils/target/cloud-utils-4.19.0.0-SNAPSHOT-SHADED.jar
-rw-rw-r-- 1 weizhou weizhou  164782 Aug 25 11:07 utils/target/cloud-utils-4.19.0.0-SNAPSHOT-tests.jar

@DaanHoogland
Copy link
Contributor

ok so this depends on #7131 to make any sense, but it removes the need of a new command line for the encryption tools 👍

@weizhouapache
Copy link
Member Author

ok so this depends on #7131 to make any sense, but it removes the need of a new command line for the encryption tools 👍

yes,
moreover, no need to install log4j-core and log4j-api in /usr/share/cloudstack-common/lib/ cc @JoaoJandre

@weizhouapache
Copy link
Member Author

Hi @weizhouapache thanks for the PR - can you explain, the advantage of this, for systemvms aren't we copying all dependency jars?

@rohityadavcloud
the jars in system vms are not changed, except cloud-utils.
this avoids some jar dependencies to be loaded twice (1 jar in directory, 1 jar in cloud-utils.jar) during the start of java process in system vms and management servers, which might cause some problems.

@blueorangutan
Copy link

[SF] Trillian test result (tid-7555)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38981 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7555-xenserver-71.zip
Smoke tests completed. 111 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_01_cancel_host_maintenace_with_no_migration_jobs Error 307.52 test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobs Error 1160.30 test_host_maintenance.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-7557)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 41146 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7557-kvm-centos7.zip
Smoke tests completed. 109 look OK, 4 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_upgrade_kubernetes_cluster Failure 553.16 test_kubernetes_clusters.py
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_05_vmschedule_test_e2e Failure 389.86 test_vm_schedule.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.46 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.54 test_host_maintenance.py
test_01_cancel_host_maintenance_ssh_enabled_agent_connected Failure 20.47 test_host_maintenance.py
test_03_cancel_host_maintenance_ssh_disabled_agent_connected Failure 20.51 test_host_maintenance.py
test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected Failure 32.51 test_host_maintenance.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-7556)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 43123 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7556-vmware-67u3.zip
Smoke tests completed. 108 look OK, 5 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_trigger_shutdown Failure 336.64 test_safe_shutdown.py
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_01_unmanage_vm_cycle Error 65.08 test_vm_lifecycle_unmanage_import.py
test_01_create_volume Failure 135.51 test_volumes.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.41 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.49 test_host_maintenance.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-7559)
Environment: kvm-ubuntu22 (x2), Advanced Networking with Mgmt server u22
Total time taken: 51885 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7559-kvm-ubuntu22.zip
Smoke tests completed. 110 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_list_vms_metrics_admin Error 3609.72 test_metrics_api.py
test_list_vms_metrics_history Error 5.51 test_metrics_api.py
test_list_volumes_metrics_history Error 5.59 test_metrics_api.py
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.47 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.50 test_host_maintenance.py
test_01_cancel_host_maintenance_ssh_enabled_agent_connected Failure 20.52 test_host_maintenance.py
test_03_cancel_host_maintenance_ssh_disabled_agent_connected Failure 11.47 test_host_maintenance.py
test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected Failure 31.63 test_host_maintenance.py

@weizhouapache
Copy link
Member Author

@blueorangutan test matrix

@blueorangutan
Copy link

@weizhouapache a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-7575)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40969 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7575-xenserver-71.zip
Smoke tests completed. 111 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 445.58 test_vpc_redundant.py

@blueorangutan
Copy link

Packaging result [LL]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6170

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6934

@weizhouapache
Copy link
Member Author

@blueorangutan LLtest matrix

@blueorangutan
Copy link

@weizhouapache a [LL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[LL]Trillian test result (tid-6727)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37920 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t6727-xenserver-71.zip
Smoke tests completed. 112 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py

@blueorangutan
Copy link

[LL]Trillian test result (tid-6729)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38458 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t6729-kvm-centos7.zip
Smoke tests completed. 110 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 3652.56 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.05 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 82.50 test_kubernetes_clusters.py
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.28 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.35 test_host_maintenance.py
test_01_cancel_host_maintenance_ssh_enabled_agent_connected Failure 17.30 test_host_maintenance.py
test_03_cancel_host_maintenance_ssh_disabled_agent_connected Failure 20.34 test_host_maintenance.py
test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected Failure 28.04 test_host_maintenance.py

@blueorangutan
Copy link

[LL]Trillian test result (tid-6728)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 38923 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t6728-vmware-67u3.zip
Smoke tests completed. 109 look OK, 4 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_01_unmanage_vm_cycle Error 50.16 test_vm_lifecycle_unmanage_import.py
test_01_create_volume Failure 132.09 test_volumes.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.29 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.34 test_host_maintenance.py

@weizhouapache
Copy link
Member Author

@blueorangutan test matrix

@blueorangutan
Copy link

@weizhouapache a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-7607)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38198 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7607-kvm-centos7.zip
Smoke tests completed. 111 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.37 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.41 test_host_maintenance.py
test_01_cancel_host_maintenance_ssh_enabled_agent_connected Failure 17.38 test_host_maintenance.py
test_03_cancel_host_maintenance_ssh_disabled_agent_connected Failure 20.45 test_host_maintenance.py
test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected Failure 28.37 test_host_maintenance.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-7605)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 41214 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7605-xenserver-71.zip
Smoke tests completed. 112 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6945

@blueorangutan
Copy link

[SF] Trillian test result (tid-7606)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 47611 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t7606-vmware-67u3.zip
Smoke tests completed. 108 look OK, 5 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 698.09 test_kubernetes_clusters.py
ContextSuite context=TestVmAutoScaling>:setup Error 0.00 test_vm_autoscaling.py
test_01_unmanage_vm_cycle Error 67.84 test_vm_lifecycle_unmanage_import.py
test_01_create_volume Failure 135.45 test_volumes.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.37 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.45 test_host_maintenance.py

@weizhouapache
Copy link
Member Author

@blueorangutan LLtest matrix

@blueorangutan
Copy link

@weizhouapache a [LL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@DaanHoogland
Copy link
Contributor

@weizhouapache @JoaoJandre should this be merged with the log4j2 PR? it seems to only be relevant in that context, is it?

@weizhouapache
Copy link
Member Author

@weizhouapache @JoaoJandre should this be merged with the log4j2 PR? it seems to only be relevant in that context, is it?

@DaanHoogland
this is an independant PR, which can fix the issue with system vms in the log4j PR.

@DaanHoogland
Copy link
Contributor

@weizhouapache @JoaoJandre should this be merged with the log4j2 PR? it seems to only be relevant in that context, is it?

@DaanHoogland this is an independant PR, which can fix the issue with system vms in the log4j PR.

yes, and it is only needed if the log4j PR is merged, right?

@weizhouapache
Copy link
Member Author

@weizhouapache @JoaoJandre should this be merged with the log4j2 PR? it seems to only be relevant in that context, is it?

@DaanHoogland this is an independant PR, which can fix the issue with system vms in the log4j PR.

yes, and it is only needed if the log4j PR is merged, right?

it can reduce the package size of cloudstack packages (~4M for cloudstack-agent/common/usage/management)

image

image

again, this PR is separated. it does not matter if the log4j PR is merged or not.
The trillian tests for log4j PR do not work without this PR, unless trillian is modified.

@blueorangutan
Copy link

[LL]Trillian test result (tid-6731)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38461 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t6731-xenserver-71.zip
Smoke tests completed. 112 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_list_cpvm_vm Failure 0.02 test_ssvm.py
test_04_cpvm_internals Failure 0.03 test_ssvm.py

@blueorangutan
Copy link

[LL]Trillian test result (tid-6733)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39588 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t6733-kvm-centos7.zip
Smoke tests completed. 113 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@weizhouapache
Copy link
Member Author

@rohityadavcloud
does this looks good to you ?

@blueorangutan
Copy link

[LL]Trillian test result (tid-6732)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 43720 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7912-t6732-vmware-67u3.zip
Smoke tests completed. 113 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

@weizhouapache I did some basic tests and it LGTM.
I also tested this with #7131 and it does solve the issue. I added the log4j2 dependencies to the shaded jar and the system VM logs did not break.

@weizhouapache
Copy link
Member Author

@weizhouapache I did some basic tests and it LGTM. I also tested this with #7131 and it does solve the issue. I added the log4j2 dependencies to the shaded jar and the system VM logs did not break.

good, thanks for testing @JoaoJandre

@weizhouapache weizhouapache merged commit 2e6100d into main Sep 1, 2023
@DaanHoogland DaanHoogland added this to the 4.19.0.0 milestone Sep 29, 2023
@weizhouapache weizhouapache deleted the 4.19-build-utils-shaded-jar branch September 13, 2025 08:44
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.

5 participants