VOLTTRON / volttron-docker

Docker based images for different volttron instance types.
13 stars 21 forks source link

docker-compose-rmq.yml #23

Closed GHYOON closed 3 years ago

GHYOON commented 3 years ago

I got the following issue when running "docker-compose -f docker-compose-rmq.yml up" script.

volttron1   | 2021-02-15 07:36:35,891 () volttron.platform.vip.proxy_zmq_router DEBUG: Proxy ZMQ Router b'["listener", "", "VIP1", "", "", "pubsub", "subscribe", "{\\"prefix\\": \\"\\", \\"bus\\": \\"\\", \\"all_platforms\\": true}"]'
volttron1   | Traceback (most recent call last):
volttron1   |   File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
volttron1   |   File "/usr/local/lib/python3.7/dist-packages/pika/adapters/gevent_connection.py", line 112, in _read_loop
volttron1   |     self._handle_read()
volttron1   |   File "/usr/local/lib/python3.7/dist-packages/pika/adapters/base_connection.py", line 453, in _handle_read
volttron1   |     self._on_data_available(data)
volttron1   |   File "/usr/local/lib/python3.7/dist-packages/pika/connection.py", line 1908, in _on_data_available
volttron1   |     self._process_frame(frame_value)
volttron1   |   File "/usr/local/lib/python3.7/dist-packages/pika/connection.py", line 2042, in _process_frame
volttron1   |     self._deliver_frame_to_channel(frame_value)
volttron1   |   File "/usr/local/lib/python3.7/dist-packages/pika/connection.py", line 1455, in _deliver_frame_to_channel
volttron1   |     self._channels[value.channel_number]._handle_content_frame(value)
volttron1   |   File "/usr/local/lib/python3.7/dist-packages/pika/channel.py", line 996, in _handle_content_frame
volttron1   |     self._on_deliver(*response)
volttron1   |   File "/usr/local/lib/python3.7/dist-packages/pika/channel.py", line 1125, in _on_deliver
volttron1   |     header_frame.properties, body)
volttron1   |   File "/code/volttron/volttron/platform/vip/proxy_zmq_router.py", line 239, in outbound_request_handler
volttron1   |     self.zmq_router.pubsub.handle_subsystem(frames)
volttron1   |   File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 628, in handle_subsystem
volttron1   |     result = self._peer_subscribe(frames)
volttron1   |   File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 203, in _peer_subscribe
volttron1   |     prefix = msg['prefix']
volttron1   | TypeError: string indices must be integers
volttron1   | 2021-02-15T07:36:35Z <Greenlet at 0x7fbe5e9236a8: <bound method GeventConnection._read_loop of <GeventConnection OPEN socket=('172.18.0.2', 52452)->('172.18.0.2', 5671) params=<ConnectionParameters host=volttron1 port=5671 virtual_host=volttron ssl=True>>>> failed with TypeError
volttron1   | ERROR:volttron.platform.packaging:b'Traceback (most recent call last):\n  File "setup.py", line 59, in <module>\n    _temp = __import__(agent_module, globals(), locals(), [\'__version__\'], 0)\n  File "/tmp/tmpas_9yv_2/pkg/vcplatform/agent.py", line 66, in <module>\n    from volttron.platform.agent.bacnet_proxy_reader import BACnetReader\n  File "/code/volttron/volttron/platform/agent/bacnet_proxy_reader.py", line 44, in <module>\n    from bacpypes.basetypes import EngineeringUnits\nModuleNotFoundError: No module named \'bacpypes\'\n'
volttron1   | b'Traceback (most recent call last):\n  File "setup.py", line 59, in <module>\n    _temp = __import__(agent_module, globals(), locals(), [\'__version__\'], 0)\n  File "/tmp/tmpas_9yv_2/pkg/vcplatform/agent.py", line 66, in <module>\n    from volttron.platform.agent.bacnet_proxy_reader import BACnetReader\n  File "/code/volttron/volttron/platform/agent/bacnet_proxy_reader.py", line 44, in <module>\n    from bacpypes.basetypes import EngineeringUnits\nModuleNotFoundError: No module named \'bacpypes\'\n'
volttron1   | Traceback (most recent call last):
volttron1   |   File "/code/volttron/scripts/install-agent.py", line 340, in <module>
volttron1   |     if not os.path.isfile(opts.package):
volttron1   |   File "/usr/lib/python3.7/genericpath.py", line 30, in isfile
volttron1   |     st = os.stat(path)
volttron1   | TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
volttron1   | Invalid agent source (/code/volttron/services/core/MasterDriverAgent) for agent id identity: platform.driver
bonicim commented 3 years ago

