Skip to content

Commit

Permalink
Merge branch 'config_files' of https://github.com/WattRex/Battery-Cyc…
Browse files Browse the repository at this point in the history
…ler-Controller into config_files
  • Loading branch information
marius.crisan authored and marius.crisan committed Dec 28, 2023
2 parents b6c60fa + 1733650 commit 3c3bbba
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
5 changes: 2 additions & 3 deletions code/cu_manager/src/wattrex_cycler_cu_manager/cu_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
####################### ENUMS #######################

####################### CLASSES #######################
class CuManagerNodeC(SysShdNodeC): # pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-instance-attributes
class CuManagerNodeC(SysShdNodeC):
'''
Cu Manager Class to instanciate a CU Manager Node
'''
Expand Down Expand Up @@ -199,12 +200,10 @@ def process_iteration(self) -> None:
self.process_heartbeat()
self.process_cycler_deploy_processes()


def sync_shd_data(self) -> None:
'''Sync shared data with the sync node.
'''


def stop(self) -> None:
'''
Stop the stream .
Expand Down
32 changes: 32 additions & 0 deletions devops/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# INSTALL

1. Create a wattrex user to execute cyclers and change password
```bash

su -
# Create user, group and change password
groupadd -g 69976 wattrex
useradd -u 69976 -g wattrex wattrex
mkhomedir_helper wattrex
passwd wattrex

# Add new user to docker group
usermod -aG docker wattrex
exit

# Login to new user
su - wattrex
```
2. Change system queue sizes. For this, follow this guide: [](https://github.com/WattRex/System-Tools/tree/develop/code/sys_shd)
2. Execute deploy script to deploy containers for db synchronizer and CAN and SCPI sniffers
```bash
./devops/deploy.sh
```

NOTE: **make sure that all files in the `devops` and `config` folders belong to**
**the wattrex group and have write permissions**

3. Export config file path
```bash
export CONFIG_FILE_PATH=$(pwd)/config/config_params.yaml
```
2 changes: 1 addition & 1 deletion devops/cu_manager/run_cu_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
log: Logger = sys_log_logger_get_module_logger(__name__)

####################### MODULE IMPORTS #######################
sys.path.append(os.path.dirname(__file__)+'/../../code')
#sys.path.append(os.path.dirname(__file__)+'/../../code')
# from cu_manager.src.wattrex_cycler_cu_manager import CuManagerNodeC
from wattrex_cycler_cu_manager import CuManagerNodeC

Expand Down
2 changes: 1 addition & 1 deletion devops/cycler/run_cycler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
log.info(f'CS_ID: {CS_ID}')

####################### MODULE IMPORTS #######################
sys.path.append(os.path.dirname(__file__)+'/../../code/')
# sys.path.append(os.path.dirname(__file__)+'/../../code/')
# from cycler.src.wattrex_battery_cycler.app.app_man import AppManNodeC
from wattrex_battery_cycler.app.app_man import AppManNodeC

Expand Down
7 changes: 4 additions & 3 deletions devops/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export GROUP_ID=$(id -g)

initial_deploy () {
force_stop
python3 -m pip install can-sniffer
python3 -m pip install SCPI-sniffer
python3 -m pip install --upgrade can-sniffer
python3 -m pip install --upgrade SCPI-sniffer
python3 -m pip install --upgrade wattrex-cycler-cu-manager
mkdir -p "${REPO_ROOT_DIR}/log"

docker compose ${DOCKER_COMPOSE_ARGS} up cache_db db_sync -d
Expand All @@ -34,7 +35,7 @@ instance_new_cycler () {
check_sniffer "scpi"
export CYCLER_TARGET=cycler_prod

docker compose ${DOCKER_COMPOSE_ARGS} build --build-arg UPDATE_REQS=$(date +%s) cycler
#docker compose ${DOCKER_COMPOSE_ARGS} build --build-arg UPDATE_REQS=$(date +%s) cycler
docker compose ${DOCKER_COMPOSE_ARGS} run -d -e CSID=${1} --name wattrex_cycler_node_${1} cycler
}

Expand Down

0 comments on commit 3c3bbba

Please sign in to comment.