Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
ci/install_runtime: Allow to skip vhost setup
Browse files Browse the repository at this point in the history
The install_runtime.sh script attempts to load the vhost module if USE_VSOCK is
enabled. In the OpenShift CI it can build with vsock but the host configuration
should not be changed, in fact trying to load the vhost module will end up on
failure. So this introduces the OPENSHIFT_CI variable which if set to 'true'
it will skip vhost setup in the host.

Fixes #2614

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
  • Loading branch information
wainersm committed Dec 18, 2020
1 parent 4c32c7e commit d99b58d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .ci/install_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export SYSCONFDIR=/etc
# Artifacts (kernel + image) live below here
export SHAREDIR=${PREFIX}/share

# Whether running on OpenShift CI or not.
OPENSHIFT_CI="${OPENSHIFT_CI:-false}"

runtime_config_path="${SYSCONFDIR}/kata-containers/configuration.toml"
runtime_src_path="${GOPATH}/src/${KATA_REPO}/src/runtime"

Expand Down Expand Up @@ -128,13 +131,16 @@ if [ "$USE_VSOCK" == "yes" ]; then
echo "Configure use of VSOCK in ${runtime_config_path}"
sudo sed -i -e 's/^#use_vsock.*/use_vsock = true/' "${runtime_config_path}"

vsock_module="vhost_vsock"
echo "Check if ${vsock_module} is loaded"
if lsmod | grep -q "$vsock_module" &> /dev/null ; then
echo "Module ${vsock_module} is already loaded"
else
echo "Load ${vsock_module} module"
sudo modprobe "${vsock_module}"
# On OpenShift CI the vhost module should not be loaded on build time.
if [ "$OPENSHIFT_CI" == "false" ]; then
vsock_module="vhost_vsock"
echo "Check if ${vsock_module} is loaded"
if lsmod | grep -q "$vsock_module" &> /dev/null ; then
echo "Module ${vsock_module} is already loaded"
else
echo "Load ${vsock_module} module"
sudo modprobe "${vsock_module}"
fi
fi
fi

Expand Down

0 comments on commit d99b58d

Please # to comment.