[Fuego] [PATCH 3/5] docker: rename scripts to differentiate from local

Tim.Bird at sony.com Tim.Bird at sony.com
Thu Feb 28 00:56:13 UTC 2019


I'm hesitating on this one...

I don't think I want to rename the install and start scripts to
include the word docker.  This is the default case, and IMHO still
the preferred installation configuration, and I'd rather
that these scripts retained the simpler names.

Let me know what you think.
 --  Tim

P.S. I tried adding the 4/5 patch, but it depends on this one.
I'll probably manually override the conflicts, so you might
need to re-pull my 'next' branch and rebase this one if
you want to submit this one again (after convincing me :-).



> -----Original Message-----
> From: Daniel Sangorrin
> 
> In anticipation of a new script for installing Fuego on
> the local host, we rename docker scripts to make it clear
> that they are supposed to be used on docker installations
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  README                   | 14 ++++-----
>  docs/QuickstartGuide.rst |  8 ++---
>  docs/source/install.tex  |  4 +--
>  install-docker.sh        | 77
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  install.sh               | 77 ------------------------------------------------
>  start-docker.sh          | 25 ++++++++++++++++
>  start.sh                 | 25 ----------------
>  7 files changed, 115 insertions(+), 115 deletions(-)
>  create mode 100755 install-docker.sh
>  delete mode 100755 install.sh
>  create mode 100755 start-docker.sh
>  delete mode 100755 start.sh
> 
> diff --git a/README b/README
> index 5eb4d66..c106a01 100644
> --- a/README
> +++ b/README
> @@ -31,27 +31,27 @@ one.
> 
>  Installing Fuego to a docker container
>  -------------------------------------------------------------------------------
> -Run install.sh from the top directory. This launches the ``docker build''
> +Run install-docker.sh from the top directory. This launches the ``docker
> build''
>  command to create a docker image - named 'fuego' by default.
>  It also creates a container from this image, called 'fuego-container'
> 
>  Note that if you have tests or test infrastructure that requires
> -access to USB or serial ports, you should run install.sh with the
> +access to USB or serial ports, you should run install-docker.sh with the
>  '--priv' option, like so:
> -  ./install.sh --priv
> +  ./install-docker.sh --priv
> 
>  You can change the name of the docker image and the port used by Jenkins
> -by passing the corresponding parameters to install.sh.
> -  ./install.sh fuego-8082 8082
> +by passing the corresponding parameters to install-docker.sh.
> +  ./install-docker.sh fuego-8082 8082
> 
>  Running
>  -------------------------------------------------------------------------------
>  To start your Fuego container, issue the following command top directory:
> 
> -  ./start.sh fuego-container
> +  ./start-docker.sh fuego-container
> 
>  (or, use the name of whatever container was created in the install step.
> -For example, ./start.sh fuego-8082-container).
> +For example, ./start-docker.sh fuego-8082-container).
> 
>  The shell used to start the container will enter a shell inside the
>  container.  If you exit that shell, the container will stop, and you
> diff --git a/docs/QuickstartGuide.rst b/docs/QuickstartGuide.rst
> index 57ba826..8368588 100644
> --- a/docs/QuickstartGuide.rst
> +++ b/docs/QuickstartGuide.rst
> @@ -39,16 +39,16 @@ prompt:::
> 
>    $ git clone https://bitbucket.org/tbird20d/fuego.git
>    $ git clone https://bitbucket.org/tbird20d/fuego-core.git
> -  $ cd fuego ; ./install.sh
> -  $ ./start.sh
> +  $ cd fuego ; ./install-docker.sh
> +  $ ./start-docker.sh
>    $ firefox http://localhost:8080/fuego
> 
> 
> -The third step (with ./install.sh) will take some time - about 45 minutes
> +The third step (with ./install-docker.sh) will take some time - about 45
> minutes
>  on my machine.  This is the main step that is building the docker
>  container.
> 
> -When you run the 'start.sh' script, the terminal
> +When you run the 'start-docker.sh' script, the terminal
>  where this is run will be placed at a shell prompt, as the root user,
>  inside the docker container.  The container will run until you exit this
>  shell.  You should leave it running for the duration of your testing.
> diff --git a/docs/source/install.tex b/docs/source/install.tex
> index e2aa409..9938f9e 100644
> --- a/docs/source/install.tex
> +++ b/docs/source/install.tex
> @@ -11,9 +11,9 @@
>  \subsection{Running install script}
>  \label{sec:inst-steps}
> 
> -Simply run install.sh script. It will create a docker container with Fuego
> installed. When it's done you should start a docker container by running the
> following command top directory:
> +Simply run install-docker.sh script. It will create a docker container with
> Fuego installed. When it's done you should start a docker container by
> running the following command top directory:
>  \begin{itemize}
> -\item \texttt{./start.sh}.
> +\item \texttt{./start-docker.sh}.
>  \end{itemize}
> 
>  When the container is started, the Fuego web interface will be available on
> local machine at port \href{http://localhost:8080}{8080}.
> diff --git a/install-docker.sh b/install-docker.sh
> new file mode 100755
> index 0000000..4196f27
> --- /dev/null
> +++ b/install-docker.sh
> @@ -0,0 +1,77 @@
> +#!/bin/bash
> +#
> +# install-docker.sh [--help] [--priv] [--no-cache] [--nojenkins]
> [<image_name>] [<port>]
> +#
> +
> +if [ -n "$1" ]; then
> +    if [ "$1" = "--help" -o "$1" = "-h" ]; then
> +        cat <<HERE
> +Usage: install-docker.sh [--help] [--priv] [--no-cache] [--nojenkins]
> [<image_name>] [<port>]
> +
> +Create the docker image and container with the Fuego test distribution.
> +If no <image_name> is provided, the image will be named 'fuego'.
> +The container name will be: '<image-name>-container'.
> +  (default: 'fuego-container')
> +
> +options:
> + --help   Show usage help
> + --priv   Create a privileged container, that can access serial ports
> +          and USB devices.  This may be needed if you have tests or
> +          test infrastructure that requires access to serial and usb
> +          devices.
> + --no-cache Don't use cache when creating the docker image
> + --nojenkins Creates a docker image and container without Jenkins
> +HERE
> +        exit 0
> +    fi
> +fi
> +
> +priv=0
> +if [ "$1" = "--priv" ]; then
> +    priv=1
> +    shift
> +fi
> +
> +if [ "$1" = "--no-cache" ]; then
> +    NOCACHE=--no-cache
> +    shift
> +fi
> +
> +dockerfile="Dockerfile"
> +if [ "$1" = "--nojenkins" ]; then
> +    dockerfile="Dockerfile.nojenkins"
> +    shift
> +fi
> +
> +# get fuego-core repository, if not already present
> +if [ ! -f fuego-core/scripts/ftc ] ; then
> +    # set fuego-core branch to same as current fuego branch
> +    # get current git branch
> +    set -o noglob
> +    while IFS=" " read -r part1 part2 ; do
> +        if [ $part1 = "*" ] ; then
> +            branch=$part2
> +        fi
> +    done < <(git branch)
> +    set +o noglob
> +    git clone -b $branch https://bitbucket.org/fuegotest/fuego-core.git
> +fi
> +
> +image_name=${1:-fuego}
> +jenkins_port=${2:-8080}
> +container_name="${image_name}-container"
> +
> +set -e
> +
> +source fuego-host-scripts/docker-build-image.sh $NOCACHE
> ${image_name} ${jenkins_port} ${dockerfile}
> +if [ "$priv" == "0" ]; then
> +    fuego-host-scripts/docker-create-container.sh ${image_name}
> ${container_name}
> +else
> +    fuego-host-scripts/docker-create-usb-privileged-container.sh
> ${image_name} ${container_name}
> +fi
> +
> +# copy host's ttc.conf file (if present) into the fuego configuration directory
> +sudo /bin/sh -c "if [ -f /etc/ttc.conf -a ! -f fuego-ro/conf/ttc.conf ] ; then cp
> /etc/ttc.conf fuego-ro/conf/ttc.conf ; fi"
> +
> +echo "Docker container '${container_name}' is ready with Fuego
> installation."
> +echo "To start, run: ./start-docker.sh ${container_name}"
> diff --git a/install.sh b/install.sh
> deleted file mode 100755
> index 6acc4da..0000000
> --- a/install.sh
> +++ /dev/null
> @@ -1,77 +0,0 @@
> -#!/bin/bash
> -#
> -# install.sh [--help] [--priv] [--no-cache] [--nojenkins] [<image_name>]
> [<port>]
> -#
> -
> -if [ -n "$1" ]; then
> -    if [ "$1" = "--help" -o "$1" = "-h" ]; then
> -        cat <<HERE
> -Usage: install.sh [--help] [--priv] [--no-cache] [--nojenkins] [<image_name>]
> [<port>]
> -
> -Create the docker image and container with the Fuego test distribution.
> -If no <image_name> is provided, the image will be named 'fuego'.
> -The container name will be: '<image-name>-container'.
> -  (default: 'fuego-container')
> -
> -options:
> - --help   Show usage help
> - --priv   Create a privileged container, that can access serial ports
> -          and USB devices.  This may be needed if you have tests or
> -          test infrastructure that requires access to serial and usb
> -          devices.
> - --no-cache Don't use cache when creating the docker image
> - --nojenkins Creates a docker image and container without Jenkins
> -HERE
> -        exit 0
> -    fi
> -fi
> -
> -priv=0
> -if [ "$1" = "--priv" ]; then
> -    priv=1
> -    shift
> -fi
> -
> -if [ "$1" = "--no-cache" ]; then
> -    NOCACHE=--no-cache
> -    shift
> -fi
> -
> -dockerfile="Dockerfile"
> -if [ "$1" = "--nojenkins" ]; then
> -    dockerfile="Dockerfile.nojenkins"
> -    shift
> -fi
> -
> -# get fuego-core repository, if not already present
> -if [ ! -f fuego-core/scripts/ftc ] ; then
> -    # set fuego-core branch to same as current fuego branch
> -    # get current git branch
> -    set -o noglob
> -    while IFS=" " read -r part1 part2 ; do
> -        if [ $part1 = "*" ] ; then
> -            branch=$part2
> -        fi
> -    done < <(git branch)
> -    set +o noglob
> -    git clone -b $branch https://bitbucket.org/fuegotest/fuego-core.git
> -fi
> -
> -image_name=${1:-fuego}
> -jenkins_port=${2:-8080}
> -container_name="${image_name}-container"
> -
> -set -e
> -
> -source fuego-host-scripts/docker-build-image.sh $NOCACHE
> ${image_name} ${jenkins_port} ${dockerfile}
> -if [ "$priv" == "0" ]; then
> -    fuego-host-scripts/docker-create-container.sh ${image_name}
> ${container_name}
> -else
> -    fuego-host-scripts/docker-create-usb-privileged-container.sh
> ${image_name} ${container_name}
> -fi
> -
> -# copy host's ttc.conf file (if present) into the fuego configuration directory
> -sudo /bin/sh -c "if [ -f /etc/ttc.conf -a ! -f fuego-ro/conf/ttc.conf ] ; then cp
> /etc/ttc.conf fuego-ro/conf/ttc.conf ; fi"
> -
> -echo "Docker container '${container_name}' is ready with Fuego
> installation."
> -echo "To start, run: ./start.sh ${container_name}"
> diff --git a/start-docker.sh b/start-docker.sh
> new file mode 100755
> index 0000000..6896305
> --- /dev/null
> +++ b/start-docker.sh
> @@ -0,0 +1,25 @@
> +#!/bin/bash
> +#
> +# start-docker.sh [<container-name>]
> +#
> +
> +if [ -n "$1" ]; then
> +    if [ "$1" = "--help" -o "$1" = "-h" ]; then
> +        cat <<HERE
> +Usage: start-docker.sh [--help] [<container_name>]
> +
> +Start the docker container which contains the Fuego test system.
> +If no <container_name> is provided, start one named 'fuego-container'.
> +
> +options:
> + --help   Show usage help
> +HERE
> +        exit 0
> +    fi
> +fi
> +
> +container_name="${1:-fuego-container}"
> +
> +set -e
> +
> +fuego-host-scripts/docker-start-container.sh ${container_name}
> diff --git a/start.sh b/start.sh
> deleted file mode 100755
> index c7bab14..0000000
> --- a/start.sh
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -#!/bin/bash
> -#
> -# start.sh [<container-name>]
> -#
> -
> -if [ -n "$1" ]; then
> -    if [ "$1" = "--help" -o "$1" = "-h" ]; then
> -        cat <<HERE
> -Usage: start.sh [--help] [<container_name>]
> -
> -Start the docker container which contains the Fuego test system.
> -If no <container_name> is provided, start one named 'fuego-container'.
> -
> -options:
> - --help   Show usage help
> -HERE
> -        exit 0
> -    fi
> -fi
> -
> -container_name="${1:-fuego-container}"
> -
> -set -e
> -
> -fuego-host-scripts/docker-start-container.sh ${container_name}
> --
> 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