Skip to content

Commit

Permalink
Updating recent changes in BluchiConfigurations
Browse files Browse the repository at this point in the history
Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa committed Jan 17, 2024
1 parent bc17f81 commit 7d6b367
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
rev: 6.0.0
hooks:
- id: flake8
args: ["-j8", "--ignore=B036"]
args: ["-j8", "--ignore=B036,B902"]
additional_dependencies: [
'flake8-blind-except',
'flake8-docstrings',
Expand Down
2 changes: 1 addition & 1 deletion demos/demo
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Network=host
# get the ip of controller via interface eth0
ip_controller=$(ip addr list eth0 |grep "inet " |cut -d' ' -f6|cut -d/ -f1)
eval "$(podman exec qm \
sed -i 's/^#ManagerHost=/ManagerHost='"${ip_controller}"'/g' \
sed -i 's/^#ControllerHost=/ControllerHost='"${ip_controller}"'/g' \
/etc/bluechi/agent.conf
)"
eval "$(podman exec qm \
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/lib/ContainerFile.template
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ RUN npm install markdownlint-cli2 --global

# [start] CONTROL - settings
# Setting configuration, uncommenting:
# - ManagePort to communicate via 842
# - ControllerPort to communicate via 842
# - Use journal for logging
# - Set AllowedNodeNames as control and node1
# TODO: remove the static node1 here, dynamic by rune2e script via sed
RUN cp /usr/share/bluechi/config/controller.conf /etc/bluechi/
RUN cp /usr/share/bluechi-agent/config/agent.conf /etc/bluechi/agent.conf.d/
RUN sed -e '/^#ManagerPort=/s/^#//g' \
RUN sed -e '/^#ControllerPort=/s/^#//g' \
-e '/#LogTarget/s/^#//' \
-e "s/^#AllowedNodeNames=/AllowedNodeNames=control,node1/" \
-i /etc/bluechi/controller.conf
Expand Down
14 changes: 7 additions & 7 deletions tests/e2e/lib/container
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ create_qm_node() {
# Enable bluechi-agent
echo 'RUN cp /usr/share/bluechi-agent/config/*.conf /etc/bluechi/agent.conf.d/' >> ContainerFile.node"${nodeID}"
echo 'RUN sed -i -e "s/^#NodeName=/NodeName='"node${nodeID}/"\" \
'-e "s/^#ManagerHost=/ManagerHost='"${IP_CONTROL_MACHINE}/"\" \
'-e "s/^#ControllerHost=/ControllerHost='"${IP_CONTROL_MACHINE}/"\" \
' /etc/bluechi/agent.conf.d/agent.conf' >> ContainerFile.node"${nodeID}"
echo "RUN systemctl enable bluechi-agent &> /dev/null" >> ContainerFile.node"${nodeID}"

Expand Down Expand Up @@ -148,7 +148,7 @@ create_qm_node() {
)"
if_error_exit "unable to execute systemctl start qm"

# set in the QM container the ManagerHost (Control Machine) and restart bluechi-agent
# set in the QM container the ControllerHost (Control Machine) and restart bluechi-agent
eval "$(podman exec node"${nodeID}" \
podman exec qm \
cp \
Expand All @@ -161,11 +161,11 @@ create_qm_node() {
NODES_FOR_TESTING+=("${qm_node_name}")

eval "$(podman exec node"${nodeID}" \
sed -i -e 's/^#ManagerHost=.*/ManagerHost='"${IP_CONTROL_MACHINE}"'/g' \
-e 's/^ManagerHost=.*/ManagerHost='"${IP_CONTROL_MACHINE}"'/g' \
sed -i -e 's/^#ControllerHost=.*/ControllerHost='"${IP_CONTROL_MACHINE}"'/g' \
-e 's/^ControllerHost=.*/ControllerHost='"${IP_CONTROL_MACHINE}"'/g' \
/etc/bluechi/agent.conf.d/agent.conf
)"
if_error_exit "node: unable to sed ManagerHost in bluechi agent.conf"
if_error_exit "node: unable to sed ControllerHost in bluechi agent.conf"

# restarting the node bluechi-agent
eval "$(podman exec node"${nodeID}" \
Expand All @@ -175,10 +175,10 @@ create_qm_node() {

eval "$(podman exec node"${nodeID}" \
podman exec qm \
sed -i 's/^#ManagerHost=/ManagerHost='"${IP_CONTROL_MACHINE}"'/g' \
sed -i 's/^#ControllerHost=/ControllerHost='"${IP_CONTROL_MACHINE}"'/g' \
/etc/bluechi/agent.conf.d/agent.conf
)"
if_error_exit "qm node: unable to sed ManagerHost in bluechi agent.conf"
if_error_exit "qm node: unable to sed ControllerHost in bluechi agent.conf"

eval "$(podman exec node"${nodeID}" \
podman exec qm \
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/set-ffi-env-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ setup_qm_services() {
cat > /etc/bluechi/controller.conf << 'EOF'
[bluechi-controller]
AllowedNodeNames=qm.localrootfs,localrootfs
ManagerPort=842
ControllerPort=842
LogLevel=INFO
LogTarget=journald
LogIsQuiet=false
Expand Down

0 comments on commit 7d6b367

Please sign in to comment.