[dependencies] Wrong DSL implementation of deps

Bug #1629756 reported by Kirill Bespalov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fuel-ccp
In Progress
Medium
Kirill Bespalov

Bug Description

A few facts before:

1) DSL not support containers as deps, only services and jobs:
   https://github.com/openstack/fuel-ccp/blob/master/fuel_ccp/dependencies.py#L28.

2) Entrypoints scripts can do report to etcd only by containers names (or jobs), not whole service.

3) Currently fuel-ccp works just because in any fuel-ccp-{project} repository the container name the SAME that service name (service: nova-api == container: nova-api) and all services has exactly one container or several, but not used as dependency.

STEPS TO REPRODUCE:

1) fetch all fuel-ccp-* repos

2) go to fuel-ccp-nova/service/nova-libvirt.yaml and do change of container name:

service:
  name: nova-libvirt
  host-net: true
  daemonset: true
  containers:
    - name: nova-libvirt-container <--------- here (container name != service name)
      image: nova-libvirt

3) go to fuel-ccp-nova/service/nova-compute.yaml and try setup the container as dep:

service:
  name: nova-compute
  host-net: true
  daemonset: true
  containers:
    - name: nova-compute
      image: nova-compute
      privileged: true
      ...
      daemon:
        command: nova-compute --config-file /etc/nova/nova.conf
        dependencies:
          - nova-db-migrations
          - nova-libvirt-container <--------- here

4) ccp --debug -v show-dep nova-compute

EXPECTED RESULT:
all is OK

ACTUAL RESULT:

2016-10-03 05:59:53,541 ERROR cli 'nova-libvirt-container'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 387, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 59, in run
    return self.take_action(parsed_args) or 0
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/cli.py", line 156, in take_action
    dependencies.show_dep(parsed_args.components)
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/dependencies.py", line 154, in show_dep
    deps = get_deps(components, components_map)
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/dependencies.py", line 131, in get_deps
    deps, job_parents = _calculate_service_deps(service_name, deps_map)
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/dependencies.py", line 119, in _calculate_service_deps
    next_iteration_set.update([deps_map[dependency]])
KeyError: 'nova-libvirt-container'
Traceback (most recent call last):
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/cli.py", line 221, in <module>
    main()
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/cli.py", line 217, in main
    CCPApp().run(argv)
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/cli.py", line 202, in run
    return super(CCPApp, self).run(argv)
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 267, in run
    result = self.run_subcommand(remainder)
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 387, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 59, in run
    return self.take_action(parsed_args) or 0
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/cli.py", line 156, in take_action
    dependencies.show_dep(parsed_args.components)
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/dependencies.py", line 154, in show_dep
    deps = get_deps(components, components_map)
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/dependencies.py", line 131, in get_deps
    deps, job_parents = _calculate_service_deps(service_name, deps_map)
  File "/home/kbespalov/mirantis/fuel-ccp/fuel_ccp/dependencies.py", line 119, in _calculate_service_deps
    next_iteration_set.update([deps_map[dependency]])
KeyError: 'nova-libvirt-container'

Changed in fuel-ccp:
assignee: nobody → Kirill Bespalov (k-besplv)
Changed in fuel-ccp:
status: New → In Progress
Changed in fuel-ccp:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-ccp (master)

Change abandoned by Kirill Bespalov (<email address hidden>) on branch: master
Review: https://review.openstack.org/379861
Reason: Can not be implemented due https://review.openstack.org/#/c/420012/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Kirill Bespalov (<email address hidden>) on branch: master
Review: https://review.openstack.org/379861

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.