Giter Club home page Giter Club logo

volttron-docker's Introduction

Official VOLTTRON docker image

Introduction

This image provides a reproducible way to install VOLTTRON within a docker container. By using a volume mount of the VOLTTRON_HOME directory, runtime changes made by the platform are visible on the host and are preserved across instances of the container. Similarly, changes made from the host are reflected in the container. The image uses the utility gosu, which allows the non-root user executing the volttron platform inside the container to have the same UID as the host user running the container on the host system. In conjunction with volume mounting of the directory, this ensures that file ownership and permissions in VOLTTRON_HOME match the host user, avoiding cases where root in the container leaves files inaccessible to a user without sudo permissions on the host.

Prerequisites

  • Docker ^20.10.8
  • Docker-compose ^3.4

If you need to install docker and/or docker-compose AND you are running this image on an Ubuntu machine, you can use the script in this repo. From the root level, execute the following command:

$ ./docker_install_ubuntu.sh

Quickstart:

To create the container and start using the platform on the container, run the following commands from the command line. Ensure that you are in the root level of the directory.

# Creates Volttron instance with ZMQ message bus
$ docker-compose up

# To ssh into the container
$ docker exec -itu volttron volttron1 bash

# To stop the container
$ docker-compose stop

# To start the container after it's been stopped
$ docker-compose start

# To get a list of all containers created from docker-compose
$ docker-compose ps

# To stop and remove the container
$ docker-compose down

For Volttron instances using ZMQ message bus:

  • Set the master username and password on the Volttron Central Admin page at https://0.0.0.0:8443/index.html
  • To log in to Volttron Central, open a browser and login to the Volttron web interface: https://0.0.0.0:8443/vc/index.html

Platform Initialization

The VOLTTRON container when created is just a blank container with no agents. Now there is an initialization routine available within the docker container to allow the installation of agents before launching of the instance. To do this one will mount a platform_config.yml file to /platform_config.yml within the container. One is also likely to need to mount agent configurations (specified in the platform_config.yml file), into the container. The recommended way to do this is through a docker-compose.yml file. An example of this is included in this repository, based on the one in the volttron-fuel-cells repo.

The platform_config.yml file has two sections: config, which configures the main instance and populate's the main config file ($VOLTTRON_HOME/config), and agents, which contains a list of agents with references to configurations for them (note the frequent use of environment variables in this section).

Main Configuration

The main instance configuration is composed of key value pairs under a "config" key in the platform_config.yml file. For example, the vip-address and bind-web-address would be populated using the following partial file:

# Properties to be added to the root config file:
# - the properties should be ingestable for volttron
# - the values will be presented in the config file
#   as key=value
config:
  vip-address: tcp://0.0.0.0:22916
  bind-web-address: https://0.0.0.0:8443
  # volttron-central-address: a different address
  # volttron-central-serverkey: a different key

  ...

Agent Configuration

The agent configuration section is under a top-level key called "agents". This top-level key contains several layers of nested key-value mappings. The top level of the section is keyed with the names of the desired agents, which are used as the identity of those agents within the platform. For each agent key, there is a further mapping which must contain a source key and may contain either or both a config and/or config_store key; the values are strings representing resolvable paths. An example follows at the end of this section.

Note that the agent section does not contain the detailed configuration of the agents; for each agent it gives a path to a dedicated configuration file for that agent. As with the platform_config.yaml file, it is generally desirable to mount a local directory containing the configurations into the container, again using a docker-compose.yaml file.

...

