All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster
@ 2015-10-27 17:27 Ed Bartosh
  2015-10-27 17:27 ` [PATCH 01/25] toaster: don't allow to run toaster as a script Ed Bartosh
                   ` (26 more replies)
  0 siblings, 27 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:27 UTC (permalink / raw)
  To: toaster

Hi,

This patchset merges two Toaster modes in one:

To run toaster you should source it in already prepared build environment:
  cd poky
  . oe-init-build-env
  . ../bitbake/bin/toaster

After that you should be able to trigger builds both ways:
from command line and from toaster UI.

The following changes since commit 8a0d8eee432924433c3e70198aaeab3161476c5f:

  toaster manual: Updated the set up and use chapter (2015-10-27 07:28:22 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib ed/toaster/8279-v3
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/8279-v3

Ed Bartosh (24):
  toaster: don't allow to run toaster as a script
  toaster: implement get-dburl command
  toaster: set DATABASE_URL in toaster script
  toaster: run bitbake the same way
  toaster: remove unused variable
  toaster: check for toaster configuration later
  toaster: use parent of the build dir
  toaster: make runbuilds to loop
  toaster: start 'manage.py runbuilds' in the script
  toaster: update brbe and project attributes
  toaster: implement stop_bitbake function
  toaster: implement start_bitbake function
  toaster: implement 'toaster restart-bitbake'
  toaster: remove _setupBE function
  toaster: reimplemented startBBServer method
  toaster: remove stopBBServer API
  toaster: do not terminate bb server
  toaster: remove usage of BUILD_MODE variable
  toaster: do not create duplicate HelpText objects
  toaster: implement BitbakeController.getVariable
  toaster: set varibales on bitbake server
  toaster: remove writeConfFile API
  toaster: stop using toaster-pre.conf
  toaster: remove SDKMACHINE from project variables

Michael Wood (1):
  toaster: buildinfohelper Broaden the toaster created recipe data case

 bitbake/bin/toaster                                | 186 +++++++--------------
 bitbake/lib/bb/ui/buildinfohelper.py               |  23 +--
 bitbake/lib/bb/ui/toasterui.py                     |  15 +-
 bitbake/lib/toaster/bldcontrol/bbcontroller.py     |  15 +-
 .../toaster/bldcontrol/localhostbecontroller.py    | 132 ++++-----------
 .../bldcontrol/management/commands/runbuilds.py    |  13 +-
 bitbake/lib/toaster/bldcontrol/sshbecontroller.py  |  10 --
 bitbake/lib/toaster/bldcontrol/tests.py            |   4 -
 bitbake/lib/toaster/toastergui/templates/base.html |  13 +-
 .../lib/toaster/toastergui/templates/landing.html  |  10 --
 .../toaster/toastergui/templates/projectconf.html  |  70 +-------
 bitbake/lib/toaster/toastergui/tests.py            |   4 -
 bitbake/lib/toaster/toastergui/views.py            |  29 ----
 .../toastermain/management/commands/get-dburl.py   |   9 +
 bitbake/lib/toaster/toastermain/settings.py        |   3 -
 bitbake/lib/toaster/toastermain/urls.py            |   9 +-
 16 files changed, 142 insertions(+), 403 deletions(-)
 create mode 100644 bitbake/lib/toaster/toastermain/management/commands/get-dburl.py

--
Ed



^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 01/25] toaster: don't allow to run toaster as a script
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
@ 2015-10-27 17:27 ` Ed Bartosh
  2015-10-27 17:27 ` [PATCH 02/25] toaster: implement get-dburl command Ed Bartosh
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:27 UTC (permalink / raw)
  To: toaster

Removed support of starting toaster as a script.

Sourcing a toaster script becomes the only way to start it.
It's consistent with the way oe build system is started by sourcing
oe-init-build-env. It also returns user back to shell, so user can
continue running builds without having to open new terminal window.

