Compare commits

..

3 Commits

Author SHA1 Message Date
72daaf34a6
Dockerfile travis2bash.sh fix 2021-02-11 11:12:04 +01:00
28d722e9c9
Elcapitan VM fix
- forgot to change VM name
- also some code quality fixes in virt-install-all.sh
2021-02-11 11:09:24 +01:00
7def0b1d46
Add kata install feedback 2021-02-11 10:54:22 +01:00
3 changed files with 10 additions and 10 deletions

View File

@ -26,11 +26,13 @@ mem=$(sed -E 's/^MemTotal: +([0-9]+) kB/\1/p;d' < /proc/meminfo)
mempercore=$(((mem/1024-4096)/cores)) mempercore=$(((mem/1024-4096)/cores))
# install kata containers # install kata containers
echo "Installing kata...."
cid=$(docker run -d --runtime=runc -v /opt/kata:/opt/kata -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd -v /etc/docker:/etc/docker -it katadocker/kata-deploy kata-deploy-docker install) cid=$(docker run -d --runtime=runc -v /opt/kata:/opt/kata -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd -v /etc/docker:/etc/docker -it katadocker/kata-deploy kata-deploy-docker install)
# wait for finish # wait for finish
while [ "$(docker container inspect -f '{{.State.Running}}' "$cid")" == "true" ]; do while [ "$(docker container inspect -f '{{.State.Running}}' "$cid")" == "true" ]; do
sleep 1 sleep 1
done done
echo "Kata installed"
# update default container CPU and memory # update default container CPU and memory
sed -i "s/default_vcpus = .*/default_vcpus = 2/g;s/default_memory = .*/default-memory = $mempercore/g" /opt/kata/share/defaults/kata-containers/configuration-qemu-virtiofs.toml sed -i "s/default_vcpus = .*/default_vcpus = 2/g;s/default_memory = .*/default-memory = $mempercore/g" /opt/kata/share/defaults/kata-containers/configuration-qemu-virtiofs.toml

View File

@ -63,9 +63,7 @@ RUN apt-get install -yq --no-install-suggests --no-install-recommends \
RUN rm -rf /var/lib/apt/lists/* RUN rm -rf /var/lib/apt/lists/*
# travis2bash # travis2bash
COPY /usr/src/buildbot-scripts/travis2bash.sh /usr/local/bin COPY travis2bash.sh /usr/local/bin
#RUN useradd -ms /bin/bash buildbot
RUN echo 'buildbot ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers RUN echo 'buildbot ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

View File

@ -13,7 +13,7 @@ trusty()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n trusty_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n trusty_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -39,7 +39,7 @@ xenial()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n xenial_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n xenial_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -65,7 +65,7 @@ bionic()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n bionic_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n bionic_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -91,7 +91,7 @@ focal()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n focal_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n focal_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -111,7 +111,7 @@ elcapitan()
local cores local cores
id="$1" id="$1"
virsh undefine elcapitan_"${hostname}_${id}" virsh undefine elcapitan_libvirt_"${hostname}_${id}"
xml=$(mktemp) xml=$(mktemp)
@ -127,10 +127,10 @@ elcapitan()
/var/lib/libvirt/ephemeral/enoch_rev2839_boot /var/lib/libvirt/ephemeral/enoch_rev2839_boot
sed -Ei " sed -Ei "
s#<name>.*<#<name>elcapitan_${hostname}_${id}<#; s#<name>.*<#<name>elcapitan_libvirt_${hostname}_${id}<#;
s#<vcpu (.*)>[0-9]+#<vcpu \\1>$threads#; s#<vcpu (.*)>[0-9]+#<vcpu \\1>$threads#;
s#<topology (.*)cores='[0-9]+'#<topology \\1cores='$cores'#; s#<topology (.*)cores='[0-9]+'#<topology \\1cores='$cores'#;
s#<source file='(.*\\.qcow2)'#<source file='/var/lib/libvirt/ephemeral/elcapitan_${hostname}_${id}.qcow2'#; s#<source file='(.*\\.qcow2)'#<source file='/var/lib/libvirt/ephemeral/elcapitan_libvirt_${hostname}_${id}.qcow2'#;
" "$xml" " "$xml"
virsh define "$xml" virsh define "$xml"