Skip to content

Commit

Permalink
Set cwd for volttron and agents (eclipse-volttron#169)
Browse files Browse the repository at this point in the history
* update python version to 3.10

* fix for issue 167

* update python version to 3.10 and ubuntu to 22.04
  • Loading branch information
schandrika authored Mar 24, 2023
1 parent ca89a7e commit 1e19211
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ defaults:
env:
LANG: en_US.utf-8
LC_ALL: en_US.utf-8
PYTHON_VERSION: '3.8'
PYTHON_VERSION: '3.10'
PROJECT_NAME: test-release-actions
RUNS_ON: ubuntu-20.04

jobs:

bump_version:
environment: test_env
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/downstream-tests-responses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
test-response:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Repository Dispatch Triggered
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-downstream-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
repo: [ eclipse-volttron/volttron-listener, eclipse-volttron/volttron-testing ]
# , 'VOLTTRON/volttron-openadr-ven' ]

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- run: env
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,13 @@ defaults:
env:
LANG: en_US.utf-8
LC_ALL: en_US.utf-8
PYTHON_VERSION: '3.8'
PYTHON_VERSION: '3.10'
PROJECT_NAME: volttron-core

jobs:

run-tests:
strategy:
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04"]
python: ["3.8", "3.9", "3.10"]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04

steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ packages = [

[tool.poetry.dependencies]
poetry = "^1.2.2"
python = "^3.8"
python = "^3.10"
pyzmq = "^22.3.0"
gevent = "^21.12.0"
PyYAML = "^6.0"
Expand Down
12 changes: 8 additions & 4 deletions src/volttron/server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,20 @@
def start_volttron_process(opts):
"""Start the main volttron process.
Typically this function is used from main.py and just uses the argparser's
Typically, this function is used from main.py and just uses the argparser's
Options arguments as inputs. It also can be called with a dictionary. In
that case the dictionaries keys are mapped into a value that acts like the
args options.
"""
if isinstance(opts, dict):
opts = type("Options", (), opts)()
# vip_address is meant to be a list so make it so.
if not isinstance(opts.vip_address, list):
opts.vip_address = [opts.vip_address]

# Change working dir
os.chdir(opts.volttron_home)

# vip_address is meant to be a list so make it so.
if not isinstance(opts.vip_address, list):
opts.vip_address = [opts.vip_address]
if opts.log:
opts.log = config.expandall(opts.log)
if opts.log_config:
Expand Down
1 change: 1 addition & 0 deletions src/volttron/server/aip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ def start_agent(self, agent_uuid):
execenv.execute(
argv,
env=environ,
cwd=os.path.join(self.install_dir, vip_identity),
close_fds=True,
stdin=open(os.devnull),
stdout=PIPE,
Expand Down

0 comments on commit 1e19211

Please sign in to comment.