# Agents dictionary to install.  The key must be a valid
# identity for the agent to be installed correctly.
agents:

  # Each agent identity.config file should be in the configs
  # directory and will be used to install the agent.
  listener:
    source: $VOLTTRON_ROOT/examples/ListenerAgent
    config: $CONFIG/listener.config

  platform.actuator:
    source: $VOLTTRON_ROOT/services/core/ActuatorAgent

  historian:
    source: $VOLTTRON_ROOT/services/core/SQLHistorian
    config: $CONFIG/historian.config

  weather:
    source: $VOLTTRON_ROOT/examples/DataPublisher
    config: $CONFIG/weather.config

  price:
    source: $VOLTTRON_ROOT/examples/DataPublisher
    config: $CONFIG/price.config

  platform.driver:
    source: $VOLTTRON_ROOT/services/core/MasterDriverAgent
    config_store:
      fake.csv:
        file: $VOLTTRON_ROOT/examples/configurations/drivers/fake.csv
        type: --csv
      devices/fake-campus/fake-building/fake-device:
        file: $VOLTTRON_ROOT/examples/configurations/drivers/fake.config

Other Notes

Agents within the platform_config.yml file are created sequentially, it can take several seconds for each to spin up and be visible via vctl commands.

Development

If you plan on extending or developing the "platform_config.yml", "configs/", or the setup scripts in "core/", build the Docker image, "Dockerfile-dev", only once using docker-compose -f docker-compose-dev.yml build --no-cache volttron1. Then start the container using docker-compose -f docker-compose-dev.yml up. When you want to make changes to "platform_config.yml", "configs/", or "core/", simply make the changes and then rerun your container. You do not have to rebuild the image every time you make changes to those aforementioned files and folders because they are mounted into the container. The only time you should rebuild the image is when you make changes to the "volttron" source code since that is not mounted to the container but rather baked into the image during the image build. Once you are satisfied your changes, update 'Dockerfile' with the changes you used in 'Dockerfile-dev' and submit a PR.

