[Fuego] [PATCH 5/5] nojenkins: add a way to run Fuego without jenkins

Tim.Bird at sony.com Tim.Bird at sony.com
Wed Feb 27 23:56:18 UTC 2019


Applied.  Thanks.
 -- Tim


> -----Original Message-----
> From: Daniel Sangorrin
> 
> Here I have added a new configuration variable called
> jenkins_enabled that will be checked by ftc.
> Note: I have also added another variable to hold the hostname
> where jenkins is hosted.
> 
> Apart from that I created a new Dockerfile.nojenkins that is
> the same as Dockerfile but removes the jenkins installation
> bits. You can see how to use it by reading the header of
> Dockerfile.nojenkins. We should probably convert Dockerfile
> to do a FROM fuego-nonjenkins in the future, to avoid
> redundancy.
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  Dockerfile                               |   1 +
>  Dockerfile.nojenkins                     | 129
> +++++++++++++++++++++++++++++++
>  fuego-host-scripts/docker-build-image.sh |   8 +-
>  fuego-ro/conf/fuego.conf                 |   4 +
>  4 files changed, 141 insertions(+), 1 deletion(-)
>  create mode 100644 Dockerfile.nojenkins
> 
> diff --git a/Dockerfile b/Dockerfile
> index 1e57bb2..b183e1a 100644
> --- a/Dockerfile
> +++ b/Dockerfile
> @@ -2,6 +2,7 @@
>  # WARNING: this Dockerfile assumes that the container will be created with
>  # several volume bind mounts (see docker-create-container.sh)
>  #
> ==========================================================
> ====================
> +# FIXTHIS: build this as an extension of the nonjenkins image
> 
>  FROM debian:jessie
>  MAINTAINER tim.bird at sony.com
> diff --git a/Dockerfile.nojenkins b/Dockerfile.nojenkins
> new file mode 100644
> index 0000000..f3392f9
> --- /dev/null
> +++ b/Dockerfile.nojenkins
> @@ -0,0 +1,129 @@
> +#
> ==========================================================
> ====================
> +# WARNING: this Dockerfile assumes that the container will be created with
> +# several volume bind mounts (see docker-create-container.sh)
> +#
> ==========================================================
> ====================
> +# Usage:
> +# host$ vi fuego-ro/conf/fuego.conf
> +#    jenkins_enabled=0
> +# host$ ./fuego-host-scripts/docker-build-image.sh fuego-nojenkins 8080
> Dockerfile.nojenkins
> +# host$ ./fuego-host-scripts/docker-create-container.sh fuego-nojenkins
> fuego-nojenkins-container
> +# host$ ./fuego-host-scripts/docker-start-container.sh fuego-nojenkins-
> container
> +# docker# ftc list-boards
> +#   docker, bbb, ...
> +# docker# ftc list-tests
> +#   Functional.hello_world, ...
> +# docker# ftc run-test -b docker -t Functional.hello_world
> +#   log_compare: pattern 'SUCCESS' found 1 times (expected greater or
> equal than 1)
> +
> +FROM debian:jessie
> +MAINTAINER tim.bird at sony.com
> +
> +#
> ==========================================================
> ====================
> +# Proxy variables
> +#
> ==========================================================
> ====================
> +
> +ARG HTTP_PROXY
> +ENV http_proxy ${HTTP_PROXY}
> +ENV https_proxy ${HTTP_PROXY}
> +
> +#
> ==========================================================
> ====================
> +# Prepare basic image
> +#
> ==========================================================
> ====================
> +
> +ARG DEBIAN_FRONTEND=noninteractive
> +
> +WORKDIR /
> +RUN echo deb http://httpredir.debian.org/debian jessie main non-free >
> /etc/apt/sources.list
> +RUN echo deb http://httpredir.debian.org/debian jessie-updates main
> non-free >> /etc/apt/sources.list
> +RUN echo deb http://security.debian.org/ jessie/updates main >>
> /etc/apt/sources.list
> +RUN if [ -n "$HTTP_PROXY" ]; then echo 'Acquire::http::proxy
> "'$HTTP_PROXY'";' > /etc/apt/apt.conf.d/80proxy; fi
> +
> +# Fuego python dependencies
> +# - python-lxml: ftc, loggen
> +# - python-simplejson: ftc
> +# - python-yaml: ftc
> +# - python-openpyxl: ftc (also LTP)
> +# - python-requests: ftc (also fuego_release_test)
> +# - python-reportlab: ftc
> +# - python-parsedatetime: ftc
> +# - python-pip: to install filelock, flake8
> +# - filelock: parser
> +RUN apt-get update && apt-get -yV install \
> +	python-lxml python-simplejson python-yaml python-openpyxl \
> +	python-requests python-reportlab python-parsedatetime \
> +	python-pip
> +RUN pip install filelock
> +
> +# Fuego command dependencies
> +RUN apt-get update && apt-get -yV install \
> +	git sshpass openssh-client sudo net-tools wget curl lava-tool
> +
> +# Default SDK for testing locally or on an x86 board
> +RUN apt-get update && apt-get -yV install \
> +	gcc g++ make cmake bison flex autoconf automake libtool \
> +	libelf-dev libssl-dev libsdl1.2-dev libcairo2-dev libxmu-dev \
> +	libxmuu-dev libglib2.0-dev libaio-dev u-boot-tools pkg-config
> +
> +# Default test host dependencies
> +# - iperf iperf3 netperf: used as servers on the host
> +# - bzip2 bc: used for local tests by Functional.bzip2/bc
> +# - python-matplotlib: Benchmark.iperf3 parser
> +# - python-xmltodict: AGL tests
> +# - flake8: Functional.fuego_lint
> +# FIXTHIS: install dependencies dynamically on the tests that need them
> +RUN apt-get update && apt-get -yV install \
> +	iperf iperf3 netperf bzip2 bc python-matplotlib python-xmltodict
> +RUN pip install flake8
> +
> +# FIXTHIS: determine if these tools are really necessary
> +# RUN apt-get update && apt-get -yV install \
> +#	apt-utils python-paramiko python-serial \
> +#	xmlstarlet rsync diffstat vim  \
> +#	inotify-tools gettext time netpipe-tcp \
> +#	at minicom lzop bsdmainutils \
> +#	mc netcat openssh-server
> +
> +RUN /bin/bash -c 'echo "dash dash/sh boolean false" | debconf-set-
> selections ; dpkg-reconfigure dash'
> +RUN if [ -n "$HTTP_PROXY" ]; then echo "use_proxy = on" >> /etc/wgetrc; fi
> +RUN if [ -n "$HTTP_PROXY" ]; then echo -e
> "http_proxy=$HTTP_PROXY\nhttps_proxy=$HTTP_PROXY" >>
> /etc/environment; fi
> +
> +#
> ==========================================================
> ====================
> +# get ttc script and helpers
> +#
> ==========================================================
> ====================
> +RUN git clone https://github.com/tbird20d/ttc.git /usr/local/src/ttc
> +RUN /usr/local/src/ttc/install.sh /usr/local/bin
> +RUN perl -p -i -e "s#config_dir = \"/etc\"#config_dir = \"/fuego-ro/conf\"#"
> /usr/local/bin/ttc
> +
> +#
> ==========================================================
> ====================
> +# Serial Config
> +#
> ==========================================================
> ====================
> +
> +RUN /bin/bash -c 'git clone https://github.com/frowand/serio.git
> /usr/local/src/serio ;  cp /usr/local/src/serio/serio /usr/local/bin/ ; ln -s
> /usr/local/bin/serio /usr/local/bin/sercp ; ln -s /usr/local/bin/serio
> /usr/local/bin/sersh'
> +
> +RUN /bin/bash -c 'git clone https://github.com/tbird20d/serlogin.git
> /usr/local/src/serlogin ;  cp /usr/local/src/serlogin/serlogin /usr/local/bin'
> +
> +#
> ==========================================================
> ====================
> +# fserver
> +#
> ==========================================================
> ====================
> +
> +RUN /bin/bash -c 'git clone https://github.com/tbird20d/fserver.git
> /usr/local/lib/fserver ; ln -s /usr/local/lib/fserver/start_local_bg_server
> /usr/local/bin/start_local_bg_server'
> +
> +#
> ==========================================================
> ====================
> +# ftc post installation
> +#
> ==========================================================
> ====================
> +
> +RUN ln -s /fuego-core/scripts/ftc /usr/local/bin/
> +
> +#
> ==========================================================
> ====================
> +# Lava
> +#
> ==========================================================
> ====================
> +
> +RUN ln -s /fuego-ro/scripts/fuego-lava-target-setup /usr/local/bin
> +RUN ln -s /fuego-ro/scripts/fuego-lava-target-teardown /usr/local/bin
> +
> +#
> ==========================================================
> ====================
> +# Setup startup command
> +#
> ==========================================================
> ====================
> +
> +# FIXTHIS: when running multiple Fuego containers netperf will complain
> because the port is taken
> +ENTRYPOINT service netperf start && iperf3 -V -s -D -f M && /bin/bash
> diff --git a/fuego-host-scripts/docker-build-image.sh b/fuego-host-
> scripts/docker-build-image.sh
> index b752b91..6b1834a 100755
> --- a/fuego-host-scripts/docker-build-image.sh
> +++ b/fuego-host-scripts/docker-build-image.sh
> @@ -1,8 +1,14 @@
>  #!/bin/bash
>  # $1 - name for the docker image (default: fuego)
>  # $2 - port for jenkins (default: 8080)
> +# $3 - Dockerfile or Dockerfile.nojenkins
> +#
> +# Example:
> +#  ./fuego-host-scripts/docker-build-image.sh myfuegoimg 8082
> Dockerfile.nojenkins
> +#
>  DOCKERIMAGE=${1:-fuego}
>  JENKINS_PORT=${2:-8080}
> +DOCKERFILE=${3:-Dockerfile}
> 
>  # uncomment this to avoid using the docker cache while building
>  # (for testing)
> @@ -20,4 +26,4 @@ echo "Using Port $JENKINS_PORT"
> 
>  sudo docker build ${NO_CACHE} -t ${DOCKERIMAGE} --build-arg
> HTTP_PROXY=$http_proxy \
>  	--build-arg uid=$JENKINS_UID --build-arg gid=$JENKINS_GID \
> -	--build-arg JENKINS_PORT=$JENKINS_PORT .
> +	--build-arg JENKINS_PORT=$JENKINS_PORT -f $DOCKERFILE .
> diff --git a/fuego-ro/conf/fuego.conf b/fuego-ro/conf/fuego.conf
> index 56c8c3a..f422487 100644
> --- a/fuego-ro/conf/fuego.conf
> +++ b/fuego-ro/conf/fuego.conf
> @@ -1,5 +1,9 @@
>  # This is the main Fuego configuration file
> 
> +### Jenkins
> +jenkins_enabled=1
> +jenkins_hostname=localhost
> +
>  ### local Fuego host name
>  # host_name is the hostname of your Fuego host
>  # It should be unique in the world - you may wish to use a fully qualified
> --
> 2.7.4
> 
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego


More information about the Fuego mailing list