Hi GHYOON,

Volttron recently changed the name of MasterDriverAgent to PlatfromDriverAgent and that is most likely the reason that docker-compose failed.

What branch did you use so that I can recreate the bug on my end?

I currently have a PR, #22, addressing this name change. If you're curious, you can check out my feature branch and try running docker-compose on that version: https://github.com/bonicim/volttron-docker/tree/add-docker-image-test-scripts

GHYOON commented 3 years ago

Hi bonicim,

Issue branch is "main"

and I moved your repository and got following issues;

volttron1   | Platform instance name set to: volttron1
volttron1   | Platform bind web address set to: https://0.0.0.0:8443
volttron1   | Installing packages for web platform: ['ws4py', 'PyJWT', 'Jinja2', 'passlib', 'argon2-cffi', 'Werkzeug']
volttron1   | Creating rabbitmq conifg file at /home/volttron/.volttron/rabbitmq_config.yml
volttron1   | dumpfile is :{'certificate-data': {'country': 'US', 'state': 'Washington', 'location': 'Richland', 'organization': 'PNNL', 'organization-unit': 'VOLTTRON Team', 'common-name': 'volttron1-root-ca'}, 'host': 'volttron1'}
volttron1   | Traceback (most recent call last):
volttron1   |   File "/startup/setup-platform.py", line 96, in <module>
volttron1   |     yaml.dump(rabbit_config, outfile, default_flow_style=False)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/__init__.py", line 290, in dump
volttron1   |     return dump_all([data], stream, Dumper=Dumper, **kwds)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/__init__.py", line 278, in dump_all
volttron1   |     dumper.represent(data)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/representer.py", line 28, in represent
volttron1   |     self.serialize(node)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/serializer.py", line 54, in serialize
volttron1   |     self.serialize_node(node, None, None)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/serializer.py", line 108, in serialize_node
volttron1   |     self.serialize_node(value, node, key)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/serializer.py", line 107, in serialize_node
volttron1   |     self.serialize_node(key, node, None)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/serializer.py", line 90, in serialize_node
volttron1   |     style=node.style))
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/emitter.py", line 115, in emit
volttron1   |     self.state()
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/emitter.py", line 393, in expect_first_block_mapping_key
volttron1   |     return self.expect_block_mapping_key(first=True)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/emitter.py", line 403, in expect_block_mapping_key
volttron1   |     self.expect_node(mapping=True, simple_key=True)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/emitter.py", line 244, in expect_node
volttron1   |     self.expect_scalar()
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/emitter.py", line 268, in expect_scalar
volttron1   |     self.process_scalar()
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/emitter.py", line 533, in process_scalar
volttron1   |     self.write_plain(self.analysis.scalar, split)
volttron1   |   File "/home/volttron/.local/lib/python3.7/site-packages/yaml/emitter.py", line 1132, in write_plain
volttron1   |     self.stream.write(data)
volttron1   | TypeError: a bytes-like object is required, not 'str'
volttron1   | error running setup-platform.py
volttron1 exited with code 1

In your add-docker-image-test-scripts, it works ! when I change docker image from volttron/volttron:develop to bonicim/volttron:develop.

I think there is issue in volttron official image.

bonicim commented 3 years ago

Hi GHYOON,

I realized that issue and made some changes to that branch. I've merged the latest into this repo's branch 'develop'. Try that branch and let me know how it goes. The docker-compose files do not pull from the volition official image and rather builds the image locally. Develop branch: https://github.com/VOLTTRON/volttron-docker/tree/develop

NOTE: When you pull in the branch, be sure to initialize the git submodule using: git submodule update --init --recursive. The instructions are also in the branch's README.md.

GHYOON commented 3 years ago

Hi bonicim

I moved develop branch and build docker container locally (VOLTTRON branch: develop)

and it works well. Thanks