This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/openshift-ci: Enable openshift-ci
Enable openshift-ci on runtime repository. Fixes: github.com/kata-containers/tests#2527 Depends-on: github.com/kata-containers/tests#2802 Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
- Loading branch information
Showing
3 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2020 Red Hat Inc. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Build and install kata-containers under <repository>/_out/build_install | ||
# | ||
|
||
set -e | ||
|
||
export GOPATH=${GOPATH:-${HOME}/go} | ||
cidir=$(dirname "$0")/.. | ||
source "${cidir}/lib.sh" | ||
|
||
export kata_repo=$(git config --get remote.origin.url | sed -e 's#http\(s\)*://##') | ||
|
||
mkdir -p $cidir/../_out/build_install | ||
destdir=$(realpath $cidir/../_out/build_install) | ||
|
||
clone_tests_repo | ||
pushd "${tests_repo_dir}" | ||
# Resolve the kata-container repositories. It relies on branch and | ||
# kata_repo variables. | ||
export branch=master | ||
.ci/resolve-kata-dependencies.sh | ||
.ci/openshift-ci/buildall_install.sh $destdir | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2020 Red Hat Inc. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Build the image which wraps the kata-containers installation along with the | ||
# install script. It is used on a daemonset to deploy kata on OpenShift. | ||
# | ||
FROM centos:7 | ||
|
||
RUN yum install -y rsync | ||
|
||
# Load the installation files. | ||
COPY ./_out ./_out | ||
|
||
COPY ./entrypoint.sh /usr/bin | ||
|
||
ENTRYPOINT /usr/bin/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2020 Red Hat Inc. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Synchronize the kata-containers installation with in the host filesystem. | ||
# | ||
set -x | ||
|
||
install_status=1 | ||
|
||
SRC="${PWD}/_out/build_install" | ||
|
||
# Expect the host filesystem to be mounted in following path. | ||
HOST_MOUNT=/host | ||
|
||
# Some files are copied over /usr which on Red Hat CoreOS (rhcos) is mounted | ||
# read-only by default. So re-mount it as read-write, otherwise files won't | ||
# get copied. | ||
mount -o remount,rw $HOST_MOUNT/usr | ||
|
||
# The host's '/opt' and '/usr/local' are symlinks to, respectively, '/var/opt' | ||
# and '/var/usrlocal'. Adjust the installation files accordingly. | ||
# | ||
cd $SRC | ||
if [ -d 'opt' ]; then | ||
mkdir -p var | ||
mv opt var | ||
fi | ||
|
||
if [ -d "usr/local" ]; then | ||
mkdir -p var | ||
mv usr/local var/usrlocal | ||
fi | ||
|
||
# Copy the installation over the host filesystem. | ||
rsync -a . $HOST_MOUNT | ||
|
||
# Ensure the binaries are searcheable via PATH. Notice it expects that | ||
# kata has been built with PREFIX=/opt/kata. | ||
# | ||
chroot $HOST_MOUNT sh -c 'for t in /opt/kata/bin/*; do ln -s $t /var/usrlocal/bin/; done' | ||
|
||
# Check the installation is good (or not). | ||
chroot $HOST_MOUNT /opt/kata/bin/kata-runtime kata-check | ||
install_status=$? | ||
|
||
# Sending a termination message. Can be used by an orchestrator that will | ||
# look into this file to check the installation has finished and is good. | ||
# | ||
echo "$install_status" >> /tmp/kata_install_status | ||
|
||
# By using it in an openshift daemonset it should spin forever until an | ||
# orchestrator kills it. | ||
# | ||
tail -f /dev/null |