Closed Bug 913304 Opened 11 years ago Closed 11 years ago

Update tegra image process watcher and SUTAgent apk

Categories

(Infrastructure & Operations :: DCOps, task)

x86_64
Windows 7
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Callek, Unassigned)

References

Details

So we need to update the imaging process for tegras, the last time we touched the image was in febuary of 2011.

I'm updating it to use the new Watcher, the new SUTAgent and the appropriate ini files for both (e.g. no ini for SUTAgent and the newest watcher.ini)

We'll need to stage this, and while here I'm also making us use "PRODUCTION" symlink and "STAGING" symlink for each image. e.g. https://mana.mozilla.org/wiki/pages/diffpagesbyversion.action?pageId=25660145&selectedPageVersions=8&selectedPageVersions=7

This is the process I did on each of our two tegra imaging netbooks

cd ~
cd android-tegra/
ln -s tegra_froyo_20110207 ./PRODUCTION
mkdir tegra_froyo_20130905
cd tegra_froyo_20130905/
ln -s ../tegra_froyo_20110207/boot.img boot.img
ln -s ../tegra_froyo_20110207/bootloader.bin bootloader.bin
ln -s ../tegra_froyo_20110207/flash.bct flash.bct
ln -s ../tegra_froyo_20110207/flash.cfg flash.cfg
ln -s ../tegra_froyo_20110207/harmony_flash_crt.sh harmony_flash_crt.sh
ln -s ../tegra_froyo_20110207/harmony_flash_hdmi.sh harmony_flash_hdmi.sh
ln -s ../tegra_froyo_20110207/harmony_flash_lcd.sh harmony_flash_lcd.sh
ln -s ../tegra_froyo_20110207/nvflash nvflash
ln -s ../tegra_froyo_20110207/nvflash_crt.sh nvflash_crt.sh
ln -s ../tegra_froyo_20110207/nvstorage.dat nvstorage.dat
ln -s ../tegra_froyo_20110207/recovery.img recovery.img
ln -s ../tegra_froyo_20110207/system.img system.img
ln -s ../tegra_froyo_20110207/perfhud_switch perfhud_switch
ln -s ../SUT/initialize_tegra.sh.20130905 ./initialize_tegra.sh
cd ../SUT
scp jwood@people.mozilla.org:public_html/*.apk .
# Gets:
#  sutAgentAndroid.1.19.apk - md5sum: aa807e97bdb39db90e2db03bc74cf7a1
#  Watcher.1.16.apk         - md5sum: ce7e91f1a6f43a66eec84d7c90ff734d
python -c "watcherINI='\r\n[watcher]\r\nPingTarget = bm-remote.build.mozilla.org\r\nstrikes = 0\r\n'; f=open('watcher.ini.20130905','w'); f.write(watcherINI); f.close();"
# New watcher.ini.20130905 in DOS format:
#   gets md5sum 95ef1f63bbe57357d105e9faf41a0084
cd ..
ln -s tegra_froyo_20130905 STAGING

# Lastly I took my modified copy of initialize_tegra.sh and scp'ed it to the host like so
scp ./initialize_tegra.sh.20130905 $user@$IP:android-tegra/SUT/initialize_tegra.sh.20130905

The diff of my changes between orig initialize_tegra and new one is:

--- initialize_tegra.sh	2013-09-05 22:54:49 -0400
+++ initialize_tegra.sh.20130905	2013-09-05 22:56:02 -0400
@@ -1,61 +1,45 @@
 #!/bin/sh -e
 
-APK_LIST="SUTAgentAndroidBob26.apk Watcher26.apk FenCP25.apk FfxCP25.apk"
-BASEPORT=42000
+APK_LIST="Watcher.1.16.apk sutAgentAndroid.1.19.apk FenCP25.apk FfxCP25.apk"
 
 if [ $# -ne 1 ] ; then
     echo "Usage: $0 <tegra-xxx>"
     exit -1
 fi
 TEGRANAME=$1
 
 echo $TEGRANAME | grep '^tegra-[0-9][0-9][0-9]$' > /dev/null
 if [ $? -ne 0 ] ; then
     echo "$1 is not a valid tegra name!"
     exit -1
 fi
 
 TEGRANUM=`echo $TEGRANAME | sed -e s/tegra-//`
-PORT=`expr 42000 + $TEGRANUM`
 
-if [ $TEGRANUM -gt 10 -a $TEGRANUM -le 30 ] ; then
-    SUTSERVER="10.250.48.151"
-elif [ $TEGRANUM -gt 30 -a $TEGRANUM -le 50 ] ; then
-    SUTSERVER="10.250.48.152"
-elif [ $TEGRANUM -gt 50 -a $TEGRANUM -le 70 ] ; then
-    SUTSERVER="10.250.48.153"
-elif [ $TEGRANUM -gt 70 -a $TEGRANUM -le 90 ] ; then
-    SUTSERVER="10.250.48.154"
-else
-    SUTSERVER="10.250.48.9"
-fi
-
-echo "Associating $TEGRANAME with Server $SUTSERVER Port $PORT"
+echo "Imaging $TEGRANAME."
 
 cd ../SUT
 sudo adb devices
 adb wait-for-device
 sleep 60
 for apk in $APK_LIST; do
     adb install -r $apk
 done
 adb push tegra_gainroot.sh /sdcard/tegra_gainroot.sh
-cat SUTAgent.ini.tmpl | sed -e "s/\(IPAddr *= *\).*$/\1$SUTSERVER/" | sed -e "s/\(PORT *= *\).*$/\1$PORT/" > tmpfile
-adb push tmpfile /data/data/com.mozilla.SUTAgentAndroid/files/SUTAgent.ini
 adb shell chmod 777 /data/data/com.mozilla.SUTAgentAndroid/files
-cat watcher.ini.tmpl | sed -e "s/\(PingTarget *= *\).*$/\1$SUTSERVER/" > tmpfile
+cp watcher.ini.20130905 tmpfile
 adb push tmpfile /data/data/com.mozilla.watcher/files/watcher.ini
 adb shell chmod 777 /data/data/com.mozilla.watcher/files
 adb shell sh /sdcard/tegra_gainroot.sh
 adb shell am start -a android.settings.APPLICATION_SETTINGS
 adb shell mkdir /mnt/sdcard/tests
 ### HDMI
 ##adb shell setprop persist.tegra.dpy5.mode.width 1680
 ##adb shell setprop persist.tegra.dpy5.mode.height 1050
 ## VGA/CRT
 #adb shell setprop persist.tegra.dpy3.mode.width 1680
 #adb shell setprop persist.tegra.dpy3.mode.height 1050
 rm tmpfile
 echo "##########"
-echo "$TEGRANAME associated with server $SUTSERVER Port $PORT"
+echo "$TEGRANAME successfully reimaged."
 echo "Set Development -> Stay Awake on the tegra,"
Blocks: 913321
DCOps, the staging runs of this have gone well, can you (on both tegra netbooks!) update the directory as follows:

cd ~
cd android-tegra/
rm -f ./PRODUCTION
ln -s tegra_froyo_20130905 ./PRODUCTION
ls -adl ./PRODUCTION  # Sanity check

Docs already say to use "PRODUCTION" so we'll be good there.
Assignee: bugspam.Callek → server-ops-dcops
Component: Platform Support → Server Operations: DCOps
Product: Release Engineering → mozilla.org
QA Contact: coop → dmoore
Version: unspecified → other
Blocks: 918162
colo-trip: --- → mtv1
This should be complete. Please reopen if it's not the case.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: mozilla.org → Infrastructure & Operations
You need to log in before you can comment on or make changes to this bug.