To setup your environment for development, do the following:

  1. Give execute permissions for ./core/*
chmod a+x core/*
  1. Pull in volttron from the official volttron repo using the following git command:
# Clones https://github.com/VOLTTRON/volttron.git into the 'volttron' directory
git submodule update --init --recursive

Why are we doing this? This repo has a directory called 'volttron', which contains the volttron codebase. In other words, this repo contains another repo in a subfolder. When you initially clone this repo, the 'volttron' directory is empty. This directory contains the volttron codebase used to create the volttron platform.

OPTIONAL: This repo uses a specific version of volttron based on the commit in the 'volttron' submodule. If you want to use the latest volttron from the develop branch from the volttron repo, execute the following command (NOTE: this is not required):

# Ensure that you are in the `volttron` folder
git pull origin develop
  1. Build the image locally:
  • Using docker-compose (preferred)
docker-compose -f docker-compose-dev.yml build --no-cache --force-rm
  1. Run the container:
  • Using docker-compose (preferred)
docker-compose -f docker-compose-dev.yml up

Testing

If you want to work on improving/developing the Dockerfile, you can locally run a test script to check whether the image works as expected. To run the test, see the following:

# run the test (rebuilds and tests the most current image)
$ ./run-test-docker-image.sh

# You can also run the test but skip rebuilding the image
$ ./run-test-docker-image.sh -s

Note: If you want to use a different image name and/or tag, you must ensure that the image name in docker-compose.yml matches the image name given to the integration test script. For example, if you run the integration tests with the following options ./run-test-docker-image.sh -g test -t integ, then the 'image' key in docker-compose.yml must be set to 'volttron/test:integ'.

Updating the image on Dockerhub

If you are not part of the Volttron Core development team, you can skip this section.

See: https://confluence.pnnl.gov/confluence/display/VNATION/Docker+Image+Publishing+Procedures

Advanced Usage

In order for volttron to keep its state between runs, the state must be stored on the host. We have attempted to make this as painless as possible, by using gosu to map the hosts UID onto the containers volttron user. The following will create a directory to be written to during VOLTTRON execution.

  1. Create a directory (eg mkdir -p ~/vhome). This is where the VOLTTRON_HOME inside the container will be created on the host.
  2. Start the docker container with a volume mount point and pass a LOCAL_USER_ID environmental variable.
    docker run -e LOCAL_USER_ID=$UID -v /home/user/vhome:/home/volttron/.volttron -it volttron/volttron

In order to allow an external instance connect to the running volttron container one must add the -p : (e.g. 22916:22916)

Troubleshooting

My VC Platform agent can't connect to the Volttron Central address. I see volttron.platform.vip.agent.subsystems.auth ERROR: Couldn't connect to https://localhost:8443 or incorrect response returned response was None in the logs

This most likely occurs if you are deploying this container behind a proxy. Ensure that your ~/.docker/config.json has no "proxies" configuration.

My Forwarder shows a BAD status when I run vctl status

Ensure that the configuration for your forwarder is using the same volttron-central-address property in volttron config, which is set in your platform_config.yml file.

volttron-docker's People

Contributors

bonicim avatar craig8 avatar ghyoon avatar laroque avatar pleepleus avatar schandrika avatar shwethanidd avatar timothyclifford avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

volttron-docker's Issues

docker-compose-rmq.yml

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

stopping and start local docker container causes config error

Error:
docker-compose stop followed by docker-compose start causes the below error
configparser.DuplicateOptionError: While reading from '/home/volttron/.volttron/config' [line 10]: option 'web-ssl-cert' in section 'volttron' already exists

Steps to reproduce:
Follow readme instructions,

  1. clone this repo
  2. git submodule update --init --recursive
  3. local docker build
  4. docker compose up
  5. docker compose stop
  6. docker compose start

Last step attempts to start the container but fails with the below error
configparser.DuplicateOptionError: While reading from '/home/volttron/.volttron/config' [line 10]: option 'web-ssl-cert' in section 'volttron' already exists

Volttron1 container is not reentrant

The bootstart.sh script runs setup_platform.py regardless of whether the container has already been initialized. This causes the _create_certs() function to error out somewhere down the stack with the following message if it has:

configparser.DuplicateOptionError: While reading from '/home/volttron/.volttron/config' [line 10]: option 'web-ssl-cert' in section 'volttron' already exists

The attached modified bootstart.txt (Github won't let me upload a .sh file) checks first if the $VOLTTRON_HOME/config file exists before running setup_platform.py preventing the error.

If someone wants to change $VOLTTRON_HOME/config, they should delete the container and rebuild it

bootstart.txt
.

rmq certification is changed

Issue branch: develop

Local host VOLTTRON_HOME is mounted.

The cert file is changed for every execution.

I think it makes sense that the cert file created in the host mount folder is not changed.

It is expected to be a problem especially when using external interfaces such as federation and shovel.

Error on ZMQ socket bind() needs more information, patch attached.

The current code in ./volttron/volttron/platform/vip/socket.py bind() prints out an error message saying that there was an attempt to bind an already bound socket. This is misleading, it could be due to any socket error. In particular, when building Volttron in a container, it may be due to the address not being assigned to the container. The attached git patch (renamed from *.patch to *.txt to be able to attach it) prints out the errno, and folks can simply go to their browser and look up the errno to find out what the problem is.

     jak

0001-Modified-socket.py-to-add-more-detail-on-the-error-m.txt
k

Docker installation does not set proper permissions on socket

The installation of Docker does not set proper permissions on the socket, and as a result an error message occurs when you try to start docker-compose. The following will fix the problem:

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

         jak

Unable to access VOLTTRON central

Hi,

I'm attempting to make use of the quick start which seems like it should be fairly simple.

I pulled a copy of this repository and ran

docker-compose up

The container comes up and appears to initialize itself, I do see some errors but none seem to be terminating errors. When I attempt to connect to 8443 on my local machine I'm unable to access anything via the browser. I'm completely new to VOLTTRON so I apologize if I've missed something obvious.

My machine, I am forcing containers to run as AMD64 even though this is ARM64.

Software:

    System Software Overview:

      System Version: macOS 12.4 (21F79)
      Kernel Version: Darwin 21.5.0

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro18,3
      Chip: Apple M1 Pro
      Total Number of Cores: 10 (8 performance and 2 efficiency)
      Memory: 32 GB

docker-compose --version
Docker Compose version v2.2.3

docker --version
Docker version 20.10.9, build c2ea9bc

Below is a sample of some of the errors I saw in the logs

volttron1  | 2022-07-22 16:40:21,214 () volttron.platform.agent.utils INFO: Adding file watch for /home/volttron/.volttron/auth.json dirname=/home/volttron/.volttron, filename=auth.json
volttron1  | Traceback (most recent call last):
volttron1  |   File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
volttron1  |   File "/code/volttron/volttron/platform/agent/utils.py", line 703, in watch_file
volttron1  |     observer.start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/api.py", line 256, in start
volttron1  |     emitter.start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/utils/__init__.py", line 93, in start
volttron1  |     self.on_thread_start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify.py", line 118, in on_thread_start
volttron1  |     self._inotify = InotifyBuffer(path, self.watch.is_recursive)
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_buffer.py", line 35, in __init__
volttron1  |     self._inotify = Inotify(path, recursive)
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_c.py", line 155, in __init__
volttron1  |     Inotify._raise_error()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_c.py", line 405, in _raise_error
volttron1  |     raise OSError(err, os.strerror(err))
volttron1  | OSError: [Errno 38] Function not implemented
volttron1  | 2022-07-22T16:40:21Z <Greenlet at 0x400a1efd08: watch_file('/home/volttron/.volttron/auth.json', <bound method AuthService.read_auth_file of <voltt)> failed with OSError
volttron1  | 
volttron1  | 2022-07-22 16:40:21,242 () volttron.platform.agent.utils INFO: Adding file watch for /home/volttron/.volttron/protected_topics.json dirname=/home/volttron/.volttron, filename=protected_topics.json
volttron1  | Traceback (most recent call last):
volttron1  |   File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
volttron1  |   File "/code/volttron/volttron/platform/agent/utils.py", line 703, in watch_file
volttron1  |     observer.start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/api.py", line 256, in start
volttron1  |     emitter.start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/utils/__init__.py", line 93, in start
volttron1  |     self.on_thread_start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify.py", line 118, in on_thread_start
volttron1  |     self._inotify = InotifyBuffer(path, self.watch.is_recursive)
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_buffer.py", line 35, in __init__
volttron1  |     self._inotify = Inotify(path, recursive)
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_c.py", line 155, in __init__
volttron1  |     Inotify._raise_error()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_c.py", line 405, in _raise_error
volttron1  |     raise OSError(err, os.strerror(err))
volttron1  | OSError: [Errno 38] Function not implemented
volttron1  | 2022-07-22T16:40:21Z <Greenlet at 0x400a1efe18: watch_file('/home/volttron/.volttron/protected_topics.json', <bound method AuthService._read_protected_topics_f)> failed with OSError
volttron1  | 
volttron1  | 2022-07-22 16:40:21,264 () volttron.platform.vip.pubsubservice INFO: protected-topics loaded
volttron1  | Available agents that are needing to be setup/installeddict_keys(['listener', 'platform.driver', 'platform.agent', 'platform.actuator', 'platform.historian', 'volttron.central'])
volttron1  | 2022-07-22 16:40:35 INFO setup-platform install_agents:246 — Processing identity: listener
volttron1  | Traceback (most recent call last):
volttron1  |   File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
volttron1  |   File "/code/volttron/volttron/platform/web/platform_web_service.py", line 776, in startupagent
volttron1  |     rpc_caller=rpc_caller)
volttron1  |   File "/code/volttron/volttron/platform/web/admin_endpoints.py", line 110, in __init__
volttron1  |     self._observer.start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/api.py", line 256, in start
volttron1  |     emitter.start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/utils/__init__.py", line 93, in start
volttron1  |     self.on_thread_start()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify.py", line 118, in on_thread_start
volttron1  |     self._inotify = InotifyBuffer(path, self.watch.is_recursive)
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_buffer.py", line 35, in __init__
volttron1  |     self._inotify = Inotify(path, recursive)
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_c.py", line 155, in __init__
volttron1  |     Inotify._raise_error()
volttron1  |   File "/home/volttron/.local/lib/python3.7/site-packages/watchdog/observers/inotify_c.py", line 405, in _raise_error
volttron1  |     raise OSError(err, os.strerror(err))
volttron1  | OSError: [Errno 38] Function not implemented
volttron1  | 2022-07-22T16:40:24Z <Greenlet at 0x4024439bf8: <bound method PlatformWebService.startupagent of <volttron.platform.web.platform_web_service.PlatformWebService object at 0x400a31b438>>(<volttron.platform.vip.agent.core.ZMQCore object a)> failed with OSError
volttron1  | Processing identity: listener
volttron1  | 2022-07-22 16:40:53 INFO setup-platform install_agents:246 — Processing identity: platform.driver
volttron1  | 2022-07-22 16:40:55,508 (listeneragent-3.3 165) volttron.platform.vip.agent.core ERROR: No response to hello message after 10 seconds.
volttron1  | 2022-07-22 16:40:55,508 (listeneragent-3.3 165) volttron.platform.vip.agent.core ERROR: Type of message bus used zmq
volttron1  | 2022-07-22 16:40:55,508 (listeneragent-3.3 165) volttron.platform.vip.agent.core ERROR: A common reason for this is a conflicting VIP IDENTITY.
volttron1  | 2022-07-22 16:40:55,509 (listeneragent-3.3 165) volttron.platform.vip.agent.core ERROR: Another common reason is not having an auth entry onthe target instance.
volttron1  | 2022-07-22 16:40:55,509 (listeneragent-3.3 165) volttron.platform.vip.agent.core ERROR: Shutting down agent.
volttron1  | 2022-07-22 16:40:55,509 (listeneragent-3.3 165) volttron.platform.vip.agent.core ERROR: Possible conflicting identity is: listener

Empty platform.driver list leads to type error

The platform_config.yml file has a comment in it saying that you cannot load the platform.agent without having the platform.driver loaded. Since if I am not mistaken the plaform.agent needs to be loaded for the VIP bus router, you need the platform.driver even if there are no devices on the local platform, like for example a cloud deployment with just the historian and Volttron Central web application. But if you try to load the plaform.driver without any drivers (which you might also want to do if you wanted to dynamically load drivers), you get an error:

Processing config_store entriesTraceback (most recent call last):
File "/startup/setup-platform.py", line 372, in
install_agents(agents_tmp)
File "/startup/setup-platform.py", line 311, in install_agents
for key, entry in spec["config_store"].items():
AttributeError: 'NoneType' object has no attribute 'items'
error running setup-platform.py

This can be fixed by adding a test in setup-platform.py around line 311 to check if spec["config_store"] is None:

        if "config_store" in spec:
            sys.stdout.write("Processing config_store entries")
           if spec["config_store"] is not None:
                for key, entry in spec["config_store"].items():
		if "file" not in entry or not entry["file"]:
                        slogger.info(
                            f"Invalid config store entry; file must be specified for {key}"
                        )
                        sys.stderr.write(
                            "Invalid config store entry file must be specified for {}".format(
                                key
                            )

  jak

Can't find eclipsevolttron/volttron:v3 image

The docker-compose file says to use this image. I don't use docker-compose but when I try to start Volttron through docker using the image I get the following error message:

++ docker run --name central --hostname central -p 8443:8443 -p 22916:22916 -d -it --env CONFIG=/home/volttron/configs --env LOCAL_USER_ID=1000 --mount type=bind,source=/home/james/Documents/volttron8/volttron-docker/central/central_config.yml,target=/platform_config.yml --mount type=bind,source=/home/james/Documents/volttron8/volttron-docker/central/configs,target=/home/volttron/configs --mount type=volume,source=/home/james/Documents/volttron8/volttron-docker/central/db,target=/home/volttron/db eclipsevolttron/volttron:v3
Unable to find image 'eclipsevolttron/volttron:v3' locally
docker: Error response from daemon: manifest for eclipsevolttron/volttron:v3 not found: manifest unknown: manifest unknown.
See 'docker run --help'.

Setup doesn't create the correct permissions on VOLTTRON_HOME directory

docker run -e LOCAL_USER_ID=$UID -v $HOME/.volttron_docker_home:/home/volttron/.volttron -v ${PWD}/platform_config.yml:/platform_config.yml -it volttron/volttron

Produces

Traceback (most recent call last):
  File "/startup/setup-platform.py", line 54, in <module>
    with open(os.path.join(cfg_path), "w") as fout:
IOError: [Errno 13] Permission denied: '/home/volttron/.volttron/config'
error running setup-platform.py

mount host VOLTTRON_HOME

Issue branch: develop

when mounting host volttron home (eg ~/vhome)

  • first execution is work well (docker-compose -f docker-compose-rmq.yml up )
  • second produces following message
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', 'use-existing-certs': True, 'rmq-home': '/home/volttron/rabbitmq_server/rabbitmq_server-3.7.7'}
volttron1    | Traceback (most recent call last):
volttron1    |   File "/startup/setup-platform.py", line 156, in <module>
volttron1    |     setup_rabbitmq_volttron('single', True, instance_name=platform_cfg.get('instance-name'))
volttron1    |   File "/code/volttron/volttron/utils/rmq_setup.py", line 595, in setup_rabbitmq_volttron
volttron1    |     store_message_bus_config(message_bus='rmq', instance_name=instance_name)
volttron1    |   File "/code/volttron/volttron/platform/agent/utils.py", line 283, in store_message_bus_config
volttron1    |     config.read(config_path)
volttron1    |   File "/usr/lib/python3.7/configparser.py", line 696, in read
volttron1    |     self._read(fp, filename)
volttron1    |   File "/usr/lib/python3.7/configparser.py", line 1091, in _read
volttron1    |     fpname, lineno)
volttron1    | configparser.DuplicateOptionError: While reading from '/home/volttron/.volttron/config' [line 10]: option 'web-ssl-cert' in section 'volttron' already exists
volttron1    | error running setup-platform.py
volttron1 exited with code 1

realpath not a thing anymore

I was starting to build the multi-image support for arm and x86 and got the following issue when running the ./.travice/main.sh script

....
Reading state information... Done
Package realpath is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  manpages-pl manpages-fr-extra

E: Package 'realpath' has no installation candidate
craig@baby-yoda:~/repos/volttron-docker$ 

Cython errors out with syntax error in Cython file

Please see the below error. I was trying to build a Volttron docker image using the Dockerfile-dev file.

        jak

Step 29/40 : RUN pip install -e . --user
---> Running in 9bb45783b8fc
Obtaining file:///code/volttron
Collecting PyYAML==5.4.1 (from volttron==8.1.3)
Downloading https://files.pythonhosted.org/packages/7a/a5/393c087efdc78091afa2af9f1378762f9821c9c1d7a22c5753fb5ac5f97a/PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (636kB)
Collecting cryptography==2.3 (from volttron==8.1.3)
Downloading https://files.pythonhosted.org/packages/c2/fa/fa9a8933c285895935d1392922fe721e9cb1b2c1881d14f149213a227ee3/cryptography-2.3-cp34-abi3-manylinux1_x86_64.whl (2.1MB)
Collecting gevent==20.6.1 (from volttron==8.1.3)
Downloading https://files.pythonhosted.org/packages/9d/a0/42c50f1a021d2404fcad9ac0724fc72de5d084c23fa5447a62f898440802/gevent-20.6.1.tar.gz (5.8MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Complete output from command python setup.py egg_info:
Compiling src/gevent/resolver/cares.pyx because it changed.
[1/1] Cythonizing src/gevent/resolver/cares.pyx
Compiling src/gevent/libev/corecext.pyx because it changed.
[1/1] Cythonizing src/gevent/libev/corecext.pyx
Compiling src/gevent/_greenlet_primitives.py because it changed.
[1/1] Cythonizing src/gevent/_greenlet_primitives.py
Compiling src/gevent/_hub_primitives.py because it changed.
[1/1] Cythonizing src/gevent/_hub_primitives.py
Compiling src/gevent/_hub_local.py because it changed.
[1/1] Cythonizing src/gevent/_hub_local.py
Compiling src/gevent/_waiter.py because it changed.
[1/1] Cythonizing src/gevent/_waiter.py
warning: src/gevent/resolver/cares.pyx:38:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/resolver/cares.pyx:40:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/resolver/cares.pyx:41:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/libev/corecext.pyx:325:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/libev/corecext.pyx:783:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/libev/corecext.pyx:785:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/libev/corecext.pyx:787:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/libev/corecext.pyx:791:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310
warning: src/gevent/_gevent_cgreenlet.pxd:112:33: Declarations should not be declared inline.

Error compiling Cython file:
------------------------------------------------------------
...
cdef load_traceback
cdef Waiter
cdef wait
cdef iwait
cdef reraise
cpdef GEVENT_CONFIG
      ^
------------------------------------------------------------

src/gevent/_gevent_cgreenlet.pxd:181:6: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-ay3ebthy/gevent/setup.py", line 287, in <module>
    EXT_MODULES.append(cythonize1(mod))
  File "/tmp/pip-install-ay3ebthy/gevent/_setuputils.py", line 260, in cythonize1
    common_utility_include_dir=COMMON_UTILITY_INCLUDE_DIR,
  File "/tmp/pip-build-env-cxr67hol/lib/python3.7/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
    cythonize_one(*args)
  File "/tmp/pip-build-env-cxr67hol/lib/python3.7/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: src/gevent/greenlet.py
Compiling src/gevent/greenlet.py because it changed.
[1/1] Cythonizing src/gevent/greenlet.py

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ay3ebthy/gevent/
The command 'bash -c pip install -e . --user' returned a non-zero code: 1

VOLTTRON Central Agent Showing status of 1

I uncommented the VOLTTRON Central Agent code in the platform_config.yml file and when I run vctl status I am getting a status of 1. Searching through the logs I found the following error:

2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: Traceback (most recent call last):
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: "main", mod_spec)
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: exec(code, run_globals)
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: File "/home/volttron/.volttron/agents/eee54433-f080-45c4-bfc5-5d64993fdba1/volttroncentralagent-5.2/volttroncentral/agent.py", line 1022, in
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: sys.exit(main())
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: File "/home/volttron/.volttron/agents/eee54433-f080-45c4-bfc5-5d64993fdba1/volttroncentralagent-5.2/volttroncentral/agent.py", line 1016, in main
2021-11-22 17:22:16,828 (volttroncentralagent-5.2 177) ERROR: version=version)
2021-11-22 17:22:16,829 (volttroncentralagent-5.2 177) ERROR: File "/code/volttron/volttron/platform/agent/utils.py", line 459, in vip_main
2021-11-22 17:22:16,829 (volttroncentralagent-5.2 177) ERROR: message_bus=message_bus, **kwargs)
2021-11-22 17:22:16,829 (volttroncentralagent-5.2 177) ERROR: File "/home/volttron/.volttron/agents/eee54433-f080-45c4-bfc5-5d64993fdba1/volttroncentralagent-5.2/volttroncentral/agent.py", line 109, in init_volttron_central
2021-11-22 17:22:16,829 (volttroncentralagent-5.2 177) ERROR: users = config.get('users', None)
2021-11-22 17:22:16,829 (volttroncentralagent-5.2 177) ERROR: AttributeError: 'NoneType' object has no attribute 'get'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.