Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds VM building. #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 85 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,108 @@ before_install:
- gcloud config set project technical-tusk

install:
- yes | gcloud compute instances delete travis-instance --zone us-central1-b || true
- gcloud compute instances create travis-instance --zone us-central1-b --image ubuntu-14-04 --machine-type n1-highcpu-32 --boot-disk-size 64 --scopes compute-rw
- yes | gcloud compute instances delete travis-vm --zone us-central1-b || true
- yes | gcloud compute instances delete travis-v2 --zone us-central1-b || true
- gcloud compute instances create travis-vm --zone us-central1-b --image ubuntu-14-04 --machine-type n1-highcpu-16 --boot-disk-size 200 --scopes compute-rw
- gcloud compute instances create travis-v2 --zone us-central1-b --image ubuntu-14-04 --machine-type n1-highcpu-16 --boot-disk-size 200 --scopes compute-rw
- |
while [ 1 ]; do
gcloud compute ssh travis-instance --zone us-central1-b --command 'exit 0' -- -o ConnectTimeout=10 > /dev/null 2>&1 && break
gcloud compute ssh travis-vm --zone us-central1-b --command 'exit 0' -- -o ConnectTimeout=10 > /dev/null 2>&1 && \
gcloud compute ssh travis-v2 --zone us-central1-b --command 'exit 0' -- -o ConnectTimeout=10 > /dev/null 2>&1 && \
break
sleep 1
done
- gcloud compute ssh travis-instance --zone us-central1-b --command 'at now +60 minute -f <(echo "yes | gcloud compute instances delete travis-instance --zone us-central1-b")'
- gcloud compute ssh travis-vm --zone us-central1-b --command 'at now +60 minute -f <(echo "yes | gcloud compute instances delete travis-vm --zone us-central1-b")'
- gcloud compute ssh travis-v2 --zone us-central1-b --command 'at now +60 minute -f <(echo "yes | gcloud compute instances delete travis-v2 --zone us-central1-b")'

script:
- |
rsync -avz -e "$(gcloud compute ssh --zone us-central1-b travis-instance --dry-run | sed s/'[^ ]*$'//)" . "$(gcloud compute ssh --zone us-central1-b travis-instance --dry-run | awk 'END {print $NF}'):~/openwrt-tessel"
rsync -avz -e "$(gcloud compute ssh --zone us-central1-b travis-vm --dry-run | sed s/'[^ ]*$'//)" . "$(gcloud compute ssh --zone us-central1-b travis-vm --dry-run | awk 'END {print $NF}'):~/openwrt-tessel"
- |
gcloud compute ssh travis-instance --zone us-central1-b --command '
rsync -avz -e "$(gcloud compute ssh --zone us-central1-b travis-v2 --dry-run | sed s/'[^ ]*$'//)" . "$(gcloud compute ssh --zone us-central1-b travis-v2 --dry-run | awk 'END {print $NF}'):~/openwrt-tessel"
- gcloud compute ssh travis-vm --zone us-central1-b --command "mkdir -p ~/.aws; echo '$AWS_CREDENTIALS' | base64 --decode > ~/.aws/credentials"
- gcloud compute ssh travis-v2 --zone us-central1-b --command "mkdir -p ~/.aws; echo '$AWS_CREDENTIALS' | base64 --decode > ~/.aws/credentials"
- |
gcloud compute ssh travis-vm --zone us-central1-b --command '
set -x

sudo mkdir /tmp/ramdisk
sudo chmod 777 /tmp/ramdisk
sudo mount -t tmpfs -o size=12G tmpfs /tmp/ramdisk/

sudo apt-get update -qq
sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:terry.guo/gcc-arm-embedded
sudo apt-get update -qq
sudo apt-get install -y build-essential python-pip git-core g++ subversion libncurses-dev libssl-dev unzip gettext gcc-arm-none-eabi
sudo -H python -m pip install awscli

mkdir ~/upload
cd ~/openwrt-tessel
git submodule update --init --recursive

