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 AWS nested container fix #280

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion plans/e2e/ffi.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ adjust:
how: shell
script: |
cd tests/e2e
./set-ffi-env-e2e --qm-setup-from-gh-url=https://raw.githubusercontent.com/containers
./set-ffi-env-e2e --branch-qm=fix-qm-tmp-dir --qm-setup-from-gh-url=https://raw.githubusercontent.com/Yarboa
dougsland marked this conversation as resolved.
Show resolved Hide resolved
when: scenario == ffi and distro == centos-stream-9, fedora

execute:
Expand Down
6 changes: 5 additions & 1 deletion setup
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ INSTALLDIR="/usr/share/qm"
ROOTFS="/usr/lib/qm/rootfs"
RWETCFS="/etc/qm"
RWVARFS="/var/qm"
TMP_QM_IMG_DIR="tmp-img-dir"
AGENT_HOSTNAME="$(hostname)"
AGENTCONF="/etc/bluechi/agent.conf.d/agent.conf"
QM_CONTAINER_IDS=1000000000:1500000000
Expand Down Expand Up @@ -92,14 +93,17 @@ storage() {
ROOTFS=$1
if ! test -f "${ROOTFS}/etc/containers/storage.conf"; then
mkdir -p "${ROOTFS}/var/lib/shared/overlay-images" \
"${ROOTFS}/var/lib/shared/overlay-layers"
"${ROOTFS}/var/lib/shared/overlay-layers" \
"${ROOTFS}/var/${TMP_QM_IMG_DIR}"
touch "${ROOTFS}/var/lib/shared/overlay-images/images.lock" \
"${ROOTFS}/var/lib/shared/overlay-layers/layers.lock"

sed -e '/additionalimage.*/a "/var/lib/shared",' \
-e 's|^#.*transient_store.*|transient_store=true|g' \
"${ROOTFS}/usr/share/containers/storage.conf" \
> "${ROOTFS}/etc/containers/storage.conf"
sed -i "s|^#env = \[\]|env = \[\"TMPDIR=/var/${TMP_QM_IMG_DIR}\"\]|" \
"${ROOTFS}/usr/share/containers/containers.conf"
fi
}

Expand Down
6 changes: 2 additions & 4 deletions tests/e2e/set-ffi-env-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ while [ $# -gt 0 ]; do
if [ -z "${BRANCH_QM}" ]; then
BRANCH_QM="main"
fi
#QM_GH_URL="${2}/qm/${BRANCH_QM}/setup"
QM_GH_URL="${2}/qm/${BRANCH_QM}/setup"
shift 2
;;

Expand All @@ -129,7 +129,7 @@ create_qm_disks() {
mkdir /var/qm
for disk in $disks_arr; do
if [[ ${disk} == "vda" || \
$(echo "${disk_table}" | grep -c "${disk}" ) -eq 1 ]];then
$(echo "${disk_table}" | grep -c "${disk}" ) -eq 1 && ${disk} != "zram0" ]];then
Yarboa marked this conversation as resolved.
Show resolved Hide resolved
new_part="$( (echo n; echo p; echo ; echo ; echo ; echo w) | fdisk "/dev/${disk}")"
part_id="$(echo "${new_part}" | grep -Po "new partition \K([0-9])")"
if [[ $(echo "${disk}" | grep -c nvme) -eq 1 ]]; then
Expand All @@ -146,7 +146,6 @@ install_qm_rpms() {

info_message "Installing qm setup rpm"
ARCH=$(arch)
dnf update -y
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
dnf copr enable -y @centos-automotive-sig/bluechi-snapshot centos-stream-9-"${ARCH}"
Expand Down Expand Up @@ -185,7 +184,6 @@ EOF
systemctl start bluechi-agent
# Restart qm to read lates bluechi-agent.conf
systemctl restart qm

}

info_message "Starting setup"
Expand Down