~aleteoryx/muditaos

51c3dd2261d3645a297a88126fb9a1b6bded74e6 — Bartosz Cichocki 4 years ago 2906bb8
[EGD-8019] Clean docker build scripts

Cleanup of docker scripts and small fixups
M config/bootstrap_config => config/bootstrap_config +1 -8
@@ 8,20 8,13 @@ ARM_GCC_PATH_VAR="${ARM_GCC//-/_}"
ARM_GCC_MD5="8312c4c91799885f222f663fc81f9a31"

CMAKE_VERSION="3.21.3"
CMAKE_NAME="cmake-${CMAKE_VERSION}-Linux-x86_64"
CMAKE_NAME="cmake-${CMAKE_VERSION}-linux-x86_64"
CMAKE_SOURCE_LINK="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_NAME}.tar.gz"
CMAKE_PKG="${CMAKE_SOURCE_LINK##*/}"
CMAKE_PATH_VAR=${CMAKE_NAME//[-.]/_}
CMAKE_SHA_LINK="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-SHA-256.txt"
CMAKE_SHA_FILE="${CMAKE_SHA_LINK##*/}"


GH_RUNNER_VERSION="2.277.1"
GH_RUNNER_NAME="actions-runner-linux-x64-${GH_RUNNER_VERSION}"
GH_RUNNER_LINK="https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/${GH_RUNNER_NAME}.tar.gz"
GH_RUNNER_PKG="${GH_RUNNER_LINK##*/}"
GH_RUNNER_PATH_VAR=${GH_RUNNER_NAME//[-.]/_}

INSTALL_PACKAGES=" 
        apt-utils \
        bash-completion \

M config/build_runner_docker => config/build_runner_docker +1 -2
@@ 3,7 3,7 @@ SCRIPT=$(readlink -f $0)
SCRIPT_DIR="$(dirname ${SCRIPT})"
SRC_ROOT=$(readlink -f ${SCRIPT_DIR}/..)

source ${SRC_ROOT}/config/common_scripsts_lib
source ${SRC_ROOT}/config/common_scripts_lib
source ${SRC_ROOT}/config/bootstrap_config

DOCKER_DIR=${SRC_ROOT}/docker


@@ 17,7 17,6 @@ INSTALL_PACKAGES=$( echo "${INSTALL_PACKAGES}" | tr "\n" " "| tr -s " ")
function prepareDockerFile() {
    sed -e "s#@ARM_GCC_PKG@#${ARM_GCC_PKG}#g" \
        -e "s#@CMAKE_PKG@#${CMAKE_PKG}#g" \
        -e "s#@GH_RUNNER_PKG@#${GH_RUNNER_PKG}#g" \
        -e "s#@CMAKE_NAME@#${CMAKE_NAME}#g" \
        -e "s#@ARM_GCC@#${ARM_GCC}#g;" \
        -e "s#@DOCKER_TIMEZONE@#${DOCKER_TIMEZONE}#g;" \

R config/common_scripsts_lib => config/common_scripts_lib +0 -4
@@ 21,7 21,3 @@ function getArmCC() {
function getCMake() {
    wget --no-verbose --show-progress -O ${CMAKE_PKG} ${CMAKE_SOURCE_LINK}
}

function getGHRunner() {
    wget --no-verbose --show-progress -O ${GH_RUNNER_PKG} ${GH_RUNNER_LINK}
}

M config/download_assets => config/download_assets +1 -7
@@ 9,7 9,7 @@ DEST_DIR="${SRC_ROOT}/docker/assets"
DEST_PYREQ_TMP="${DEST_DIR}/requirements.txt.tmp"
DEST_PYREQ="${DEST_DIR}/requirements.txt"

. ${SRC_ROOT}/config/common_scripsts_lib
. ${SRC_ROOT}/config/common_scripts_lib
. ${SRC_ROOT}/config/bootstrap_config

printVar SCRIPT


@@ 34,11 34,6 @@ function get_cmake() {
    sha256sum -c ${CMAKE_SHA_FILE}
}

function get_gh_runner() {
    echo -e "\e[32m${FUNCNAME[0]}\e[0m"
    wget --no-verbose --show-progress -c -O ${GH_RUNNER_PKG} ${GH_RUNNER_LINK}
}

function getPythonReq() {
    echo -e "\e[32m${FUNCNAME[0]}\e[0m"
    cat ${SRC_ROOT}/test/requirements.txt > ${DEST_PYREQ_TMP}


@@ 48,7 43,6 @@ function getPythonReq() {

get_arm_toolchain
get_cmake
get_gh_runner
getPythonReq



M config/license_header_check.sh => config/license_header_check.sh +1 -1
@@ 9,7 9,7 @@ SCRIPT_DIR="$(dirname ${SCRIPT})"
REPO_ROOT="${SCRIPT_DIR%/*}"

#. ${SCRIPT_DIR}/bootstrap_config
. ${SCRIPT_DIR}/common_scripsts_lib
. ${SCRIPT_DIR}/common_scripts_lib
. ${SCRIPT_DIR}/format-config.sh

#printVar SCRIPT

M config/requirements.txt => config/requirements.txt +0 -1
@@ 1,2 1,1 @@
gitpython==3.1.11
tqdm==4.54.1

M docker/Dockerfile.runner.in => docker/Dockerfile.runner.in +3 -3
@@ 31,12 31,10 @@ ADD assets/@ARM_GCC_PKG@ /usr/local/
# CMake
ADD assets/@CMAKE_PKG@ /usr/local/

ADD assets/@GH_RUNNER_PKG@ /home/runner/app

ENV CMAKE_NAME="/usr/local/@CMAKE_NAME@"
ENV ARM_GCC="/usr/local/@ARM_GCC@"

ENV PATH="/user/local/actions-runner:/usr/local/@CMAKE_NAME@/bin:/usr/local/@ARM_GCC@/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ENV PATH="/user/local/actions-runner:/usr/local/@CMAKE_NAME@/bin:/usr/local/@ARM_GCC@/bin:$PATH"
ENV TERM="xterm-256color"

ADD assets/.bashrc /home/docker/


@@ 45,6 43,8 @@ COPY assets/cmd.sh /cmd.sh
COPY assets/entrypoint.sh /entrypoint.sh
COPY ci_actions.sh /ci_actions.sh

RUN echo "export PATH="/user/local/actions-runner:/usr/local/@CMAKE_NAME@/bin:/usr/local/@ARM_GCC@/bin:$PATH"" > /etc/profile.d/setup_path.sh
RUN chmod +x /etc/profile.d/setup_path.sh
RUN chmod +x /cmd.sh && \
    chmod +x /entrypoint.sh && \
    groupadd -r runner && \

M docker/jenkins-docker/Dockerfile => docker/jenkins-docker/Dockerfile +3 -2
@@ 1,4 1,4 @@
FROM wearemudita/mudita_os_builder:1.12
FROM wearemudita/mudita_os_builder:latest

MAINTAINER ops@mudita.com
# Docker runner for MuditaOS builds


@@ 28,11 28,12 @@ RUN sed -i /etc/ssh/sshd_config \

RUN mkdir -p /var/run/sshd

RUN adduser --quiet --gecos '' --disabled-password jenkins 
RUN adduser --quiet --gecos '' --disabled-password --uid 6666 jenkins

COPY .ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
COPY start-sshd /usr/local/bin/start-sshd
RUN chown -R jenkins:jenkins /home/jenkins/.ssh
RUN cat /etc/profile.d/setup_path.sh >> /home/jenkins/.bashrc

#RUN chmod -x /cmd.sh && \
#    chmod -x /entrypoint.sh

M test/requirements.txt => test/requirements.txt +2 -1
@@ 2,7 2,7 @@ attrs==20.3.0
iniconfig==1.1.1
packaging==20.4
pluggy==0.13.1
py==1.9.0
py==1.10.0
pyparsing==2.4.7
pyserial==3.5
pytest==6.1.2


@@ 13,3 13,4 @@ dataclasses==0.6
dataclasses_json==0.5.4
tqdm==4.62.2
eyed3==0.9.6
ghapi