Merge branch 'feature/KASM-2016_ARM_builds' into 'develop'

Resolve KASM-2016 "Feature/ arm builds"

Closes KASM-2016

See merge request kasm-technologies/internal/workspaces-core-images!22
This commit is contained in:
Matthew McClaskey 2021-10-26 15:07:41 +00:00
commit bd3445b203
4 changed files with 54 additions and 29 deletions

View File

@ -6,6 +6,9 @@ stages:
- build - build
- readme - readme
variables:
DOCKER_AUTH_CONFIG: ${_DOCKER_AUTH_CONFIG}
before_script: before_script:
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
- export SANITIZED_BRANCH="$(echo $CI_COMMIT_REF_NAME | sed -r 's#^release/##' | sed 's/\//_/g')" - export SANITIZED_BRANCH="$(echo $CI_COMMIT_REF_NAME | sed -r 's#^release/##' | sed 's/\//_/g')"
@ -15,16 +18,19 @@ before_script:
build_ubuntu_bionic: build_ubuntu_bionic:
stage: build stage: build
script: script:
- docker build -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_ROLLING_BRANCH --build-arg BASE_IMAGE="ubuntu:18.04" --build-arg BG_IMG=bg_bionic.png -f dockerfile-kasm-core . # get qemu ready
- docker push ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_BRANCH - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker push ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_ROLLING_BRANCH # prep the buildx env
- docker push ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_BRANCH - docker buildx create --use
- docker push ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_ROLLING_BRANCH # build for multiple architectures
- docker buildx build --push --platform $BUILD_PLATFORMS -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_ROLLING_BRANCH --build-arg BASE_IMAGE="ubuntu:18.04" --build-arg BG_IMG=bg_bionic.png -f dockerfile-kasm-core .
only: only:
- develop - develop
- /^release\/.*$/ - /^release\/.*$/
except: except:
- schedules - schedules
tags:
- aws-autoscale
build_cuda_bionic: build_cuda_bionic:
stage: build stage: build
@ -87,13 +93,22 @@ build_centos:
# These jobs should run on the feature/bugfix branches - anything that is not the develop or release branches. It should only push images to the private repos # These jobs should run on the feature/bugfix branches - anything that is not the develop or release branches. It should only push images to the private repos
build_ubuntu_bionic_dev: build_ubuntu_bionic_dev:
image: kasmweb/docker-buildx-private:develop
stage: build stage: build
variables:
BUILD_PLATFORMS: "linux/amd64,linux/arm64"
script: script:
- docker build -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_BRANCH --build-arg BASE_IMAGE="ubuntu:18.04" --build-arg BG_IMG=bg_bionic.png -f dockerfile-kasm-core . # get qemu ready
- docker push ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_BRANCH - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# prep the buildx env
- docker buildx create --use
# build for multiple architectures
- docker buildx build --push --platform $BUILD_PLATFORMS -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_BRANCH --build-arg BASE_IMAGE="ubuntu:18.04" --build-arg BG_IMG=bg_bionic.png -f dockerfile-kasm-core .
except: except:
- develop - develop
- /^release\/.*$/ - /^release\/.*$/
tags:
- aws-autoscale
build_cuda_bionic_dev: build_cuda_bionic_dev:
@ -138,11 +153,16 @@ build_centos_dev:
build_ubuntu_bionic_scheduled: build_ubuntu_bionic_scheduled:
stage: build stage: build
script: script:
- docker build -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_ROLLING_BRANCH --build-arg BASE_IMAGE="ubuntu:18.04" --build-arg BG_IMG=bg_bionic.png -f dockerfile-kasm-core . # get qemu ready
- docker push ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_ROLLING_BRANCH - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker push ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_ROLLING_BRANCH # prep the buildx env
- docker buildx create --use
# build for multiple architectures
- docker buildx build --push --platform $BUILD_PLATFORMS -t ${ORG_NAME}/core-ubuntu-bionic-private:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/core-ubuntu-bionic:$SANITIZED_ROLLING_BRANCH --build-arg BASE_IMAGE="ubuntu:18.04" --build-arg BG_IMG=bg_bionic.png -f dockerfile-kasm-core .
only: only:
- schedules - schedules
tags:
- aws-autoscale
build_cuda_bionic_schedules: build_cuda_bionic_schedules:
stage: build stage: build

View File