[YOCTO #8279]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 82 ++++-------------------------------------------------
 1 file changed, 6 insertions(+), 76 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 2c3432c..d59a8c8 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/echo ERROR: This script needs to be sourced. Please run as .
 # (c) 2013 Intel Corp.
 
 # This program is free software; you can redistribute it and/or modify
@@ -81,9 +81,7 @@ webserverStartAll()
         return $retval
     fi
 
-    if [ "$TOASTER_MANAGED" = '1' ]; then
-        python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1
-    fi
+    python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1
 
     if [ $retval -eq 1 ]; then
         printf "\nError while checking settings; aborting\n"
@@ -176,8 +174,6 @@ else
     TOASTER=$0
 fi
 
-[ `basename \"$0\"` = `basename \"${TOASTER}\"` ] && TOASTER_MANAGED=1
-
 BBBASEDIR=`dirname $TOASTER`/..
 
 RUNNING=0
@@ -201,7 +197,7 @@ if [ "$TOASTER_CONF" = "" ]; then
 fi
 if [ ! -f $TOASTER_CONF ]; then
     echo "$TOASTER_CONF configuration file not found. set TOASTER_CONF to specify a path"
-    [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
+    return 1
 fi
 # this defines the dir toaster will use for
 # 1) clones of layers (in _toaster_clones )
@@ -234,88 +230,22 @@ for param in $*; do
     esac
 done
 
-if [ "$TOASTER_MANAGED" = '1' ]; then
-    # We are called as standalone. We refuse to run in a build environment - we need the interactive mode for that.
-    # Start just the web server, point the web browser to the interface, and start any Django services.
-
-    if ! verify_prereq; then
-        echo "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2
-        exit 1
-    fi
-
-    if [ -n "$BUILDDIR" ]; then
-        printf "Error: It looks like you sourced oe-init-build-env. Toaster cannot start in build mode from an oe-core build environment.\n You should be starting Toaster from a new terminal window.\n" 1>&2
-        exit 1
-    fi
-
-    # Define a fake builddir where only the pid files are actually created. No real builds will take place here.
-    BUILDDIR=/tmp/toaster_$$
-    if [ -d "$BUILDDIR" ]; then
-        echo "Previous toaster run directory $BUILDDIR found, cowardly refusing to start. Please remove the directory when that toaster instance is over" 2>&1
-        exit 1
-    fi
-
-    mkdir -p "$BUILDDIR"
-
-    RUNNING=1
-    trap_ctrlc() {
-        echo "** Stopping system"
-        webserverKillAll
-        RUNNING=0
-    }
-
-    do_cleanup() {
-        find "$BUILDDIR" -type f | xargs rm
-        rmdir "$BUILDDIR"
-    }
-    cleanup() {
-        if grep -ir error "$BUILDDIR" >/dev/null; then
-            if grep -irn "That port is already in use" "$BUILDDIR"; then
-                echo "You can use the \"webport=PORTNUMBER\" parameter to start Toaster on a different port (port $WEB_PORT is already in use)"
-                do_cleanup
-            else
-                printf "\nErrors found in the Toaster log files present in '$BUILDDIR'. Directory will not be cleaned.\n Please review the errors and notify toaster@yoctoproject.org or submit a bug https://bugzilla.yoctoproject.org/enter_bug.cgi?product=Toaster"
-            fi
-        else
-            echo "No errors found, removing the run directory '$BUILDDIR'"
-            do_cleanup
-        fi
-    }
-    export TOASTER_MANAGED=1
-    if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
-        echo "Failed to start the web server, stopping" 1>&2
-        cleanup
-        exit 1
-    fi
-    if [ $WEBSERVER -gt 0 ] && [ $NOBROWSER -eq 0 ]  ; then
-        echo "Starting browser..."
-        xdg-open http://127.0.0.1:$WEB_PORT/ >/dev/null 2>&1 &
-    fi
-    trap trap_ctrlc 2
-    echo "Toaster is now running. You can stop it with Ctrl-C"
-    while [ $RUNNING -gt 0 ]; do
-        python $BBBASEDIR/lib/toaster/manage.py runbuilds 2>&1 | tee -a "$BUILDDIR/toaster.log"
-        sleep 1
-    done
-    cleanup
-    echo "**** Exit"
-    exit 0
+if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then
+    echo "Error: This script needs to be sourced. Please run as . $TOASTER"
+    exit 1
 fi
 
-
 if ! verify_prereq; then
     echo "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2
     return 1
 fi
 
-
 # We make sure we're running in the current shell and in a good environment
 if [ -z "$BUILDDIR" ] ||  ! which bitbake >/dev/null 2>&1 ; then
     echo "Error: Build environment is not setup or bitbake is not in path." 1>&2
     return 2
 fi
 
-
 # Determine the action. If specified by arguments, fine, if not, toggle it
 if [ "$1" = 'start' ] || [ "$1" = 'stop' ]; then
     CMD="$1"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 02/25] toaster: implement get-dburl command
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
  2015-10-27 17:27 ` [PATCH 01/25] toaster: don't allow to run toaster as a script Ed Bartosh
@ 2015-10-27 17:27 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 03/25] toaster: set DATABASE_URL in toaster script Ed Bartosh
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:27 UTC (permalink / raw)
  To: toaster

Implemented management command to call getDATABASE_URL API.
It will be used to get database url from toaster shell script
by running 'manage.py get-dburl'

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/toastermain/management/commands/get-dburl.py | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 bitbake/lib/toaster/toastermain/management/commands/get-dburl.py

diff --git a/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py b/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
new file mode 100644
index 0000000..22b3eb7
--- /dev/null
+++ b/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
@@ -0,0 +1,9 @@
+from toastermain.settings import getDATABASE_URL
+from django.core.management.base import NoArgsCommand
+
+class Command(NoArgsCommand):
+    args    = ""
+    help    = "get database url"
+
+    def handle_noargs(self,**options):
+        print getDATABASE_URL()
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 03/25] toaster: set DATABASE_URL in toaster script
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
  2015-10-27 17:27 ` [PATCH 01/25] toaster: don't allow to run toaster as a script Ed Bartosh
  2015-10-27 17:27 ` [PATCH 02/25] toaster: implement get-dburl command Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 04/25] toaster: run bitbake the same way Ed Bartosh
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Set environment variable DATABASE_URL in bitbake/bit/toaster
Variable value is obtained by running 'manage.py get-dburl'

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index d59a8c8..5b24b8b 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -300,6 +300,7 @@ case $CMD in
             echo "Bitbake server start failed"
         else
             export BBSERVER=0.0.0.0:-1
+            export DATABASE_URL=`$BBBASEDIR/lib/toaster/manage.py get-dburl`
             if [ $NOTOASTERUI -eq 0 ]; then        # we start the TOASTERUI only if not inhibited
                 bitbake --observe-only -u toasterui >>${BUILDDIR}/toaster_ui.log 2>&1 & echo $! >${BUILDDIR}/.toasterui.pid
             fi
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 04/25] toaster: run bitbake the same way
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (2 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 03/25] toaster: set DATABASE_URL in toaster script Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 05/25] toaster: remove unused variable Ed Bartosh
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Run bitbake in toaster script the same way as it's run
by localbuildcontroller.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 5b24b8b..2b0c818 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -285,16 +285,13 @@ case $CMD in
     start )
         start_success=1
         addtoConfiguration toaster.conf "INHERIT+=\"toaster buildhistory\"" $TOASTER_BRBE
+        echo > ${BUILDDIR}/conf/toaster-pre.conf
         if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
             echo "Failed ${CMD}."
             return 4
         fi
         unset BBSERVER
-        PREREAD=""
-        if [ -e ${BUILDDIR}/conf/toaster-pre.conf ]; then
-            rm ${BUILDDIR}/conf/toaster-pre.conf
-        fi
-        bitbake $PREREAD --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
+        bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
         if [ $? -ne 0 ]; then
             start_success=0
             echo "Bitbake server start failed"
@@ -302,7 +299,8 @@ case $CMD in
             export BBSERVER=0.0.0.0:-1
             export DATABASE_URL=`$BBBASEDIR/lib/toaster/manage.py get-dburl`
             if [ $NOTOASTERUI -eq 0 ]; then        # we start the TOASTERUI only if not inhibited
-                bitbake --observe-only -u toasterui >>${BUILDDIR}/toaster_ui.log 2>&1 & echo $! >${BUILDDIR}/.toasterui.pid
+                bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc >>${BUILDDIR}/toaster_ui.log 2>&1 \
+                    & echo $! >${BUILDDIR}/.toasterui.pid
             fi
         fi
         if [ $start_success -eq 1 ]; then
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 05/25] toaster: remove unused variable
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (3 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 04/25] toaster: run bitbake the same way Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 06/25] toaster: check for toaster configuration later Ed Bartosh
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Removed variable RUNNING as it's not used anymore
in the toaster script.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 2b0c818..d0a6cb8 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -175,9 +175,6 @@ else
 fi
 
 BBBASEDIR=`dirname $TOASTER`/..
-
-RUNNING=0
-
 NOTOASTERUI=0
 WEBSERVER=1
 TOASTER_BRBE=""
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 06/25] toaster: check for toaster configuration later
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (4 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 05/25] toaster: remove unused variable Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 07/25] toaster: use parent of the build dir Ed Bartosh
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Moved check for toasterconf.json after check of build environment.
We'll need some variables from build environment to find toasterconf.json
better way.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index d0a6cb8..3963afd 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -181,30 +181,6 @@ TOASTER_BRBE=""
 if [ "$WEB_PORT" = "" ]; then
     WEB_PORT="8000"
 fi
-# this is the configuraton file we are using for toaster
-# note default is assuming yocto. Override this if you are
-# running in a pure OE environment and use the toasterconf.json
-# in meta/conf/toasterconf.json
-# note: for future there are a number of relative path assumptions
-# in the local layers that currently prevent using an arbitrary
-# toasterconf.json
-if [ "$TOASTER_CONF" = "" ]; then
-    TOASTER_CONF="$(dirname $TOASTER)/../../meta-yocto/conf/toasterconf.json"
-    export TOASTER_CONF=$(python -c "import os; print os.path.realpath('$TOASTER_CONF')")
-fi
-if [ ! -f $TOASTER_CONF ]; then
-    echo "$TOASTER_CONF configuration file not found. set TOASTER_CONF to specify a path"
-    return 1
-fi
-# this defines the dir toaster will use for
-# 1) clones of layers (in _toaster_clones )
-# 2) the build dir (in build)
-# 3) the sqlite db if that is being used.
-# 4) pid's we need to clean up on exit/shutdown
-# note: for future. in order to make this an arbitrary directory, we need to
-# make sure that the toaster.sqlite file doesn't default to `pwd` like it currently does.
-export TOASTER_DIR=`pwd`
-
 
 NOBROWSER=0
 
@@ -243,6 +219,30 @@ if [ -z "$BUILDDIR" ] ||  ! which bitbake >/dev/null 2>&1 ; then
     return 2
 fi
 
+# this is the configuraton file we are using for toaster
+# note default is assuming yocto. Override this if you are
+# running in a pure OE environment and use the toasterconf.json
+# in meta/conf/toasterconf.json
+# note: for future there are a number of relative path assumptions
+# in the local layers that currently prevent using an arbitrary
+# toasterconf.json
+if [ "$TOASTER_CONF" = "" ]; then
+    TOASTER_CONF="$(dirname $TOASTER)/../../meta-yocto/conf/toasterconf.json"
+    export TOASTER_CONF=$(python -c "import os; print os.path.realpath('$TOASTER_CONF')")
+fi
+if [ ! -f $TOASTER_CONF ]; then
+    echo "$TOASTER_CONF configuration file not found. set TOASTER_CONF to specify a path"
+    return 1
+fi
+# this defines the dir toaster will use for
+# 1) clones of layers (in _toaster_clones )
+# 2) the build dir (in build)
+# 3) the sqlite db if that is being used.
+# 4) pid's we need to clean up on exit/shutdown
+# note: for future. in order to make this an arbitrary directory, we need to
+# make sure that the toaster.sqlite file doesn't default to `pwd` like it currently does.
+export TOASTER_DIR=`pwd`
+
 # Determine the action. If specified by arguments, fine, if not, toggle it
 if [ "$1" = 'start' ] || [ "$1" = 'stop' ]; then
     CMD="$1"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 07/25] toaster: use parent of the build dir
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (5 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 06/25] toaster: check for toaster configuration later Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 08/25] toaster: make runbuilds to loop Ed Bartosh
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Assigned TOASTER_DIR to the parent of the build directory.
This should fix local controller crash as it assumes that
TOASTER_DIR is a root of local poky and tries to clone it.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 3963afd..dfa9bf2 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -241,7 +241,7 @@ fi
 # 4) pid's we need to clean up on exit/shutdown
 # note: for future. in order to make this an arbitrary directory, we need to
 # make sure that the toaster.sqlite file doesn't default to `pwd` like it currently does.
-export TOASTER_DIR=`pwd`
+export TOASTER_DIR=`dirname $BUILDDIR`
 
 # Determine the action. If specified by arguments, fine, if not, toggle it
 if [ "$1" = 'start' ] || [ "$1" = 'stop' ]; then
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 08/25] toaster: make runbuilds to loop
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (6 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 07/25] toaster: use parent of the build dir Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 09/25] toaster: start 'manage.py runbuilds' in the script Ed Bartosh
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Made runbuilds to loop to avoid having a loop in shell code and
initialize heavy Django init machinery every second.

Ignored exceptions to prevent exiting a loop.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 .../lib/toaster/bldcontrol/management/commands/runbuilds.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 5243a50..48dc618 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -5,6 +5,7 @@ from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdExcep
 from bldcontrol.models import BuildRequest, BuildEnvironment, BRError, BRVariable
 import os
 import logging
+import time
 
 logger = logging.getLogger("ToasterScheduler")
 
@@ -128,6 +129,12 @@ class Command(NoArgsCommand):
 
 
     def handle_noargs(self, **options):
-        self.cleanup()
-        self.archive()
-        self.schedule()
+        while True:
+            try:
+                self.cleanup()
+                self.archive()
+                self.schedule()
+            except:
+                pass
+
+            time.sleep(1)
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 09/25] toaster: start 'manage.py runbuilds' in the script
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (7 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 08/25] toaster: make runbuilds to loop Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 10/25] toaster: update brbe and project attributes Ed Bartosh
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Running runbuilds machinery in background allows Toaster to
start builds initiated by toaster UI.

Added runbuilds pid file to the list in webserverKillAll to
kill runbuilds the same way as runserver process.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index dfa9bf2..7117608 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -31,7 +31,7 @@
 webserverKillAll()
 {
     local pidfile
-    for pidfile in ${BUILDDIR}/.toastermain.pid; do
+    for pidfile in ${BUILDDIR}/.toastermain.pid ${BUILDDIR}/.runbuilds.pid; do
         if [ -f ${pidfile} ]; then
             pid=`cat ${pidfile}`
             while kill -0 $pid 2>/dev/null; do
@@ -299,6 +299,7 @@ case $CMD in
                 bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc >>${BUILDDIR}/toaster_ui.log 2>&1 \
                     & echo $! >${BUILDDIR}/.toasterui.pid
             fi
+            python $BBBASEDIR/lib/toaster/manage.py runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
         fi
         if [ $start_success -eq 1 ]; then
             # set fail safe stop system on terminal exit
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 10/25] toaster: update brbe and project attributes
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (8 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 09/25] toaster: start 'manage.py runbuilds' in the script Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 11/25] toaster: implement stop_bitbake function Ed Bartosh
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Updated attributes of buildinfohelper object as they can
be changed for every build. For example brbe is set by
runbuilds for every build triggered by Toaster UI.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 2fc1a43..04f4184 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -796,6 +796,8 @@ class BuildInfoHelper(object):
         build_info['cooker_log_path'] = consolelogfile
         build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
         build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
+        build_info['brbe'] = self.server.runCommand(["getVariable", "TOASTER_BRBE"])[0]
+        build_info['project'] = self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0]
 
         return build_info
 
@@ -938,6 +940,10 @@ class BuildInfoHelper(object):
         assert '_pkgs' in vars(event)
         build_information = self._get_build_information(consolelogfile)
 
+        # Update brbe and project as they can be changed for every build
+        self.brbe = build_information['brbe']
+        self.project = build_information['project']
+
         build_obj = self.orm_wrapper.create_build_object(build_information, self.brbe, self.project)
 
         self.internal_state['build'] = build_obj
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 11/25] toaster: implement stop_bitbake function
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (9 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 10/25] toaster: update brbe and project attributes Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 12/25] toaster: implement start_bitbake function Ed Bartosh
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Separated functionality of stopping bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 7117608..a532a97 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -126,16 +126,20 @@ stop_system()
         kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null
         rm ${BUILDDIR}/.toasterui.pid
     fi
-    BBSERVER=0.0.0.0:-1 bitbake -m
-    unset BBSERVER
+    stop_bitbake
     webserverKillAll
-    # force stop any misbehaving bitbake server
-    lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
     trap - SIGHUP
     #trap - SIGCHLD
     INSTOPSYSTEM=0
 }
 
+stop_bitbake() {
+    BBSERVER=0.0.0.0:-1 bitbake -m
+    unset BBSERVER
+    # force stop any misbehaving bitbake server
+    lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
+}
+
 check_pidbyfile() {
     [ -e $1 ] && kill -0 `cat $1` 2>/dev/null
 }
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 12/25] toaster: implement start_bitbake function
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (10 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 11/25] toaster: implement stop_bitbake function Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 13/25] toaster: implement 'toaster restart-bitbake' Ed Bartosh
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Separated functionality of starting bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index a532a97..b664559 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -133,6 +133,22 @@ stop_system()
     INSTOPSYSTEM=0
 }
 
+start_bitbake() {
+    unset BBSERVER
+    bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
+    if [ $? -ne 0 ]; then
+        echo "Bitbake server start failed"
+        return 1
+    fi
+    export BBSERVER=0.0.0.0:-1
+    export DATABASE_URL=`$BBBASEDIR/lib/toaster/manage.py get-dburl`
+    if [ $NOTOASTERUI -eq 0 ]; then        # we start the TOASTERUI only if not inhibited
+        bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc >>${BUILDDIR}/toaster_ui.log 2>&1 \
+            & echo $! >${BUILDDIR}/.toasterui.pid
+    fi
+    return 0
+}
+
 stop_bitbake() {
     BBSERVER=0.0.0.0:-1 bitbake -m
     unset BBSERVER
@@ -284,28 +300,15 @@ fi
 
 case $CMD in
     start )
-        start_success=1
         addtoConfiguration toaster.conf "INHERIT+=\"toaster buildhistory\"" $TOASTER_BRBE
         echo > ${BUILDDIR}/conf/toaster-pre.conf
         if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
             echo "Failed ${CMD}."
             return 4
         fi
-        unset BBSERVER
-        bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
-        if [ $? -ne 0 ]; then
-            start_success=0
-            echo "Bitbake server start failed"
-        else
-            export BBSERVER=0.0.0.0:-1
-            export DATABASE_URL=`$BBBASEDIR/lib/toaster/manage.py get-dburl`
-            if [ $NOTOASTERUI -eq 0 ]; then        # we start the TOASTERUI only if not inhibited
-                bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc >>${BUILDDIR}/toaster_ui.log 2>&1 \
-                    & echo $! >${BUILDDIR}/.toasterui.pid
-            fi
+        start_bitbake
+        if [ $? -eq 0 ]; then
             python $BBBASEDIR/lib/toaster/manage.py runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
-        fi
-        if [ $start_success -eq 1 ]; then
             # set fail safe stop system on terminal exit
             trap stop_system SIGHUP
             echo "Successful ${CMD}."
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 13/25] toaster: implement 'toaster restart-bitbake'
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (11 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 12/25] toaster: implement start_bitbake function Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 14/25] toaster: remove _setupBE function Ed Bartosh
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

This implementation allows to have functionality of restarting
bitbake in toaster script. It can be used by toaster script and
build controllers.

[YOCTO #8279]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index b664559..4c4cf0b 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -228,6 +228,15 @@ if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then
     exit 1
 fi
 
+if [ "$1" = 'restart-bitbake' ] ; then
+    stop_bitbake
+    sleep 1
+    start_bitbake
+    rc=$?
+    sleep 1
+    return $rc
+fi
+
 if ! verify_prereq; then
     echo "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2
     return 1
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 14/25] toaster: remove _setupBE function
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (12 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 13/25] toaster: implement 'toaster restart-bitbake' Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 15/25] toaster: reimplemented startBBServer method Ed Bartosh
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

This function is not needed as build environment is always created
because of the new way to run Toaster. It can be only sourced after
oe-init-build-env is sourced.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 .../lib/toaster/bldcontrol/localhostbecontroller.py   | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index b5cf559..9a3c818 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -71,17 +71,6 @@ class LocalhostBEController(BuildEnvironmentController):
             logger.debug("localhostbecontroller: shellcmd success")
             return out
 
-    def _setupBE(self):
-        assert self.pokydirname and os.path.exists(self.pokydirname)
-        path = self.be.builddir
-        if not path:
-            raise Exception("Invalid path creation specified.")
-        if not os.path.exists(path):
-            os.makedirs(path, 0755)
-        self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, path))
-        # delete the templateconf.cfg; it may come from an unsupported layer configuration
-        os.remove(os.path.join(path, "conf/templateconf.cfg"))
-
 
     def writeConfFile(self, file_name, variable_list = None, raw = None):
         filepath = os.path.join(self.be.builddir, file_name)
@@ -290,16 +279,12 @@ class LocalhostBEController(BuildEnvironmentController):
 
         logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
 
-        # 4. configure the build environment, so we have a conf/bblayers.conf
-        assert self.pokydirname is not None
-        self._setupBE()
-
-        # 5. update the bblayers.conf
+        # 4. update the bblayers.conf
         bblayerconf = os.path.join(self.be.builddir, "conf/bblayers.conf")
         if not os.path.exists(bblayerconf):
             raise BuildSetupException("BE is not consistent: bblayers.conf file missing at %s" % bblayerconf)
 
-        # 6. create custom layer and add custom recipes to it
+        # 5. create custom layer and add custom recipes to it
         layerpath = os.path.join(self.be.sourcedir, "_meta-toaster-custom")
         if os.path.isdir(layerpath):
             shutil.rmtree(layerpath) # remove leftovers from previous builds
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 15/25] toaster: reimplemented startBBServer method
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (13 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 14/25] toaster: remove _setupBE function Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 16/25] toaster: remove stopBBServer API Ed Bartosh
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Rewritten LocalhostBEController.startBBServer to use
'toaster restart-bitbake' and read bitbake port number from
bitbake.lock.

Removed complicated logic of running oe-init-memres and looking for
bitbake port number in the logs.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 .../toaster/bldcontrol/localhostbecontroller.py    | 82 +++++-----------------
 1 file changed, 18 insertions(+), 64 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 9a3c818..f321537 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -89,74 +89,28 @@ class LocalhostBEController(BuildEnvironmentController):
         # find our own toasterui listener/bitbake
         from toaster.bldcontrol.management.commands.loadconf import _reduce_canon_path
 
-        own_bitbake = _reduce_canon_path(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../bin/bitbake"))
-
-        assert os.path.exists(own_bitbake) and os.path.isfile(own_bitbake)
-
-        logger.debug("localhostbecontroller: running the listener at %s" % own_bitbake)
-
-        toaster_ui_log_filepath = os.path.join(self.be.builddir, "toaster_ui.log")
-        # get the file length; we need to detect the _last_ start of the toaster UI, not the first
-        toaster_ui_log_filelength = 0
-        if os.path.exists(toaster_ui_log_filepath):
-            with open(toaster_ui_log_filepath, "w") as f:
-                f.seek(0, 2)    # jump to the end
-                toaster_ui_log_filelength = f.tell()
-
-        cmd = "bash -c \"source %s/oe-init-build-env %s 2>&1 >toaster_server.log && bitbake --read %s/conf/toaster-pre.conf --postread %s/conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 2>&1 >>toaster_server.log \"" % (self.pokydirname, self.be.builddir, self.be.builddir, self.be.builddir)
-
-        port = "-1"
-        logger.debug("localhostbecontroller: starting builder \n%s\n" % cmd)
-
-        cmdoutput = self._shellcmd(cmd)
-        with open(self.be.builddir + "/toaster_server.log", "r") as f:
-            for i in f.readlines():
-                if i.startswith("Bitbake server address"):
-                    port = i.split(" ")[-1]
-                    logger.debug("localhostbecontroller: Found bitbake server port %s" % port)
-
-        cmd = "bash -c \"source %s/oe-init-build-env-memres -1 %s && DATABASE_URL=%s %s --observe-only -u toasterui --remote-server=0.0.0.0:-1 -t xmlrpc\"" % (self.pokydirname, self.be.builddir, self.dburl, own_bitbake)
-        with open(toaster_ui_log_filepath, "a+") as f:
-            p = subprocess.Popen(cmd, cwd = self.be.builddir, shell=True, stdout=f, stderr=f)
-
-        def _toaster_ui_started(filepath, filepos = 0):
-            if not os.path.exists(filepath):
-                return False
-            with open(filepath, "r") as f:
-                f.seek(filepos)
-                for line in f:
-                    if line.startswith("NOTE: ToasterUI waiting for events"):
-                        return True
-            return False
-
-        retries = 0
-        started = False
-        while not started and retries < 50:
-            started = _toaster_ui_started(toaster_ui_log_filepath, toaster_ui_log_filelength)
-            import time
-            logger.debug("localhostbecontroller: Waiting bitbake server to start")
-            time.sleep(0.5)
-            retries += 1
-
-        if not started:
-            toaster_ui_log = open(os.path.join(self.be.builddir, "toaster_ui.log"), "r").read()
-            toaster_server_log = open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read()
-            raise BuildSetupException("localhostbecontroller: Bitbake server did not start in 25 seconds, aborting (Error: '%s' '%s')" % (toaster_ui_log, toaster_server_log))
-
-        logger.debug("localhostbecontroller: Started bitbake server")
-
-        while port == "-1":
-            # the port specification is "autodetect"; read the bitbake.lock file
-            with open("%s/bitbake.lock" % self.be.builddir, "r") as f:
-                for line in f.readlines():
+        toaster = _reduce_canon_path(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../bin/toaster"))
+        assert os.path.exists(toaster) and os.path.isfile(toaster)
+
+        # restart bitbake server and toastergui observer
+        self._shellcmd("bash -c 'source %s restart-bitbake'" % toaster, self.be.builddir)
+        logger.debug("localhostbecontroller: restarted bitbake server")
+
+        # read port number from bitbake.lock
+        self.be.bbport = ""
+        bblock = os.path.join(self.be.builddir, 'bitbake.lock')
+        if os.path.exists(bblock):
+            with open(bblock) as fplock:
+                for line in fplock:
                     if ":" in line:
-                        port = line.split(":")[1].strip()
-                        logger.debug("localhostbecontroller: Autodetected bitbake port %s", port)
+                        self.be.bbport = line.split(":")[-1].strip()
+                        logger.debug("localhostbecontroller: bitbake port %s", self.be.bbport)
                         break
 
-        assert self.be.sourcedir and os.path.exists(self.be.builddir)
+        if not self.be.bbport:
+            raise BuildSetupException("localhostbecontroller: can't read bitbake port from %s" % bblock)
+
         self.be.bbaddress = "localhost"
-        self.be.bbport = port
         self.be.bbstate = BuildEnvironment.SERVER_STARTED
         self.be.save()
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 16/25] toaster: remove stopBBServer API
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (14 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 15/25] toaster: reimplemented startBBServer method Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 17/25] toaster: do not terminate bb server Ed Bartosh
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Removed stopBBServer API from build controller as toaster
doesn't stop bitbake server anymore. It's reused for both
types of builds: triggered by UI and started manually.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/bldcontrol/bbcontroller.py          |  6 ------
 bitbake/lib/toaster/bldcontrol/localhostbecontroller.py |  9 ---------
 bitbake/lib/toaster/bldcontrol/sshbecontroller.py       | 10 ----------
 bitbake/lib/toaster/bldcontrol/tests.py                 |  4 ----
 4 files changed, 29 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index ad70ac8..3d98ad7 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -140,12 +140,6 @@ class BuildEnvironmentController(object):
         """
         raise Exception("FIXME: Must override in order to actually start the BB server")
 
-    def stopBBServer(self):
-        """ Stops the currently running BB server.
-            The bbstate MUST be updated to "stopped".
-            self.connection must be none.
-        """
-        raise Exception("FIXME: Must override stoBBServer")
 
     def setLayers(self, bbs, ls):
         """ Checks-out bitbake executor and layers from git repositories.
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index f321537..9ab741f 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -114,15 +114,6 @@ class LocalhostBEController(BuildEnvironmentController):
         self.be.bbstate = BuildEnvironment.SERVER_STARTED
         self.be.save()
 
-    def stopBBServer(self):
-        assert self.pokydirname and os.path.exists(self.pokydirname)
-        assert self.islayerset
-        self._shellcmd("bash -c \"source %s/oe-init-build-env %s && %s source toaster stop\"" %
-            (self.pokydirname, self.be.builddir, (lambda: "" if self.be.bbtoken is None else "BBTOKEN=%s" % self.be.bbtoken)()))
-        self.be.bbstate = BuildEnvironment.SERVER_STOPPED
-        self.be.save()
-        logger.debug("localhostbecontroller: Stopped bitbake server")
-
     def getGitCloneDirectory(self, url, branch):
         """Construct unique clone directory name out of url and branch."""
         if branch != "HEAD":
diff --git a/bitbake/lib/toaster/bldcontrol/sshbecontroller.py b/bitbake/lib/toaster/bldcontrol/sshbecontroller.py
index 8ef434b..17dd66c 100644
--- a/bitbake/lib/toaster/bldcontrol/sshbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/sshbecontroller.py
@@ -98,16 +98,6 @@ class SSHBEController(BuildEnvironmentController):
         self.be.bbstate = BuildEnvironment.SERVER_STARTED
         self.be.save()
 
-    def stopBBServer(self):
-        assert self.pokydirname and self._pathexists(self.pokydirname)
-        assert self.islayerset
-        print self._shellcmd("bash -c \"source %s/oe-init-build-env %s && %s source toaster stop\"" %
-            (self.pokydirname, self.be.builddir, (lambda: "" if self.be.bbtoken is None else "BBTOKEN=%s" % self.be.bbtoken)()))
-        self.be.bbstate = BuildEnvironment.SERVER_STOPPED
-        self.be.save()
-        print "Stopped server"
-
-
     def _copyFile(self, filepath1, filepath2):
         p = subprocess.Popen("scp '%s' '%s'" % (filepath1, filepath2), stdout=subprocess.PIPE, stderr = subprocess.PIPE, shell=True)
         (out, err) = p.communicate()
diff --git a/bitbake/lib/toaster/bldcontrol/tests.py b/bitbake/lib/toaster/bldcontrol/tests.py
index 5dbc77f..f54cf7f 100644
--- a/bitbake/lib/toaster/bldcontrol/tests.py
+++ b/bitbake/lib/toaster/bldcontrol/tests.py
@@ -71,9 +71,6 @@ class BEControllerTests(object):
 
         self.assertFalse(socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex((hostname, int(bc.be.bbport))), "Server not answering")
 
-        bc.stopBBServer()
-        self.assertTrue(socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex((hostname, int(bc.be.bbport))), "Server not stopped")
-
         self._serverForceStop(bc)
 
     def test_getBBController(self):
@@ -96,7 +93,6 @@ class BEControllerTests(object):
 
         bbc = bc.getBBController()
         self.assertTrue(isinstance(bbc, BitbakeController))
-        bc.stopBBServer()
 
         self._serverForceStop(bc)
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 17/25] toaster: do not terminate bb server
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (15 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 16/25] toaster: remove stopBBServer API Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 18/25] toaster: remove usage of BUILD_MODE variable Ed Bartosh
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Toaster needs bb server to be running all the time due
to merged analysis and managed modes. Server gets restarted
before every build triggered by UI, but it shouldn't be
terminated as it will influence command line builds.

[YOCTO #8279]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/bb/ui/toasterui.py | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index 0ed774e..4c1dce0 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -255,16 +255,11 @@ def main(server, eventHandler, params ):
                 logger.info("ToasterUI build done 1, brbe: %s", buildinfohelper.brbe )
 
                 # we start a new build info
-                if buildinfohelper.brbe is not None:
-
-                    logger.debug("ToasterUI under BuildEnvironment management - exiting after the build")
-                    server.terminateServer()
-                else:
-                    logger.debug("ToasterUI prepared for new build")
-                    errors = 0
-                    warnings = 0
-                    taskfailures = []
-                    buildinfohelper = BuildInfoHelper(server, build_history_enabled)
+                logger.debug("ToasterUI prepared for new build")
+                errors = 0
+                warnings = 0
+                taskfailures = []
+                buildinfohelper = BuildInfoHelper(server, build_history_enabled)
 
                 logger.info("ToasterUI build done 2")
                 continue
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 18/25] toaster: remove usage of BUILD_MODE variable
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (16 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 17/25] toaster: do not terminate bb server Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 19/25] toaster: do not create duplicate HelpText objects Ed Bartosh
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

As both modes can be used at the same time we can't have any
difference in UI between modes.

Removed all conditional statements that used BUILD_MODE.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/toastergui/templates/base.html   | 13 +++++--------
 .../lib/toaster/toastergui/templates/landing.html    | 10 ----------
 bitbake/lib/toaster/toastergui/tests.py              |  4 ----
 bitbake/lib/toaster/toastergui/views.py              | 20 --------------------
 bitbake/lib/toaster/toastermain/settings.py          |  3 ---
 bitbake/lib/toaster/toastermain/urls.py              |  9 ++++-----
 6 files changed, 9 insertions(+), 50 deletions(-)

diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html
index dfa6bba..ac63167 100644
--- a/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/bitbake/lib/toaster/toastergui/templates/base.html
@@ -91,7 +91,7 @@
             <i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
             {% endif %}
           </span>
-          {% if BUILD_MODE and request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
+          {% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
           <ul class="nav">
             <li {% if request.resolver_match.url_name == 'all-builds' %}
                 class="active"
@@ -121,18 +121,15 @@
           </ul>
           <span class="pull-right divider-vertical"></span>
 
-          <!-- new project button; only show in build mode -->
-          {% if BUILD_MODE %}
-            <div class="btn-group pull-right">
-              <a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
-            </div>
-          {% endif %}
+          <div class="btn-group pull-right">
+            <a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
+          </div>
 
           <!--
           New build popover; only shown if there is at least one user-created project
           and we're in build mode
           -->
-          {% if BUILD_MODE and non_cli_projects.count > 0 %}
+          {% if non_cli_projects.count > 0 %}
             <div class="btn-group pull-right" id="new-build-button" style="display:none">
               <button class="btn dropdown-toggle" data-toggle="dropdown">
                 New build
diff --git a/bitbake/lib/toaster/toastergui/templates/landing.html b/bitbake/lib/toaster/toastergui/templates/landing.html
index 65d8c3c..f5dcbfc 100644
--- a/bitbake/lib/toaster/toastergui/templates/landing.html
+++ b/bitbake/lib/toaster/toastergui/templates/landing.html
@@ -5,9 +5,6 @@
 {% load humanize %}
 
 {% block pagecontent %}
-
-  {% if BUILD_MODE %}
-    <!-- build mode -->
     <div class="container-fluid">
       <div class="row-fluid">
         <div class="hero-unit span12 well-transparent">
@@ -61,11 +58,4 @@
         </div>
       </div>
     </div>
-  {% else %}
-    <!-- analysis mode -->
-    <div class="alert alert-info lead top-air">
-      Toaster has not recorded any builds yet. Run a build from the command line to see it here.
-    </div>
-  {% endif %}
-
 {% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py
index 9e6c46a..3685fd8 100644
--- a/bitbake/lib/toaster/toastergui/tests.py
+++ b/bitbake/lib/toaster/toastergui/tests.py
@@ -42,10 +42,6 @@ import re
 PROJECT_NAME = "test project"
 CLI_BUILDS_PROJECT_NAME = 'Command line builds'
 
-# by default, tests are run in build mode; to run in analysis mode,
-# set this to False in individual test cases
-toastermain.settings.BUILD_MODE = True
-
 class ViewTests(TestCase):
     """Tests to verify view APIs."""
 
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 6ebb6a9..3645c4e 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -76,10 +76,6 @@ def landing(request):
     default_project = Project.objects.get_default_project()
     default_project_builds = Build.objects.filter(project = default_project)
 
-    if (not toastermain.settings.BUILD_MODE) and default_project_builds.count() > 0:
-        args = (default_project.id,)
-        return redirect(reverse('projectbuilds', args = args), permanent = False)
-
     # we only redirect to projects page if there is a user-generated project
     num_builds = Build.objects.all().count()
     user_projects = Project.objects.filter(is_default = False)
@@ -102,9 +98,6 @@ def _get_latest_builds(prj=None):
     if prj is not None:
         queryset = queryset.filter(project = prj)
 
-    if not toastermain.settings.BUILD_MODE:
-        queryset = queryset.exclude(project__is_default=False)
-
     return list(itertools.chain(
         queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"),
         queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-started_on")[:3] ))
@@ -1893,10 +1886,6 @@ def managedcontextprocessor(request):
         "projects": projects,
         "non_cli_projects": projects.exclude(is_default=True),
         "DEBUG" : toastermain.settings.DEBUG,
-
-        # True if Toaster is in build mode, False otherwise
-        "BUILD_MODE": toastermain.settings.BUILD_MODE,
-
         "CUSTOM_IMAGE" : toastermain.settings.CUSTOM_IMAGE,
         "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH,
         "TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION,
@@ -1939,11 +1928,6 @@ if True:
 
         queryset = Build.objects.all()
 
-        # if in analysis mode, exclude builds for all projects except
-        # command line builds
-        if not toastermain.settings.BUILD_MODE:
-            queryset = queryset.exclude(project__is_default=False)
-
         redirect_page = resolve(request.path_info).url_name
 
         context, pagesize, orderby = _build_list_helper(request,
@@ -3048,10 +3032,6 @@ if True:
         queryset_all = queryset_all.filter(Q(is_default=False) |
                                            q_default_with_builds)
 
-        # if in BUILD_MODE, exclude everything but the command line builds project
-        if not toastermain.settings.BUILD_MODE:
-            queryset_all = queryset_all.exclude(is_default=False)
-
         # boilerplate code that takes a request for an object type and returns a queryset
         # for that object type. copypasta for all needed table searches
         (filter_string, search_term, ordering_string) = _search_tuple(request, Project)
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
index b28ddb2..de686b2 100644
--- a/bitbake/lib/toaster/toastermain/settings.py
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -92,9 +92,6 @@ if 'DATABASE_URL' in os.environ:
     else:
         raise Exception("FIXME: Please implement missing database url schema for url: %s" % dburl)
 
-BUILD_MODE = False
-if 'TOASTER_MANAGED' in os.environ and os.environ['TOASTER_MANAGED'] == "1":
-    BUILD_MODE = True
 
 # Allows current database settings to be exported as a DATABASE_URL environment variable value
 
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py
index 6c4a953..5ce5a92 100644
--- a/bitbake/lib/toaster/toastermain/urls.py
+++ b/bitbake/lib/toaster/toastermain/urls.py
@@ -59,12 +59,11 @@ if toastermain.settings.DEBUG_PANEL_ENABLED:
     urlpatterns.insert(1, url(r'', include(debug_toolbar.urls)))
     #logger.info("Enabled django_toolbar extension")
 
+urlpatterns = [
+    # Uncomment the next line to enable the admin:
+    url(r'^admin/', include(admin.site.urls)),
+] + urlpatterns
 
-if toastermain.settings.BUILD_MODE:
-    urlpatterns = [
-        # Uncomment the next line to enable the admin:
-        url(r'^admin/', include(admin.site.urls)),
-    ] + urlpatterns
 # Automatically discover urls.py in various apps, beside our own
 # and map module directories to the patterns
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 19/25] toaster: do not create duplicate HelpText objects
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (17 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 18/25] toaster: remove usage of BUILD_MODE variable Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 20/25] toaster: buildinfohelper Broaden the toaster created recipe data case Ed Bartosh
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

buildinfohelper code expects only one HelpText object per
build/variable/description.
Current code creates more than one such an object, which causes
toastergui to crash with this exception:
 MultipleObjectsReturned: get() returned more than one HelpText -- it returned 2!

Used git_or_create API to ensure that only one HelpText object is
created.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 04f4184..2803d03 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -700,7 +700,6 @@ class ORMWrapper(object):
     def save_build_variables(self, build_obj, vardump):
         assert isinstance(build_obj, Build)
 
-        helptext_objects = []
         for k in vardump:
             desc = vardump[k]['doc']
             if desc is None:
@@ -711,10 +710,9 @@ class ORMWrapper(object):
             if desc is None:
                 desc = ''
             if len(desc):
-                helptext_objects.append(HelpText(build=build_obj,
-                    area=HelpText.VARIABLE,
-                    key=k,
-                    text=desc))
+                HelpText.objects.get_or_create(build=build_obj,
+                                               area=HelpText.VARIABLE,
+                                               key=k, text=desc)
             if not bool(vardump[k]['func']):
                 value = vardump[k]['v']
                 if value is None:
@@ -734,8 +732,6 @@ class ORMWrapper(object):
                 if len(varhist_objects):
                     VariableHistory.objects.bulk_create(varhist_objects)
 
-        HelpText.objects.bulk_create(helptext_objects)
-
 
 class MockEvent(object):
     """ This object is used to create event, for which normal event-processing methods can
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 20/25] toaster: buildinfohelper Broaden the toaster created recipe data case
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (18 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 19/25] toaster: do not create duplicate HelpText objects Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 21/25] toaster: implement BitbakeController.getVariable Ed Bartosh
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

From: Michael Wood <michael.g.wood@intel.com>

When build information is the 'original' source of the information we
need to return the recipe that was created rather than the copy of the
recipe that is taken for keeping build history. We do this already for
command line triggered builds, but we also have this case for custom
images. We can simply check if the built_recipe exists instead of
special casing this.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 2803d03..39c5819 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -304,12 +304,11 @@ class ORMWrapper(object):
                 break
 
 
-        # If we're in analysis mode then we are wholly responsible for the data
+        # If we're in analysis mode or if this is a custom recipe
+        # then we are wholly responsible for the data
         # and therefore we return the 'real' recipe rather than the build
         # history copy of the recipe.
-        if  recipe_information['layer_version'].build is not None and \
-            recipe_information['layer_version'].build.project == \
-                Project.objects.get_default_project():
+        if built_recipe is None:
             return recipe
 
         return built_recipe
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 21/25] toaster: implement BitbakeController.getVariable
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (19 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 20/25] toaster: buildinfohelper Broaden the toaster created recipe data case Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 22/25] toaster: set varibales on bitbake server Ed Bartosh
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Added new API to get value of bitbake variable from bitbake server.
The API will be used to update INHERIT variable instead of writing
it to the toaster configuration files.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/bldcontrol/bbcontroller.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index 3d98ad7..ba00931 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -52,6 +52,9 @@ class BitbakeController(object):
     def setVariable(self, name, value):
         return self._runCommand(["setVariable", name, value])
 
+    def getVariable(self, name):
+        return self._runCommand(["getVariable", name])
+
     def build(self, targets, task = None):
         if task is None:
             task = "build"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 22/25] toaster: set varibales on bitbake server
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (20 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 21/25] toaster: implement BitbakeController.getVariable Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 23/25] toaster: remove writeConfFile API Ed Bartosh
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Set project variables using connection to bitbake server
instead of writing them to toaster configuration files.

This is a way to avoid rewriting configuration files before
and after every build, triggered by toaster UI.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 9ab741f..b16a1a7 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -292,12 +292,19 @@ class LocalhostBEController(BuildEnvironmentController):
     def triggerBuild(self, bitbake, layers, variables, targets):
         # set up the buid environment with the needed layers
         self.setLayers(bitbake, layers, targets)
-        self.writeConfFile("conf/toaster-pre.conf", variables)
-        self.writeConfFile("conf/toaster.conf", raw = "INHERIT+=\"toaster buildhistory\"")
 
         # get the bb server running with the build req id and build env id
         bbctrl = self.getBBController()
 
+        # set variables
+        for var in variables:
+            bbctrl.setVariable(var.name, var.value)
+
+        # Add 'toaster' and 'buildhistory' to INHERIT variable
+        inherit = {item.strip() for item in bbctrl.getVariable('INHERIT').split()}
+        inherit = inherit.union(["toaster", "buildhistory"])
+        bbctrl.setVariable('INHERIT', ' '.join(inherit))
+
         # trigger the build command
         task = reduce(lambda x, y: x if len(y)== 0 else y, map(lambda y: y.task, targets))
         if len(task) == 0:
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 23/25] toaster: remove writeConfFile API
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (21 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 22/25] toaster: set varibales on bitbake server Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 24/25] toaster: stop using toaster-pre.conf Ed Bartosh
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

This API is not used anymore as toaster doesn't write variables
to configuration files anymore. It sets variables through its
connection to bitbake server.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/bldcontrol/bbcontroller.py          |  6 ------
 bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 11 -----------
 2 files changed, 17 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index ba00931..8b99318 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -130,12 +130,6 @@ class BuildEnvironmentController(object):
         bblayerconffile.write("# line added by toaster build control\nBBLAYERS = \"" + " ".join(layerlist) + "\"")
         bblayerconffile.close()
 
-
-    def writeConfFile(self, variable_list = None, raw = None):
-        """ Writes a configuration file in the build directory. Override with buildenv-specific implementation. """
-        raise Exception("FIXME: Must override to actually write a configuration file")
-
-
     def startBBServer(self):
         """ Starts a  BB server with Toaster toasterui set up to record the builds, an no controlling UI.
             After this method executes, self.be bbaddress/bbport MUST point to a running and free server,
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index b16a1a7..9210062 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -71,17 +71,6 @@ class LocalhostBEController(BuildEnvironmentController):
             logger.debug("localhostbecontroller: shellcmd success")
             return out
 
-
-    def writeConfFile(self, file_name, variable_list = None, raw = None):
-        filepath = os.path.join(self.be.builddir, file_name)
-        with open(filepath, "w") as conffile:
-            if variable_list is not None:
-                for i in variable_list:
-                    conffile.write("%s=\"%s\"\n" % (i.name, i.value))
-            if raw is not None:
-                conffile.write(raw)
-
-
     def startBBServer(self):
         assert self.pokydirname and os.path.exists(self.pokydirname)
         assert self.islayerset
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 24/25] toaster: stop using toaster-pre.conf
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (22 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 23/25] toaster: remove writeConfFile API Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-10-27 17:28 ` [PATCH 25/25] toaster: remove SDKMACHINE from project variables Ed Bartosh
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

This file is not needed anymore as toaster UI doesn't
write variables to it. It sets them directly on bitbake
server.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 4c4cf0b..b533fcc 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -135,7 +135,7 @@ stop_system()
 
 start_bitbake() {
     unset BBSERVER
-    bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
+    bitbake --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
     if [ $? -ne 0 ]; then
         echo "Bitbake server start failed"
         return 1
@@ -310,7 +310,6 @@ fi
 case $CMD in
     start )
         addtoConfiguration toaster.conf "INHERIT+=\"toaster buildhistory\"" $TOASTER_BRBE
-        echo > ${BUILDDIR}/conf/toaster-pre.conf
         if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
             echo "Failed ${CMD}."
             return 4
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 25/25] toaster: remove SDKMACHINE from project variables
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (23 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 24/25] toaster: stop using toaster-pre.conf Ed Bartosh
@ 2015-10-27 17:28 ` Ed Bartosh
  2015-11-03 10:53 ` [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Barros Pena, Belen
  2015-11-09 16:23 ` Smith, Elliot
  26 siblings, 0 replies; 30+ messages in thread
From: Ed Bartosh @ 2015-10-27 17:28 UTC (permalink / raw)
  To: toaster

Removed SDKMACHINE from predefined set of variables
for the project as it causes bitbake build error:
   SDKMACHINE is set, but SDK_ARCH has not been changed as a result

This variable does not need to be predefined as it's not used by
toaster.

It's still possible to specify it in project configuration
if needed. SDK_ARCH variable should be set too to avoid above
mentioned build failure.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 .../toaster/toastergui/templates/projectconf.html  | 70 +---------------------
 bitbake/lib/toaster/toastergui/views.py            |  9 ---
 2 files changed, 1 insertion(+), 78 deletions(-)

diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html
index 5333ec5..6c1ec01 100644
--- a/bitbake/lib/toaster/toastergui/templates/projectconf.html
+++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html
@@ -107,32 +107,6 @@
                 </form>
             </dd>
             {% endif %}
-
-            {% if sdk_machine_defined %}
-            <dt>
-                <span class="js-config-var-name js-config-var-managed-name">SDKMACHINE</span>
-                <i class="icon-question-sign get-help" title="Specifies the architecture (i.e. i686 or x86_64) for which to build SDK and ADT items <br /><a href='http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-SDKMACHINE' target='_blank'>Read more in the manual</a>"></i>
-            </dt>
-            <dd class="lead">
-                <span id="sdkmachine">{{sdk_machine}}</span>
-                <i id="change-sdkmachine-icon" class="icon-pencil"></i>
-                <form id="change-sdkmachine-form" style="display:none;">
-                    <label class="radio">
-                        <input type="radio" name="sdkmachine" value="i686">
-                        i686
-                    </label>
-                    <label class="radio">
-                        <input type="radio" name="sdkmachine" value="x86_64">
-                        x86_64
-                    </label>
-                    <div style="padding-top:10px;">
-                        <button id="apply-change-sdkmachine" type="button" class="btn">Save</button>
-                        <button id="cancel-change-sdkmachine" type="button" class="btn btn-link">Cancel</button>
-                    </div>
-                </form>
-            </dd>
-            {% endif %}
-
         </dl>
 
         <!-- <ul class="unstyled configuration-list" id="configvar-list"> -->
@@ -774,48 +748,6 @@
             });
             {% endif %}
 
-
-            {% if sdk_machine_defined %}
-            // change SDKMACHINE variable
-            $('#change-sdkmachine-icon').click(function() {
-                var current_value = document.getElementById("sdkmachine").innerHTML;
-                var radios = document.getElementsByName('sdkmachine');
-                for (var i = 0, length = radios.length; i < length; i++) {
-                    radios[i].checked = false;
-                    if (radios[i].value == current_value) {
-                        radios[i].checked = true;
-                    }
-                }
-                $('#change-sdkmachine-icon, #sdkmachine').hide();
-                $("#change-sdkmachine-form").slideDown();
-            });
-
-            $('#cancel-change-sdkmachine').click(function(){
-                $("#change-sdkmachine-form").slideUp(function() {
-                    $('#sdkmachine, #change-sdkmachine-icon').show();
-                });
-            });
-
-            $('#apply-change-sdkmachine').click(function(){
-                var value="";
-                var radios = document.getElementsByName('sdkmachine');
-                for (var i = 0, length = radios.length; i < length; i++) {
-                    if (radios[i].checked) {
-                        // do whatever you want with the checked radio
-                        value=radios[i].value;
-                        break;
-                    }
-                }
-                postEditAjaxRequest({"configvarChange" : 'SDKMACHINE:'+value});
-                $('#sdkmachine').text(value);
-                $("#change-sdkmachine-form").slideUp(function() {
-                    $('#sdkmachine, #change-sdkmachine-icon').show();
-                });
-
-            });
-            {% endif %}
-
-
             // add new variable
             $("button#add-configvar-button").click( function (evt) {
                 var variable = $("input#variable").val();
@@ -830,7 +762,7 @@
                 $(".save").attr("disabled","disabled");
 
                 // Reload page if admin-removed core managed value is manually added back in
-                if (0 <= " DISTRO IMAGE_FSTYPES IMAGE_INSTALL_append PACKAGE_CLASSES SDKMACHINE ".indexOf( " "+variable+" " )) {
+                if (0 <= " DISTRO IMAGE_FSTYPES IMAGE_INSTALL_append PACKAGE_CLASSES ".indexOf( " "+variable+" " )) {
                     // delayed reload to avoid race condition with postEditAjaxRequest
                     do_reload=true;
                 }
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 3645c4e..a048d63 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2456,10 +2456,6 @@ if True:
                 return_data['package_classes'] = ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value,
             except ProjectVariable.DoesNotExist:
                 pass
-            try:
-                return_data['sdk_machine'] = ProjectVariable.objects.get(project = prj, name = "SDKMACHINE").value,
-            except ProjectVariable.DoesNotExist:
-                pass
 
             return HttpResponse(json.dumps( return_data ), content_type = "application/json")
 
@@ -2868,11 +2864,6 @@ if True:
             context['package_classes_defined'] = "1"
         except ProjectVariable.DoesNotExist:
             pass
-        try:
-            context['sdk_machine'] =  ProjectVariable.objects.get(project = prj, name = "SDKMACHINE").value
-            context['sdk_machine_defined'] = "1"
-        except ProjectVariable.DoesNotExist:
-            pass
 
         return context
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (24 preceding siblings ...)
  2015-10-27 17:28 ` [PATCH 25/25] toaster: remove SDKMACHINE from project variables Ed Bartosh
@ 2015-11-03 10:53 ` Barros Pena, Belen
  2015-11-09 16:23 ` Smith, Elliot
  26 siblings, 0 replies; 30+ messages in thread
From: Barros Pena, Belen @ 2015-11-03 10:53 UTC (permalink / raw)
  To: Ed Bartosh, toaster



On 27/10/2015 17:27, "toaster-bounces@yoctoproject.org on behalf of Ed
Bartosh" <toaster-bounces@yoctoproject.org on behalf of
ed.bartosh@linux.intel.com> wrote:

>Hi,
>
>This patchset merges two Toaster modes in one:
>
>To run toaster you should source it in already prepared build environment:
>  cd poky
>  . oe-init-build-env
>  . ../bitbake/bin/toaster
>
>After that you should be able to trigger builds both ways:
>from command line and from toaster UI.
>
>The following changes since commit
>8a0d8eee432924433c3e70198aaeab3161476c5f:
>
>  toaster manual: Updated the set up and use chapter (2015-10-27 07:28:22
>+0000)
>
>are available in the git repository at:
>
>  git://git.yoctoproject.org/poky-contrib ed/toaster/8279-v3
>  
>http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/8279-v
>3

I ran a couple of builds with this, and encountered a couple of problems:

1. If you want to start a build from Toaster, you need to remove the
SDKMACHINE variable from the BitBake variables page in the project
configuration. Otherwise builds fail. We need to make sure we remove that
variable from the toasterconf.json files (as separate patches I guess).

2. For builds started from CLI, all data is collected. But for the build I
started from Toaster, the following data was missing:

* The recipes table is empty (http://i.imgur.com/sxqeqxp.png), but if you
navigate to a recipe from the package details page, the data is there
(http://i.imgur.com/FTcbwA2.png)

* The layer branch and commit are missing from packages tables and recipe
details pages (http://i.imgur.com/6agaG6L.png). But they show in the build
configuration page (http://i.imgur.com/Bt1XFxv.png)

Cheers

Belén

>
>Ed Bartosh (24):
>  toaster: don't allow to run toaster as a script
>  toaster: implement get-dburl command
>  toaster: set DATABASE_URL in toaster script
>  toaster: run bitbake the same way
>  toaster: remove unused variable
>  toaster: check for toaster configuration later
>  toaster: use parent of the build dir
>  toaster: make runbuilds to loop
>  toaster: start 'manage.py runbuilds' in the script
>  toaster: update brbe and project attributes
>  toaster: implement stop_bitbake function
>  toaster: implement start_bitbake function
>  toaster: implement 'toaster restart-bitbake'
>  toaster: remove _setupBE function
>  toaster: reimplemented startBBServer method
>  toaster: remove stopBBServer API
>  toaster: do not terminate bb server
>  toaster: remove usage of BUILD_MODE variable
>  toaster: do not create duplicate HelpText objects
>  toaster: implement BitbakeController.getVariable
>  toaster: set varibales on bitbake server
>  toaster: remove writeConfFile API
>  toaster: stop using toaster-pre.conf
>  toaster: remove SDKMACHINE from project variables
>
>Michael Wood (1):
>  toaster: buildinfohelper Broaden the toaster created recipe data case
>
> bitbake/bin/toaster                                | 186
>+++++++--------------
> bitbake/lib/bb/ui/buildinfohelper.py               |  23 +--
> bitbake/lib/bb/ui/toasterui.py                     |  15 +-
> bitbake/lib/toaster/bldcontrol/bbcontroller.py     |  15 +-
> .../toaster/bldcontrol/localhostbecontroller.py    | 132 ++++-----------
> .../bldcontrol/management/commands/runbuilds.py    |  13 +-
> bitbake/lib/toaster/bldcontrol/sshbecontroller.py  |  10 --
> bitbake/lib/toaster/bldcontrol/tests.py            |   4 -
> bitbake/lib/toaster/toastergui/templates/base.html |  13 +-
> .../lib/toaster/toastergui/templates/landing.html  |  10 --
> .../toaster/toastergui/templates/projectconf.html  |  70 +-------
> bitbake/lib/toaster/toastergui/tests.py            |   4 -
> bitbake/lib/toaster/toastergui/views.py            |  29 ----
> .../toastermain/management/commands/get-dburl.py   |   9 +
> bitbake/lib/toaster/toastermain/settings.py        |   3 -
> bitbake/lib/toaster/toastermain/urls.py            |   9 +-
> 16 files changed, 142 insertions(+), 403 deletions(-)
> create mode 100644
>bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
>
>--
>Ed
>
>-- 
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster
  2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
                   ` (25 preceding siblings ...)
  2015-11-03 10:53 ` [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Barros Pena, Belen
@ 2015-11-09 16:23 ` Smith, Elliot
  2015-11-09 16:30   ` Smith, Elliot
  26 siblings, 1 reply; 30+ messages in thread
From: Smith, Elliot @ 2015-11-09 16:23 UTC (permalink / raw)
  To: Ed Bartosh; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 3711 bytes --]

On 27 October 2015 at 17:27, Ed Bartosh <ed.bartosh@linux.intel.com> wrote:
>
> This patchset merges two Toaster modes in one:
>
> To run toaster you should source it in already prepared build environment:
>   cd poky
>   . oe-init-build-env
>   . ../bitbake/bin/toaster
>
> After that you should be able to trigger builds both ways:
> from command line and from toaster UI.
>

This works fine for me.

I'm able to run builds from the command line and from Toaster, and the data
about those builds appears to be complete.

I have also gone through the code, and can't see any glaring issues with it.

Elliot


>
> The following changes since commit
> 8a0d8eee432924433c3e70198aaeab3161476c5f:
>
>   toaster manual: Updated the set up and use chapter (2015-10-27 07:28:22
> +0000)
>
> are available in the git repository at:
>
>   git://git.yoctoproject.org/poky-contrib ed/toaster/8279-v3
>
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/8279-v3
>
> Ed Bartosh (24):
>   toaster: don't allow to run toaster as a script
>   toaster: implement get-dburl command
>   toaster: set DATABASE_URL in toaster script
>   toaster: run bitbake the same way
>   toaster: remove unused variable
>   toaster: check for toaster configuration later
>   toaster: use parent of the build dir
>   toaster: make runbuilds to loop
>   toaster: start 'manage.py runbuilds' in the script
>   toaster: update brbe and project attributes
>   toaster: implement stop_bitbake function
>   toaster: implement start_bitbake function
>   toaster: implement 'toaster restart-bitbake'
>   toaster: remove _setupBE function
>   toaster: reimplemented startBBServer method
>   toaster: remove stopBBServer API
>   toaster: do not terminate bb server
>   toaster: remove usage of BUILD_MODE variable
>   toaster: do not create duplicate HelpText objects
>   toaster: implement BitbakeController.getVariable
>   toaster: set varibales on bitbake server
>   toaster: remove writeConfFile API
>   toaster: stop using toaster-pre.conf
>   toaster: remove SDKMACHINE from project variables
>
> Michael Wood (1):
>   toaster: buildinfohelper Broaden the toaster created recipe data case
>
>  bitbake/bin/toaster                                | 186
> +++++++--------------
>  bitbake/lib/bb/ui/buildinfohelper.py               |  23 +--
>  bitbake/lib/bb/ui/toasterui.py                     |  15 +-
>  bitbake/lib/toaster/bldcontrol/bbcontroller.py     |  15 +-
>  .../toaster/bldcontrol/localhostbecontroller.py    | 132 ++++-----------
>  .../bldcontrol/management/commands/runbuilds.py    |  13 +-
>  bitbake/lib/toaster/bldcontrol/sshbecontroller.py  |  10 --
>  bitbake/lib/toaster/bldcontrol/tests.py            |   4 -
>  bitbake/lib/toaster/toastergui/templates/base.html |  13 +-
>  .../lib/toaster/toastergui/templates/landing.html  |  10 --
>  .../toaster/toastergui/templates/projectconf.html  |  70 +-------
>  bitbake/lib/toaster/toastergui/tests.py            |   4 -
>  bitbake/lib/toaster/toastergui/views.py            |  29 ----
>  .../toastermain/management/commands/get-dburl.py   |   9 +
>  bitbake/lib/toaster/toastermain/settings.py        |   3 -
>  bitbake/lib/toaster/toastermain/urls.py            |   9 +-
>  16 files changed, 142 insertions(+), 403 deletions(-)
>  create mode 100644
> bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
>
> --
> Ed
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>



-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre

[-- Attachment #2: Type: text/html, Size: 5036 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster
  2015-11-09 16:23 ` Smith, Elliot
@ 2015-11-09 16:30   ` Smith, Elliot
  2015-11-09 16:54     ` Barros Pena, Belen
  0 siblings, 1 reply; 30+ messages in thread
From: Smith, Elliot @ 2015-11-09 16:30 UTC (permalink / raw)
  To: Ed Bartosh; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 4227 bytes --]

Just to clarify, I tested the v4 branch with 2 patches cherry-picked.

Branch:

ed/toaster/8279-v4

Patches (to remove SDKMACHINE):

d5f682695c9f0005eb0713b4e302f36a22f80a9e
0c4206c68d3089741525681c3ce0d2f96c09d451

Elliot

On 9 November 2015 at 16:23, Smith, Elliot <elliot.smith@intel.com> wrote:

> On 27 October 2015 at 17:27, Ed Bartosh <ed.bartosh@linux.intel.com>
> wrote:
>>
>> This patchset merges two Toaster modes in one:
>>
>> To run toaster you should source it in already prepared build environment:
>>   cd poky
>>   . oe-init-build-env
>>   . ../bitbake/bin/toaster
>>
>> After that you should be able to trigger builds both ways:
>> from command line and from toaster UI.
>>
>
> This works fine for me.
>
> I'm able to run builds from the command line and from Toaster, and the
> data about those builds appears to be complete.
>
> I have also gone through the code, and can't see any glaring issues with
> it.
>
> Elliot
>
>
>>
>> The following changes since commit
>> 8a0d8eee432924433c3e70198aaeab3161476c5f:
>>
>>   toaster manual: Updated the set up and use chapter (2015-10-27 07:28:22
>> +0000)
>>
>> are available in the git repository at:
>>
>>   git://git.yoctoproject.org/poky-contrib ed/toaster/8279-v3
>>
>> http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/8279-v3
>>
>> Ed Bartosh (24):
>>   toaster: don't allow to run toaster as a script
>>   toaster: implement get-dburl command
>>   toaster: set DATABASE_URL in toaster script
>>   toaster: run bitbake the same way
>>   toaster: remove unused variable
>>   toaster: check for toaster configuration later
>>   toaster: use parent of the build dir
>>   toaster: make runbuilds to loop
>>   toaster: start 'manage.py runbuilds' in the script
>>   toaster: update brbe and project attributes
>>   toaster: implement stop_bitbake function
>>   toaster: implement start_bitbake function
>>   toaster: implement 'toaster restart-bitbake'
>>   toaster: remove _setupBE function
>>   toaster: reimplemented startBBServer method
>>   toaster: remove stopBBServer API
>>   toaster: do not terminate bb server
>>   toaster: remove usage of BUILD_MODE variable
>>   toaster: do not create duplicate HelpText objects
>>   toaster: implement BitbakeController.getVariable
>>   toaster: set varibales on bitbake server
>>   toaster: remove writeConfFile API
>>   toaster: stop using toaster-pre.conf
>>   toaster: remove SDKMACHINE from project variables
>>
>> Michael Wood (1):
>>   toaster: buildinfohelper Broaden the toaster created recipe data case
>>
>>  bitbake/bin/toaster                                | 186
>> +++++++--------------
>>  bitbake/lib/bb/ui/buildinfohelper.py               |  23 +--
>>  bitbake/lib/bb/ui/toasterui.py                     |  15 +-
>>  bitbake/lib/toaster/bldcontrol/bbcontroller.py     |  15 +-
>>  .../toaster/bldcontrol/localhostbecontroller.py    | 132 ++++-----------
>>  .../bldcontrol/management/commands/runbuilds.py    |  13 +-
>>  bitbake/lib/toaster/bldcontrol/sshbecontroller.py  |  10 --
>>  bitbake/lib/toaster/bldcontrol/tests.py            |   4 -
>>  bitbake/lib/toaster/toastergui/templates/base.html |  13 +-
>>  .../lib/toaster/toastergui/templates/landing.html  |  10 --
>>  .../toaster/toastergui/templates/projectconf.html  |  70 +-------
>>  bitbake/lib/toaster/toastergui/tests.py            |   4 -
>>  bitbake/lib/toaster/toastergui/views.py            |  29 ----
>>  .../toastermain/management/commands/get-dburl.py   |   9 +
>>  bitbake/lib/toaster/toastermain/settings.py        |   3 -
>>  bitbake/lib/toaster/toastermain/urls.py            |   9 +-
>>  16 files changed, 142 insertions(+), 403 deletions(-)
>>  create mode 100644
>> bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
>>
>> --
>> Ed
>>
>> --
>> _______________________________________________
>> toaster mailing list
>> toaster@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/toaster
>>
>
>
>
> --
> Elliot Smith
> Software Engineer
> Intel Open Source Technology Centre
>



-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre

[-- Attachment #2: Type: text/html, Size: 6404 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster
  2015-11-09 16:30   ` Smith, Elliot
@ 2015-11-09 16:54     ` Barros Pena, Belen
  0 siblings, 0 replies; 30+ messages in thread
From: Barros Pena, Belen @ 2015-11-09 16:54 UTC (permalink / raw)
  To: Smith, Elliot, Ed Bartosh; +Cc: toaster



On 09/11/2015 16:30, "toaster-bounces@yoctoproject.org on behalf of Smith,
Elliot" <toaster-bounces@yoctoproject.org on behalf of
elliot.smith@intel.com> wrote:

>Just to clarify, I tested the v4 branch with 2 patches cherry-picked.
>
>
>Branch:
>
>ed/toaster/8279-v4
>
>Patches (to remove SDKMACHINE):
>
>d5f682695c9f0005eb0713b4e302f36a22f80a9e
>0c4206c68d3089741525681c3ce0d2f96c09d451

I tested in the same way, and it also works for me. However, I found that
when you run build from the toaster GUI, the toaster process stayed in the
foreground, so I was not able to start a build from command line
afterwards. But if you press enter, you are dropped back to your shell.
Elliot explained: "well, you are technically dropped back to the shell,
it's just that toaster is being a bit naughty and writing to stdout, which
is a bit confusing, because you can't see the prompt".

This indeed caused me quite a bit of confusion. If it's easy to fix, it
would be good to do so, so that after the build completes you are cleanly
dropped back to your shell and everything is ready to start a command line
build if that's what you want to do.

Cheers

Belén

>
>
>
>Elliot
>
>
>On 9 November 2015 at 16:23, Smith, Elliot
><elliot.smith@intel.com> wrote:
>
>On 27 October 2015 at 17:27, Ed Bartosh
><ed.bartosh@linux.intel.com> wrote:
>
>This patchset merges two Toaster modes in one:
>
>To run toaster you should source it in already prepared build environment:
>  cd poky
>  . oe-init-build-env
>  . ../bitbake/bin/toaster
>
>After that you should be able to trigger builds both ways:
>from command line and from toaster UI.
>
>
>
>
>This works fine for me.
>
>
>I'm able to run builds from the command line and from Toaster, and the
>data about those builds appears to be complete.
>
>
>I have also gone through the code, and can't see any glaring issues with
>it.
>
>
>Elliot
> 
>
>
>The following changes since commit
>8a0d8eee432924433c3e70198aaeab3161476c5f:
>
>  toaster manual: Updated the set up and use chapter (2015-10-27 07:28:22
>+0000)
>
>are available in the git repository at:
>
>  git://git.yoctoproject.org/poky-contrib
><http://git.yoctoproject.org/poky-contrib> ed/toaster/8279-v3
>  
>http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/8279-v
>3 
><http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/8279-
>v3>
>
>Ed Bartosh (24):
>  toaster: don't allow to run toaster as a script
>  toaster: implement get-dburl command
>  toaster: set DATABASE_URL in toaster script
>  toaster: run bitbake the same way
>  toaster: remove unused variable
>  toaster: check for toaster configuration later
>  toaster: use parent of the build dir
>  toaster: make runbuilds to loop
>  toaster: start 'manage.py runbuilds' in the script
>  toaster: update brbe and project attributes
>  toaster: implement stop_bitbake function
>  toaster: implement start_bitbake function
>  toaster: implement 'toaster restart-bitbake'
>  toaster: remove _setupBE function
>  toaster: reimplemented startBBServer method
>  toaster: remove stopBBServer API
>  toaster: do not terminate bb server
>  toaster: remove usage of BUILD_MODE variable
>  toaster: do not create duplicate HelpText objects
>  toaster: implement BitbakeController.getVariable
>  toaster: set varibales on bitbake server
>  toaster: remove writeConfFile API
>  toaster: stop using toaster-pre.conf
>  toaster: remove SDKMACHINE from project variables
>
>Michael Wood (1):
>  toaster: buildinfohelper Broaden the toaster created recipe data case
>
> bitbake/bin/toaster                                | 186
>+++++++--------------
> bitbake/lib/bb/ui/buildinfohelper.py               |  23 +--
> bitbake/lib/bb/ui/toasterui.py                     |  15 +-
> bitbake/lib/toaster/bldcontrol/bbcontroller.py     |  15 +-
> .../toaster/bldcontrol/localhostbecontroller.py    | 132 ++++-----------
> .../bldcontrol/management/commands/runbuilds.py    |  13 +-
> bitbake/lib/toaster/bldcontrol/sshbecontroller.py  |  10 --
> bitbake/lib/toaster/bldcontrol/tests.py            |   4 -
> bitbake/lib/toaster/toastergui/templates/base.html |  13 +-
> .../lib/toaster/toastergui/templates/landing.html  |  10 --
> .../toaster/toastergui/templates/projectconf.html  |  70 +-------
> bitbake/lib/toaster/toastergui/tests.py            |   4 -
> bitbake/lib/toaster/toastergui/views.py            |  29 ----
> .../toastermain/management/commands/get-dburl.py   |   9 +
> bitbake/lib/toaster/toastermain/settings.py        |   3 -
> bitbake/lib/toaster/toastermain/urls.py            |   9 +-
> 16 files changed, 142 insertions(+), 403 deletions(-)
> create mode 100644
>bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
>
>--
>Ed
>
>--
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster
>
>
>
>
>
>
>
>
>
>-- 
>Elliot Smith
>Software Engineer
>Intel Open Source Technology Centre
>
>
>
>
>
>
>
>
>
>
>
>-- 
>Elliot Smith
>Software Engineer
>Intel Open Source Technology Centre
>
>
>



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2015-11-09 16:55 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-27 17:27 [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
2015-10-27 17:27 ` [PATCH 01/25] toaster: don't allow to run toaster as a script Ed Bartosh
2015-10-27 17:27 ` [PATCH 02/25] toaster: implement get-dburl command Ed Bartosh
2015-10-27 17:28 ` [PATCH 03/25] toaster: set DATABASE_URL in toaster script Ed Bartosh
2015-10-27 17:28 ` [PATCH 04/25] toaster: run bitbake the same way Ed Bartosh
2015-10-27 17:28 ` [PATCH 05/25] toaster: remove unused variable Ed Bartosh
2015-10-27 17:28 ` [PATCH 06/25] toaster: check for toaster configuration later Ed Bartosh
2015-10-27 17:28 ` [PATCH 07/25] toaster: use parent of the build dir Ed Bartosh
2015-10-27 17:28 ` [PATCH 08/25] toaster: make runbuilds to loop Ed Bartosh
2015-10-27 17:28 ` [PATCH 09/25] toaster: start 'manage.py runbuilds' in the script Ed Bartosh
2015-10-27 17:28 ` [PATCH 10/25] toaster: update brbe and project attributes Ed Bartosh
2015-10-27 17:28 ` [PATCH 11/25] toaster: implement stop_bitbake function Ed Bartosh
2015-10-27 17:28 ` [PATCH 12/25] toaster: implement start_bitbake function Ed Bartosh
2015-10-27 17:28 ` [PATCH 13/25] toaster: implement 'toaster restart-bitbake' Ed Bartosh
2015-10-27 17:28 ` [PATCH 14/25] toaster: remove _setupBE function Ed Bartosh
2015-10-27 17:28 ` [PATCH 15/25] toaster: reimplemented startBBServer method Ed Bartosh
2015-10-27 17:28 ` [PATCH 16/25] toaster: remove stopBBServer API Ed Bartosh
2015-10-27 17:28 ` [PATCH 17/25] toaster: do not terminate bb server Ed Bartosh
2015-10-27 17:28 ` [PATCH 18/25] toaster: remove usage of BUILD_MODE variable Ed Bartosh
2015-10-27 17:28 ` [PATCH 19/25] toaster: do not create duplicate HelpText objects Ed Bartosh
2015-10-27 17:28 ` [PATCH 20/25] toaster: buildinfohelper Broaden the toaster created recipe data case Ed Bartosh
2015-10-27 17:28 ` [PATCH 21/25] toaster: implement BitbakeController.getVariable Ed Bartosh
2015-10-27 17:28 ` [PATCH 22/25] toaster: set varibales on bitbake server Ed Bartosh
2015-10-27 17:28 ` [PATCH 23/25] toaster: remove writeConfFile API Ed Bartosh
2015-10-27 17:28 ` [PATCH 24/25] toaster: stop using toaster-pre.conf Ed Bartosh
2015-10-27 17:28 ` [PATCH 25/25] toaster: remove SDKMACHINE from project variables Ed Bartosh
2015-11-03 10:53 ` [PATCH 00/25] toaster: 8279: Provide a single way of starting Toaster Barros Pena, Belen
2015-11-09 16:23 ` Smith, Elliot
2015-11-09 16:30   ` Smith, Elliot
2015-11-09 16:54     ` Barros Pena, Belen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.