Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding setup fix #311

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ repos:
rev: 6.0.0
hooks:
- id: flake8
args: ["-j8", "--ignore=B036,B902"]
additional_dependencies: [
'flake8-blind-except',
'flake8-docstrings',
Expand Down
3 changes: 2 additions & 1 deletion demos/asilservice
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ if os.path.exists(socket_dir):
try:
selinux.setfscreatecon("system_u:object_r:qm_file_t:s0")
selinux.setsockcreatecon("system_u:system_r:qm_t:s0")
except BaseException:
except BaseException as see:
# selinux is disabled
print("\nSELinux is disabled, such environment is not recommended\n")
print("\nSELinux Exception occured:", see)
pass

server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
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
2 changes: 1 addition & 1 deletion setup
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ storage() {
"${ROOTFS}/var/lib/shared/overlay-layers/layers.lock"

sed -e '/additionalimage.*/,/]/s/^#//g' \
-e '/additionalimages.*/{n;s/.*/\"\/var\/lib\/shared\",/;}' \
-e '/additionalimages.*/a\"/var\/lib\/shared/\",' \
-e 's|^#.*transient_store.*|transient_store=true|g' \
/"${ROOTFS}/usr/share/containers/storage.conf" \
> "${ROOTFS}/etc/containers/storage.conf"
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