aboutsummaryrefslogtreecommitdiffstats
path: root/packer
diff options
context:
space:
mode:
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>2021-02-10 19:59:10 +0100
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2021-02-10 19:59:10 +0100
commitf99e20d60521b4af85e0c6f267b2b431729497e4 (patch)
tree1a0f61ceea5dd3c0bf3fb15f95bbca97d990c18d /packer
parent533ecdc873b2f857703ddb0bb1b117531daf94a7 (diff)
Update packer template files
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org> Change-Id: I54e0d6700fe34fa67868328fb9a150d7ca5c3802
Diffstat (limited to 'packer')
-rwxr-xr-xpacker/local_packer_run.sh4
-rw-r--r--packer/provision/agl_dependencies.attic261
-rw-r--r--packer/provision/agl_dependencies.sh25
-rw-r--r--packer/provision/agl_hwtest_dependencies.sh8
4 files changed, 25 insertions, 273 deletions
diff --git a/packer/local_packer_run.sh b/packer/local_packer_run.sh
index b5e9a160..915cc4cb 100755
--- a/packer/local_packer_run.sh
+++ b/packer/local_packer_run.sh
@@ -1,4 +1,4 @@
#!/bin/bash
-packer fix -var-file=vars/ubuntu-16.04.json -var-file=vars/cloud-env.json templates/basebuild-local-kvm.json > templates/basebuild-local-kvm-new.json
-mv templates/basebuild-local-kvm-new.json templates/basebuild-local-kvm.json
+#packer fix -var-file=vars/ubuntu-16.04.json -var-file=vars/cloud-env.json templates/basebuild-local-kvm.json > templates/basebuild-local-kvm-new.json
+#mv templates/basebuild-local-kvm-new.json templates/basebuild-local-kvm.json
packer build -var-file=vars/ubuntu-16.04.json -var-file=vars/cloud-env.json templates/basebuild-local-kvm.json
diff --git a/packer/provision/agl_dependencies.attic b/packer/provision/agl_dependencies.attic
deleted file mode 100644
index 6692de8b..00000000
--- a/packer/provision/agl_dependencies.attic
+++ /dev/null
@@ -1,261 +0,0 @@
-if false ; then
-
-# ATTIC
-
-# clone lava-boot to /opt/AGL/
-mkdir -p /opt/AGL/
-cd /opt/AGL/
-git clone http://git.linaro.org/people/riku.voipio/lava-boot.git
-cd lava-boot
-sed -i '16iimport ssl' lava-boot
-sed -i '17issl._create_default_https_context = ssl._create_unverified_context' lava-boot
-sed -i -e 's#"~/.lava.yaml"#"/opt/AGL/lava-agl/lava.yaml"#' lava-boot
-
-cat <<EOFLAVAYAML > /opt/AGL/lava-agl/.lava.yaml
-server: ${LAVAHOST}
-user: ${LAVAUSER}
-token: ${LAVATOKEN}
-https: true
-EOFLAVAYAML
-
-
-# AGL specific lab integration. To be moved into git repo and cloned or the like.
-#################################################################################
-mkdir -p /opt/AGL/lava-agl/
-cat <<EOFBR >> /opt/AGL/lava-agl/boardready.py
-#!/usr/bin/python
-import xmlrpclib
-import ssl
-import sys
-import time
-
-# bug, ssl chain cannot be verified (letsencrypt)
-# to be fixed
-ssl._create_default_https_context = ssl._create_unverified_context
-
-username = "$LAVAUSER"
-token = "$LAVATOKEN"
-myhostname = "$LAVAHOST"
-
-print "Starting ..."
-sys.stdout.flush()
-arg = None
-if len(sys.argv) > 1:
- arg = sys.argv[1]
-
-if arg == None:
- print("No argument, need lava jobnumber as argument.")
- sys.stdout.flush()
- sys.exit(1)
-
-server = xmlrpclib.ServerProxy("https://%s:%s@%s/RPC2" % (username, token, myhostname))
-#print(arg)
-#sys.stdout.flush()
-
-# Poll loop
-while True:
- try:
- x = server.scheduler.job_status(arg)['job_status']
- except:
- print("Error, quitting.")
- sys.stdout.flush()
- sys.exit(1)
- break
- if 'Cancelled' in x:
- sys.exit(1)
- break
- if 'Submitted' in x:
- print("Job submitted - pending")
- sys.stdout.flush()
- time.sleep(20)
- continue
- if 'Running' in x:
- print("Job Running now.")
- print("Remote boot takes around 5 minutes to complete (download+boot) - waiting ...")
- sys.stdout.flush()
- time.sleep(300)
- y = server.scheduler.job_status(arg)['job_status']
- if 'Running' in y:
- break
- else:
- continue
- break
- break
-# end
-EOFBR
-
-
-cat <<EOFPORTERUPLOADYAML > /opt/AGL/lava-agl/porter_nbd_upload.yaml
-actions:
- - command: deploy_linaro_kernel
- parameters:
- kernel: 'http://localhost/porter/upload/\${KERNELIMAGE}'
- nbdroot: 'http://localhost/porter/upload/\${ROOTFSTOBOOT}'
- ramdisk: 'http://localhost/porter/upload/\${NETBOOTIMAGE}'
- login_prompt: 'porter login:'
- username: 'root'
- - command: boot_linaro_image
- parameters:
- test_image_prompt: 'root@porter:~#'
- - command: lava_command_run
- parameters:
- commands:
- - "while test ! -f /jta.done ; do echo \"Waiting for JTA to finish ... \" ; sleep 20 ; done"
- timeout: 22100
-device_type: 'renesas-porter'
-logging_level: INFO
-job_name: '\${JOB_NAME}'
-timeout: 22600
-
-EOFPORTERUPLOADYAML
-
-cat <<EOFPORTERUPLOADYAML1 > /opt/AGL/lava-agl/porter_nbd_upload_stress.yaml
-actions:
- - command: deploy_linaro_kernel
- parameters:
- kernel: 'http://localhost/porter/upload/\${KERNELIMAGE}'
- nbdroot: 'http://localhost/porter/upload/\${ROOTFSTOBOOT}'
- ramdisk: 'http://localhost/porter/upload/\${NETBOOTIMAGE}'
- login_prompt: 'porter login:'
- username: 'root'
- - command: boot_linaro_image
- parameters:
- test_image_prompt: 'root@porter:~#'
- - command: lava_command_run
- parameters:
- commands:
- - "stress -v -t 120 -c 1 -m 1 -i 1 "
- timeout: 300
-device_type: 'renesas-porter'
-logging_level: INFO
-job_name: '\${JOB_NAME}'
-timeout: 22600
-
-EOFPORTERUPLOADYAML1
-
-cat <<EOFPORTERUPLOADYAML1 > /opt/AGL/lava-agl/porter_nbd_upload_simple.yaml
-actions:
- - command: deploy_linaro_kernel
- parameters:
- kernel: 'http://localhost/porter/upload/\${KERNELIMAGE}'
- nbdroot: 'http://localhost/porter/upload/\${ROOTFSTOBOOT}'
- ramdisk: 'http://localhost/porter/upload/\${NETBOOTIMAGE}'
- login_prompt: 'porter login:'
- username: 'root'
- - command: boot_linaro_image
- parameters:
- test_image_prompt: 'root@porter:~#'
-device_type: 'renesas-porter'
-logging_level: INFO
-job_name: '\${JOB_NAME}'
-timeout: 22600
-
-EOFPORTERUPLOADYAML1
-
-cat <<EOFPORTERSNAPYAML > /opt/AGL/lava-agl/porter_nbd_snapshot.yaml
-actions:
- - command: deploy_linaro_kernel
- parameters:
- kernel: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/uImage+dtb'
- nbdroot: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/core-image-minimal-porter.ext4'
- ramdisk: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/initramfs-netboot-image-porter.ext4.gz.u-boot'
- login_prompt: 'porter login:'
- username: 'root'
- - command: boot_linaro_image
- parameters:
- test_image_prompt: 'root@porter:~#'
- - command: lava_command_run
- parameters:
- commands:
- - "while test ! -f /jta.done ; do echo \"Waiting for JTA to finish ... \" ; sleep 20 ; done"
- timeout: 22100
-device_type: 'renesas-porter'
-logging_level: INFO
-job_name: '\${JOB_NAME}'
-timeout: 22600
-EOFPORTERSNAPYAML
-
-cat <<EOFPORTERSNAPYAML1 > /opt/AGL/lava-agl/porter_nbd_snapshot_stress.yaml
-actions:
- - command: deploy_linaro_kernel
- parameters:
- kernel: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/uImage+dtb'
- nbdroot: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/core-image-minimal-porter.ext4'
- ramdisk: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/initramfs-netboot-image-porter.ext4.gz.u-boot'
- login_prompt: 'porter login:'
- username: 'root'
- - command: boot_linaro_image
- parameters:
- test_image_prompt: 'root@porter:~#'
-device_type: 'renesas-porter'
-logging_level: INFO
-job_name: '\${JOB_NAME}'
-timeout: 22600
-EOFPORTERSNAPYAML1
-
-cat <<EOFPORTERSNAPYAML1 > /opt/AGL/lava-agl/porter_nbd_snapshot_simple.yaml
-actions:
- - command: deploy_linaro_kernel
- parameters:
- kernel: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/uImage+dtb'
- nbdroot: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/core-image-minimal-porter.ext4'
- ramdisk: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/initramfs-netboot-image-porter.ext4.gz.u-boot'
- login_prompt: 'porter login:'
- username: 'root'
- - command: boot_linaro_image
- parameters:
- test_image_prompt: 'root@porter:~#'
-device_type: 'renesas-porter'
-logging_level: INFO
-job_name: '\${JOB_NAME}'
-timeout: 22600
-EOFPORTERSNAPYAML1
-
-
-cat <<EOFUPLOAD > /opt/AGL/lava-agl/upload4lava.sh
-#!/bin/bash
-#set -x
-
-if test x"" != x"\$1"; then
-Y=\$(echo "\$1" | sed -e "s#\.\.##g" -e "s#/##g")
-curl -T "\$Y" https://porter.automotivelinux.org/porter/upload/\$Y --insecure
-else
-echo "Help: \$0 file"
-fi
-
-EOFUPLOAD
-
-cat <<EOFDELETE > /opt/AGL/lava-agl/delete4lava.sh
-#!/bin/bash
-#set -x
-
-if test x"" != x"\$1"; then
-Y=\$(echo "\$1" | sed -e "s#\.\.##g" -e "s#/##g")
-curl -X DELETE https://porter.automotivelinux.org/porter/upload/\$Y --insecure
-else
-echo "Help: \$0 file"
-fi
-
-EOFDELETE
-
-cat <<EOFDEPLOY > /opt/AGL/lava-agl/deploy.sh
-#!/bin/bash
-#set -x
-set -e
-PORTERYAML="porter_nbd_snapshot.yaml"
-
-if test x"" != x"\$1" ; then
- PORTERYAML="\$1"
-fi
-if test -f /opt/AGL/lava-agl/\${PORTERYAML}; then
- /opt/AGL/lava-agl/boardready.py \$(/opt/AGL/lava-boot/lava-boot -j /opt/AGL/lava-agl/\${PORTERYAML} -a -q | sed -e "s#.*job/##g")
-else
- echo "\${PORTERYAML} not found."
- exit 1
-fi
-EOFDEPLOY
-
-chmod a+x /opt/AGL/lava-agl/*
-
-
-fi \ No newline at end of file
diff --git a/packer/provision/agl_dependencies.sh b/packer/provision/agl_dependencies.sh
index 251d5b2c..fa6249a7 100644
--- a/packer/provision/agl_dependencies.sh
+++ b/packer/provision/agl_dependencies.sh
@@ -20,6 +20,11 @@ cat /etc/apt/sources.list
echo "---> Removing Vexxhost Ubuntu mirrors"
sed -i 's/ubuntu.mirror.vexxhost.com/us.archive.ubuntu.com/g' /etc/apt/sources.list
+# UPDATE things
+sed -i -e "s,xenial,bionic,g" /etc/apt/sources.list
+
+sync
+
cat /etc/apt/sources.list
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y -u dist-upgrade
@@ -35,15 +40,17 @@ DEBIAN_FRONTEND=noninteractive apt-get update && \
python-pip python-simplejson g++-multilib make zip unzip iperf3 \
debian-keyring debian-archive-keyring python3-yaml python3-pip python-pip
+DEBIAN_FRONTEND=noninteractive apt-get clean
+
# Adding stretch-backports for lavacli
-echo "deb https://apt.lavasoftware.org/release stretch-backports main" >> /etc/apt/sources.list
+#echo "deb https://apt.lavasoftware.org/release buster-backports main" >> /etc/apt/sources.list
-wget https://apt.lavasoftware.org/lavasoftware.key.asc
-sudo apt-key add lavasoftware.key.asc
-rm lavasoftware.key.asc
+#wget https://apt.lavasoftware.org/lavasoftware.key.asc
+#sudo apt-key add lavasoftware.key.asc
+#rm lavasoftware.key.asc
#sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com A791358F2E49B100
-DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -t stretch-backports lavacli
+DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y lavacli
# we have a build blocker wrt useradd - I assume it is caused by /bin/sh being dash
# systemd: Performing useradd with
@@ -62,7 +69,7 @@ cat <<EOFHOSTS >> /etc/hosts
EOFHOSTS
# install newer version of jjb ... fixes issues with rendering
-sudo pip install --upgrade --force-reinstall -v jenkins-job-builder==1.6.1
+sudo pip install --upgrade --force-reinstall -v jenkins-job-builder
cat <<EOFSYSCTL >> /etc/sysctl.conf
# we have a lot of make jobs, this helps a lot
@@ -85,7 +92,7 @@ EOFSYSCTL
# taken from container setup script. not documented in readme.
# install node.js and tools (npm, gulp, bower)
#
-curl -v --connect-timeout 60 --retry 3 -sL https://deb.nodesource.com/setup_8.x | bash -
+curl -v --connect-timeout 60 --retry 3 -sL https://deb.nodesource.com/setup_12.x | bash -
DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
which -a npm
dpkg -L nodejs
@@ -93,8 +100,8 @@ npm install --global gulp bower
################### SDX181207 { - obsolete: section until closing brace should be removed after migration to next docsite
# tools used to generate developer website (https://github.com/automotive-grade-linux/docs-agl)
-gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
- && curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=jekyll
+#gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
+# && curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=jekyll
mkdir -p /opt/AGL
diff --git a/packer/provision/agl_hwtest_dependencies.sh b/packer/provision/agl_hwtest_dependencies.sh
index 594f0738..d25b6c71 100644
--- a/packer/provision/agl_hwtest_dependencies.sh
+++ b/packer/provision/agl_hwtest_dependencies.sh
@@ -13,6 +13,11 @@ sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com F6BC817356A3D45E ||
sudo su -c "sed -i 's;http://archive.debian.org/debian;http://deb.debian.org/debian;' /etc/apt/sources.list"
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010 || true
+# UPDATE things
+sed -i -e "s,xenial,bionic,g" /etc/apt/sources.list
+
+sync
+
cat /etc/apt/sources.list
# Make sure that we aren't using the vexxhost mirrors as they have issues
@@ -29,6 +34,7 @@ DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get -y install wget python python3 python-pip zip unzip iperf3 \
debian-keyring debian-archive-keyring \
python3-pip python3-yaml
+DEBIAN_FRONTEND=noninteractive apt-get clean
# Adding stretch-backports for lavacli
#echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
@@ -48,7 +54,7 @@ DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
#EOFHOSTS
# install newer version of jjb ... fixes issues with rendering
-sudo pip install --upgrade --force-reinstall -v jenkins-job-builder==1.6.1
+sudo pip install --upgrade --force-reinstall -v jenkins-job-builder
cat <<EOFSYSCTL >> /etc/sysctl.conf
# we have a lot of make jobs, this helps a lot