mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00

Added alternative builder for project images: buildah https://github.com/containers/buildah Considering that some of our plugins use CRI-O runtime it could be a good idea to get rid of docker as a builder. It should allow us not to run docker daemon at all, even for build purposes. Kubernetes also goes this way encouraging users to switch to CRI runtimes (CRI-O and containerd), so having non-docker builds supported looks good from this perspective too.
33 lines
1015 B
Bash
Executable File
33 lines
1015 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
BUILDER=$1
|
|
|
|
# check if DCP tarball is present
|
|
DCP_TARBALL=a10_gx_pac_ias_1_1_pv_rte_installer.tar.gz
|
|
if [ ! -f ${DCP_TARBALL} ] ; then
|
|
echo "ERROR: 'Acceleration Stack for Runtime' tarball $DCP_TARBALL not present"
|
|
echo "ERROR: Please, download it from https://www.intel.com/content/www/us/en/programmable/solutions/acceleration-hub/downloads.html and run this script again"
|
|
exit 1
|
|
fi
|
|
|
|
# build CRI hook
|
|
HOOK=fpga_crihook
|
|
make -C ../../ $HOOK
|
|
cp ../../cmd/$HOOK/$HOOK ./intel-fpga-crihook
|
|
|
|
# build initcontainer image
|
|
WORKSPACE=`realpath .`
|
|
IMG="intel-fpga-initcontainer"
|
|
TAG=$(git rev-parse HEAD)
|
|
|
|
if [ -z "${BUILDER}" -o "${BUILDER}" = 'docker' ] ; then
|
|
docker build --rm -t $IMG:devel -f $WORKSPACE/$IMG.Dockerfile $WORKSPACE
|
|
docker tag $IMG:devel $IMG:$TAG
|
|
elif [ "${BUILDER}" = 'buildah' ] ; then
|
|
buildah bud -t $IMG:devel -f $WORKSPACE/$IMG.Dockerfile --layers $WORKSPACE
|
|
buildah tag $IMG:devel $IMG:$TAG
|
|
else
|
|
(>&2 echo "Unknown builder ${BUILDER}")
|
|
exit 1
|
|
fi
|