Bug 1124094
| Summary: | oo-admin-upgrade does not work for unsupported cartridges | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Kenjiro Nakayama <knakayam> |
| Component: | oc | Assignee: | Brenton Leanhardt <bleanhar> |
| Status: | CLOSED ERRATA | QA Contact: | libra bugs <libra-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 2.1.0 | CC: | adellape, bleanhar, cryan, erich, jhonce, jialiu, jokerman, libra-onpremise-devel, mmccomas, pep, pmorie |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
The oo-admin-upgrade tool previously only upgraded existing gears that included cartridges provided by Red Hat; specifically, only cartridges that defined "redhat" as the vendor in its manifest were affected. This bug fix updates the tool to also support upgrading gears that include any cartridge that exists in a node's cartridge repository, including custom cartridges and those provided by other vendors.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-09-11 20:06:38 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/ba260f9f0b87e77b7b09174755a2d2e075a1654a Bug 1124094 - oo-admin-upgrade does not work for unsupported cartridges Fixed in: openshift-origin-msg-common-1.19.2.1-1.el6op openshift-origin-node-util-1.22.16.1-1.el6op openshift-origin-msg-node-mcollective-1.22.2.1-1.el6op rubygem-openshift-origin-controller-1.23.10.10-1.el6op rubygem-openshift-origin-node-1.23.9.17-1.el6op Verified this bug with 2.1.z/2014-08-25.2, and PASS. According to comment 4 and comment 13, I use the following steps to run upgrade process from 2.0 to 2.1 to be closer to user scenarios. Reproduce steps: 1. Setup env using 2.0.z puddle. 2. Install openshift-origin-cartridge-mock-1.16.1-2.el6op.noarch.rpm on node. 3. Modify /usr/libexec/openshift/cartridges/mock/metadata/manifest.yml changing the Vendor and Cartridge-Vendor fields 4. Create /usr/libexec/openshift/cartridges/mock/bin/upgrade and make sure it it chmod 755. # cat /usr/libexec/openshift/cartridges/mock/bin/upgrade #!/bin/bash -eu touch "/share/dd${RANDOM}" 5. mkdir /share; chmod 777 /share; chcon system_u:object_r:openshift_var_lib_t:s0 /share/ 6. On node, Restart mcollective service. 7. On node, oo-admin-broker-cache -c --console; /etc/init.d/openshift-broker restart 8. Create app using custom mock cartridge. 9. Run ose-upgrade to finish upgrade process from 2.0 to 2.1 only with ose-2.1 release repo, get the following output: + /usr/libexec/openshift/ose-upgrade-migrate-datastore --postrelease Starting postrelease migrations.+ /usr/libexec/openshift/ose-upgrade-migrate-datastore --postrelease Starting postrelease migrations. Running migration Migrate_2_0_39... Ensure new domain_id / canonical_name index on applications ... done Drop old domain_id index on applications ... done Drop old group_instances_gears_uuid_1 index on applications ... not found Remove empty or nil 'component_configure_order' from all applications ... 2 updated Remove empty or nil 'component_start_order' from all applications ... 2 updated Remove empty or nil 'component_stop_order' from all applications ... 2 updated Migration Migrate_2_0_39 finished. Running migration Migrate_2_0_40... Sending alias and SSL cert info to secondary proxy gears for all HA apps... Done. Sent alias and SSL cert info for 0 applications. Removing downloaded_cart_map for all applications (attempt #1) ... Migrated 0 applications with downloadable cartridges Ensuring all component instances have a cartridge_id (attempt #1) ... WARNING: Application 53fc70df96511d396c000001 has component instance with name jialiu-mock-0.1 that isn't an active cartridge. Migrated 1 applications Some applications had pending ops, retrying Ensuring all component instances have a cartridge_id (attempt #2) ... WARNING: Application 53fc70df96511d396c000001 has component instance with name jialiu-mock-0.1 that isn't an active cartridge. Migrated 0 applications Some applications had pending ops, retrying Ensuring all component instances have a cartridge_id (attempt #3) ... WARNING: Application 53fc70df96511d396c000001 has component instance with name jialiu-mock-0.1 that isn't an active cartridge. Migrated 0 applications Some applications had pending ops, retrying Ensuring all component instances have a cartridge_id (attempt #4) ... WARNING: Application 53fc70df96511d396c000001 has component instance with name jialiu-mock-0.1 that isn't an active cartridge. ERROR: Not all applications migrated after 4 tries, pending ops queue prevented changes. Migrated 0 applications Migration Migrate_2_0_40 finished. Running migration Migrate_2_0_41... Executing execution hooks for 0 applications... Done. Updated LD_LIBRARY_PATH for 0 applications. Migration Migrate_2_0_41 finished. Running migration Migrate_2_0_42... Starting migration: postrelease Migration complete Migration Migrate_2_0_42 finished. Migrations complete. Done! --END /usr/lib/ruby/site_ruby/1.8/ose-upgrade/broker/upgrades/3/post/05-broker-migrate-datastore-postrelease OUTPUT-- 10. In /var/log/openshift/broker/upgrade/upgrade_results_node.ose-20.com.cn, will see "No upgrade available for cartridge jialiu:mock:0.1:0.0.1, jialiu not supported.", and no any file is created under /share Re-run the above steps, and feed 2.1.z latest puddle repo in step 9, ose-upgrade is finished successfully without any warnning and error, and no "No upgrade available for cartridge jialiu:mock:0.1:0.0.1, jialiu not supported." is seen in upgrade log. But there is no any file generated in /share, after check upgrade log, found "No upgrade required for cartridge jialiu:mock:0.1:0.0.1, already at latest version 0.0.1.", that is because during upgrade, mock cartridge is updated to openshift-origin-cartridge-mock-1.18.2-1.el6op.noarch, so my chagne in step 3 is reverted. Then continue the following steps: * Modify /usr/libexec/openshift/cartridges/mock/metadata/manifest.yml changing the Vendor and Cartridge-Vendor fields, and increment the Cartridge-Version. * On the Node: service ruby193-mcollective restart * On the Broker: oo-admin-ctl-cartridge -c import-node --activate --obsolete * On the Broker: oo-admin-ctl-cartridge -c migrate * On the Broker: oo-admin-upgrade archive * On the Broker: oo-admin-upgrade upgrade-node --version=2.1 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1183.html |
Description of problem: oo-admin-upgrade only work on redhat cartridge, it does not work on other vender's (custome) cartridges. And it will not upgrade custom cartridges even if the cartridge define upgrade scripts. Version: OSE 2.0, 2.1 How reproducible: Use oo-admin-upgrade to other vender's (custome) cartridges. The cause of this bug: The current code has the string 'redhat' hardcoded in the check. (See below) $OSE_SRC/node/lib/openshift-origin-node/model/upgrade.rb = OSE 2.1 = 379 unless vendor == 'redhat' 380 progress.log "No upgrade available for cartridge #{ident}, #{vendor} not supported." 381 next 382 end Actual results: We will get "No upgrade available for cartridge ${OTHER_VENDER_NAME}:${CARTRIDGE_NAME}:3.2.4:0.1, ${OTHER_VENDER_NAME not supported.". Expected results: It should work on any cartridge