New type: replace for nailgun tasks

Bug #1528517 reported by Nikita Koshikov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Invalid
High
Fuel Python (Deprecated)

Bug Description

This is feature request for implementing/extending nailgun tasks to support replacement tasks. Right now we can do:

- id: netconfig
  type: skipped

- id: netconfig-patched
  type: puppet
  groups: [primary-controller, controller, cinder, cinder-vmware, compute, ceph-osd, zabbix-server, primary-mongo, mongo, virt]
  required_for: [deploy_end]
  requires: [tools]
  parameters:
    puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/netconfig/netconfig-patched.pp
    puppet_modules: /etc/puppet/modules
    timeout: 3600

The problem with such approach that all tasks that depends on "netconfig" loose their dependencies.

We need something like this:

- id: netconfig-patched
  type: puppet
  groups: [primary-controller, controller, cinder, cinder-vmware, compute, ceph-osd, zabbix-server, primary-mongo, mongo, virt]
  replace: [netconfig]
  parameters:
    puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/netconfig/netconfig-pathced.pp
    puppet_modules: /etc/puppet/modules
    timeout: 3600

Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Hey Nikita,

The proposed variant looks like a feature, since it requires to have a special handling for "replace" attribute.

What about replacing by just using the same ID in plugin? I mean you just define a new task with the same ID, for instance:

  - id: netconfig
    type: puppet
    groups: [primary-controller, controller, cinder, cinder-vmware, compute, ceph-osd, zabbix-server, primary-mongo, mongo, virt]
    required_for: [deploy_end]
    requires: [tools]
    parameters:
      puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/netconfig/netconfig-patched.pp
      puppet_modules: /etc/puppet/modules
      timeout: 3600

Would it work for you?

Revision history for this message
Nikita Koshikov (nkoshikov) wrote :

I think that will work too.
We just need a way for rewriting tasks - the actual format of implementation is not so important. If it's easier - than lets do the same id.

Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Nikita,

I see that we only checks for conflicting between plugins:

https://github.com/openstack/fuel-web/blob/90101fb5a3c0a54ae322018e011b8e06e1842726/nailgun/nailgun/plugins/manager.py#L221-L244

So probably everything should work (AFAIR, we have designed the feature to be able to overwrite core tasks with plugins).

Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
importance: Undecided → High
status: New → Confirmed
milestone: none → 8.0
Revision history for this message
Nikita Koshikov (nkoshikov) wrote :

Thanks - such approach works. I have tested this for 2 cases:

- id: netconfig
  type: puppet
  groups: [primary-controller, controller, cinder, cinder-vmware, compute, ceph-osd, zabbix-server, primary-mongo, mongo, virt]
  required_for: [deploy_end]
  requires: [tools]
  parameters:
    puppet_manifest: netconfig.pp
    puppet_modules: /etc/puppet/modules
    timeout: 3600

- id: upload_cirros
  type: shell
  role: [primary-controller]
  requires: [enable_quorum]
  required_for: [post_deployment_end]
  parameters:
    cmd: ruby upload_cirros_fixed.rb
    retries: 3
    interval: 20
    timeout: 180

Both of them rewrite core task.

Dmitry Pyzhov (dpyzhov)
tags: added: area-python feature
Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Ok, I'll mark it as Invalid then.

Changed in fuel:
status: Confirmed → Invalid
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.