@ -2,22 +2,13 @@ ARG BASE_IMAGE="ubuntu:18.04"
FROM $BASE_IMAGE AS install_tools FROM $BASE_IMAGE AS install_tools
ARG DISTRO=ubuntu ARG DISTRO=ubuntu
### Install common tools
COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
RUN bash $INST_SCRIPTS/tools/install_tools.sh && rm -rf $INST_SCRIPTS/tools/
FROM install_tools AS squid_builder
### Build Squid
RUN wget 'https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/a590f319f328a8a576cb966c2db5ec4a5b3b7b9b/output/kasm-squid-builder_ubuntu.tar.gz'
RUN tar -xzf kasm-squid-builder_ubuntu.tar.gz -C /
FROM install_tools
MAINTAINER Kasm Tech "info@kasmweb.com" MAINTAINER Kasm Tech "info@kasmweb.com"
LABEL "com.kasmweb.image"="true" LABEL "com.kasmweb.image"="true"
### Install common tools
COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
RUN bash $INST_SCRIPTS/tools/install_tools.sh && rm -rf $INST_SCRIPTS/tools/
### Environment config ### Environment config
ARG START_XFCE4=0 ARG START_XFCE4=0
ARG START_PULSEAUDIO=0 ARG START_PULSEAUDIO=0
@ -102,9 +93,6 @@ RUN bash $INST_SCRIPTS/audio_input/install_audio_input.sh && rm -rf $INST_SCRIPT
COPY ./src/ubuntu/install/cursors $INST_SCRIPTS/cursors/ COPY ./src/ubuntu/install/cursors $INST_SCRIPTS/cursors/
RUN bash $INST_SCRIPTS/cursors/install_cursors.sh && rm -rf $INST_SCRIPTS/cursors/ RUN bash $INST_SCRIPTS/cursors/install_cursors.sh && rm -rf $INST_SCRIPTS/cursors/
### Copy built Squid
COPY --from=squid_builder /usr/local/squid /usr/local/squid
### Install Squid ### Install Squid
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/ COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/ RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/

View File

@ -11,14 +11,21 @@ install_libjpeg_turbo() {
echo "Install KasmVNC server" echo "Install KasmVNC server"
cd /tmp cd /tmp
BUILD_ARCH=$(uname -p)
if [ "${DISTRO}" == "kali" ] ; if [ "${DISTRO}" == "kali" ] ;
then then
BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/a9434a300dbf85e65d0e9c212610a487fd10a308/kasmvncserver_kali-rolling_0.9.3_master_a9434a_amd64.deb" BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/a9434a300dbf85e65d0e9c212610a487fd10a308/kasmvncserver_kali-rolling_0.9.3_master_a9434a_amd64.deb"
elif [ "${DISTRO}" == "centos" ] ; then elif [ "${DISTRO}" == "centos" ] ; then
BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/a9434a300dbf85e65d0e9c212610a487fd10a308/output/centos_core/kasmvncserver-0.9.1~beta-1.el7.x86_64.rpm" BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/a9434a300dbf85e65d0e9c212610a487fd10a308/output/centos_core/kasmvncserver-0.9.1~beta-1.el7.x86_64.rpm"
else
if [[ "${BUILD_ARCH}" =~ ^aarch64$ ]] ; then
BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/a9434a300dbf85e65d0e9c212610a487fd10a308/kasmvncserver_bionic_0.9.3_master_a9434a_arm64.deb"
else else
BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/a9434a300dbf85e65d0e9c212610a487fd10a308/kasmvncserver_bionic_0.9.3_master_a9434a_libjpeg-turbo-latest_amd64.deb" BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/a9434a300dbf85e65d0e9c212610a487fd10a308/kasmvncserver_bionic_0.9.3_master_a9434a_libjpeg-turbo-latest_amd64.deb"
fi fi
fi
if [ "${DISTRO}" == "centos" ] ; then if [ "${DISTRO}" == "centos" ] ; then
@ -27,7 +34,7 @@ if [ "${DISTRO}" == "centos" ] ; then
yum localinstall -y kasmvncserver.rpm yum localinstall -y kasmvncserver.rpm
rm kasmvncserver.rpm rm kasmvncserver.rpm
else else
if [ "$DISTRO" = "ubuntu" ]; then if [[ "$DISTRO" = "ubuntu" ]] && [[ ! "$BUILD_ARCH" =~ ^aarch64$ ]] ; then
install_libjpeg_turbo install_libjpeg_turbo
fi fi

View File

@ -1,8 +1,18 @@
# update squid conf with user info #!/bin/bash
set -ex set -ex
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g')
# intall squid
SQUID_COMMIT='6392f7dfb1040c67c0a5d5518abf508282523cc0'
SQUID_DISTRO=${DISTRO}
# currently all distros use the ubuntu build of squid except centos
if [ ! "${SQUID_DISTRO}" == "centos" ] ; then
SQUID_DISTRO="ubuntu"
fi
wget -qO- "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/${SQUID_COMMIT}/output/kasm-squid-builder_${SQUID_DISTRO}_${ARCH}.tar.gz" | tar -xzf - -C /
# update squid conf with user info
if [ "$DISTRO" = centos ]; then if [ "$DISTRO" = centos ]; then
useradd --system --shell /usr/sbin/nologin --home-dir /bin proxy useradd --system --shell /usr/sbin/nologin --home-dir /bin proxy
fi fi