Provision as a graph failed as $ can't be modified on-the-fly anymore

Bug #1630275 reported by Stanislaw Bogatkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Stanislaw Bogatkin
Mitaka
Fix Released
High
Stanislaw Bogatkin
Newton
In Progress
High
Stanislaw Bogatkin
Ocata
Fix Committed
High
Stanislaw Bogatkin

Bug Description

When run provision as a graph, it doesn't work anymore because context is not modifiable object anymore. We need to change $.provision.packages representation to list in this case.

Steps to reproduce:
1. Install master node
2. Create cluster
3. Create custom graph with task which can modify '$'. In my case it was a task with yaql_exp: "($.provision.set('packages', $.provision.packages.split('\n')) + $.repo_setup + dict('output' => '/var/www/nailgun/targetimages') + $).toYaml()"
4. Upload this graph to nailgun
5. Run this graph on created cluster

Expected behavior:
Graph will work flawlessly

Actual behavior:
Graph will fail with error

How to solve this problem:
Change yaql expression to not to modify root context.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (master)

Fix proposed to branch: master
Review: https://review.openstack.org/381911

Changed in fuel:
status: New → In Progress
assignee: Stanislaw Bogatkin (sbogatkin) → Bulat Gaifullin (bgaifullin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/381913

Changed in fuel:
assignee: Bulat Gaifullin (bgaifullin) → Maksim Malchuk (mmalchuk)
Changed in fuel:
assignee: Maksim Malchuk (mmalchuk) → Bulat Gaifullin (bgaifullin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/382792

Changed in fuel:
assignee: Bulat Gaifullin (bgaifullin) → Stanislaw Bogatkin (sbogatkin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/381913
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=95fae7972a71aaa557a5a57f403fbe6c194b94ca
Submitter: Jenkins
Branch: master

commit 95fae7972a71aaa557a5a57f403fbe6c194b94ca
Author: Bulat Gaifullin <email address hidden>
Date: Tue Oct 4 18:04:01 2016 +0300

    Added list of packages to provision info

    Provision info already contains list of packages as
    string, but fa_builder expects list and conversion from
    string to list was done by using yaql expression.
    This patch moves this conversion to nailgun side.

    Change-Id: I1ad44b7f2e69edbb8b8e28fd7840010af2594cd7
    Closes-Bug: 1630275

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-web 10.0.0rc1

This issue was fixed in the openstack/fuel-web 10.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/mitaka)

Reviewed: https://review.openstack.org/382792
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=b7b2dfffbf5496518f5451841a2abf9cc75dc109
Submitter: Jenkins
Branch: stable/mitaka

commit b7b2dfffbf5496518f5451841a2abf9cc75dc109
Author: Bulat Gaifullin <email address hidden>
Date: Tue Oct 4 18:04:01 2016 +0300

    Added list of packages to provision info

    Provision info already contains list of packages as
    string, but fa_builder expects list and conversion from
    string to list was done by using yaql expression.
    This patch moves this conversion to nailgun side.

    Change-Id: I1ad44b7f2e69edbb8b8e28fd7840010af2594cd7
    Closes-Bug: 1630275

tags: added: hard-to-verify
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (master)

Reviewed: https://review.openstack.org/381911
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=05d76d4946f46b0b52d2c0dc256fbbc4f2c84ef3
Submitter: Jenkins
Branch: master

commit 05d76d4946f46b0b52d2c0dc256fbbc4f2c84ef3
Author: Stanislaw Bogatkin <email address hidden>
Date: Tue Oct 4 18:07:42 2016 +0300

    Get provision packages data as list

    To avoid context modifying, get data about packages for provisioning
    as a list directly from nailgun on serialization stage.

    Change-Id: Id05a61b2a296710aafd67327d1e066e6838de185
    Closes-Bug: #1630275

description: updated
tags: added: on-verification
Revision history for this message
Alexey. Kalashnikov (akalashnikov) wrote :

Verified on 9.2:
shotgun2 report
http://paste.openstack.org/show/587253/

tags: removed: on-verification
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-web 10.0.0

This issue was fixed in the openstack/fuel-web 10.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/421768

Revision history for this message
Stanislaw Bogatkin (sbogatkin) wrote :

reopened for 9.2 as fuel-library part was never merged in it. Addressed by https://review.openstack.org/#/c/421768/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/421834

Changed in fuel:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (stable/mitaka)

Reviewed: https://review.openstack.org/421768
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=ad42f5eec9a79a3656b0fff9e78946f4b07b92ca
Submitter: Jenkins
Branch: stable/mitaka

commit ad42f5eec9a79a3656b0fff9e78946f4b07b92ca
Author: Stanislaw Bogatkin <email address hidden>
Date: Tue Oct 4 18:07:42 2016 +0300

    Get provision packages data as list

    To avoid context modifying, get data about packages for provisioning
    as a list directly from nailgun on serialization stage.

    Change-Id: Id05a61b2a296710aafd67327d1e066e6838de185
    Closes-Bug: #1630275
    (cherry picked from commit 05d76d4946f46b0b52d2c0dc256fbbc4f2c84ef3)

tags: added: on-verification
Revision history for this message
TatyanaGladysheva (tgladysheva) wrote :

Verified on 9.2 snapshot #779.

Before the fix provision graph contains task 'upload_provision_info_master' with appropriate yaql_exp as in step 3 of bug description and after uploading and executing this graph deployment was not finished successfully. Errors before the fix: http://paste.openstack.org/show/595311/.

After the fix deployment with provision graph is finished successfully:
[root@nailgun ~]# fuel2 graph upload -e 3 -t provision -d /etc/fuel/graphs/provision/
Deployment graph was successfully uploaded.
[root@nailgun ~]# fuel2 graph execute -e 3 -t provision
Deployment task with id 23 for the environment 3 has been started.

[root@nailgun ~]# fuel2 task list -e 3
+----+--------+------------+------------+---------+--------+---------+----------+
| id | status | name | graph_type | cluster | result | dry_run | progress |
+----+--------+------------+------------+---------+--------+---------+----------+
| 23 | ready | deploy | None | 3 | {} | False | 100 |
| 24 | ready | deployment | provision | 3 | {} | False | 100 |
+----+--------+------------+------------+---------+--------+---------+----------+
[root@nailgun ~]# fuel2 task history show 24 | grep upload_provision_info_master
| upload_provision_info_master | master | ready | 2017-01-19T08:20:41.211657 | 2017-01-19T08:20:41.241351 |

tags: removed: on-verification
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-library 11.0.0.0rc1

This issue was fixed in the openstack/fuel-library 11.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/newton)

Change abandoned by Stanislaw Bogatkin (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/421834
Reason: Abandon in favor of already merged patches which are used similar code fix.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.