cp -rf ~/openwrt-tessel /tmp/ramdisk/build
pushd /tmp/ramdisk/build
echo "Running mipsel build..."
make -j32 TARGET=v2 >> ~/upload/build-mipsel.log 2>&1 || \
make -j32 TARGET=v2 >> ~/upload/build-mipsel.log 2>&1 || \
make -j32 TARGET=v2 >> ~/upload/build-mipsel.log 2>&1 || \
make -j32 TARGET=v2 V=s >> ~/upload/build-mipsel.log 2>&1 || \
true
aws s3 sync ~/upload/. s3://tessel-builds/firmware/

set -e
cp /tmp/ramdisk/build/openwrt/bin/ramips/*sysupgrade.bin ~/upload
tar -czf ~/upload/toolchain-mipsel.tar.gz -C /tmp/ramdisk/build/openwrt/staging_dir $(find /tmp/ramdisk/build/openwrt/staging_dir -iname '*-mipsel_*' -exec basename {} \;)
popd

sudo -H python -m pip install awscli
aws s3 sync ~/upload/. s3://tessel-builds/firmware/
' &
PID1=$!

gcloud compute ssh travis-v2 --zone us-central1-b --command '
set -x

sudo mkdir /tmp/ramdisk
sudo chmod 777 /tmp/ramdisk
sudo mount -t tmpfs -o size=14G tmpfs /tmp/ramdisk/
sudo mount -t tmpfs -o size=12G tmpfs /tmp/ramdisk/

sudo apt-get update -qq
sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:terry.guo/gcc-arm-embedded
sudo apt-get update -qq
sudo apt-get install -y build-essential git-core g++ subversion libncurses-dev libssl-dev unzip gettext gcc-arm-none-eabi
cp -rf ~/openwrt-tessel /tmp/ramdisk/openwrt-tessel
cd /tmp/ramdisk/openwrt-tessel
sudo apt-get install -y build-essential python-pip git-core g++ subversion libncurses-dev libssl-dev unzip gettext gcc-arm-none-eabi
sudo -H python -m pip install awscli

mkdir ~/upload
cd ~/openwrt-tessel
git submodule update --init --recursive
make -j64 || make -j64 || make -j64 || make -j64 || make -j64 V=s
'

#after_script:
#- yes | gcloud compute instances delete travis-instance --zone us-central1-b || true
cp -rf ~/openwrt-tessel /tmp/ramdisk/build
pushd /tmp/ramdisk/build
echo "Running x86 build..."
make -j32 TARGET=vm >> ~/upload/build-x86.log 2>&1 || \
make -j32 TARGET=vm >> ~/upload/build-x86.log 2>&1 || \
make -j32 TARGET=vm >> ~/upload/build-x86.log 2>&1 || \
make -j32 TARGET=vm V=s >> ~/upload/build-x86.log 2>&1 || \
true
aws s3 sync ~/upload/. s3://tessel-builds/firmware/

set -e
cp /tmp/ramdisk/build/openwrt/bin/x86/*.vdi ~/upload
tar -czf ~/upload/toolchain-x86.tar.gz -C /tmp/ramdisk/build/openwrt/staging_dir $(find /tmp/ramdisk/build/openwrt/staging_dir -iname '*-i386_*' -exec basename {} \;)
popd

aws s3 sync ~/upload/. s3://tessel-builds/firmware/
' &
PID2=$!

while kill -0 $PID1 || kill -0 $PID2; do
sleep 10
echo "."
done

# after_script:
# - yes | gcloud compute instances delete travis-v2 --zone us-central1-b || true
# - yes | gcloud compute instances delete travis-vm --zone us-central1-b || true
1 change: 1 addition & 0 deletions target/vm/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ CONFIG_TARGET_x86_generic=y
CONFIG_TARGET_x86_generic_Generic=y
CONFIG_TARGET_ROOTFS_EXT4FS=y
CONFIG_VDI_IMAGES=y
CONFIG_TARGET_ROOTFS_PARTSIZE=96

PACKAGES += kmod-usb-ohci-pci