blob: 478e04ef37095e7565c3770d5de274050714fe2f [file] [log] [blame]
Jan Tattermuscha30fc5d2016-03-25 14:00:23 -07001#!/bin/bash
Craig Tiller6169d5f2016-03-31 07:46:18 -07002# Copyright 2015, Google Inc.
Jan Tattermuscha30fc5d2016-03-25 14:00:23 -07003# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#
9# * Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# * Redistributions in binary form must reproduce the above
12# copyright notice, this list of conditions and the following disclaimer
13# in the documentation and/or other materials provided with the
14# distribution.
15# * Neither the name of Google Inc. nor the names of its
16# contributors may be used to endorse or promote products derived from
17# this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31# Initializes a fresh GCE VM to become a jenkins linux performance worker.
32# You shouldn't run this script on your own,
33# use create_linux_performance_worker.sh instead.
34
35set -ex
36
37sudo apt-get update
38
Jan Tattermuschbb1a4532016-03-30 18:04:01 -070039# Install Java 8 JDK (to build gRPC Java)
40sudo apt-get install -y openjdk-8-jdk
Jan Tattermuscha30fc5d2016-03-25 14:00:23 -070041sudo apt-get install -y unzip lsof
42
Jan Tattermuscha30fc5d2016-03-25 14:00:23 -070043# Add pubkey of jenkins@grpc-jenkins-master to authorized keys of jenkins@
44# This needs to happen as the last step to prevent Jenkins master from connecting
45# to a machine that hasn't been properly setup yet.
46cat jenkins_master.pub | sudo tee --append ~jenkins/.ssh/authorized_keys
47
48sudo apt-get install -y \
49 autoconf \
50 autotools-dev \
51 build-essential \
52 bzip2 \
53 ccache \
54 curl \
55 gcc \
56 gcc-multilib \
57 git \
58 gyp \
59 lcov \
60 libc6 \
61 libc6-dbg \
62 libc6-dev \
63 libgtest-dev \
64 libtool \
65 make \
66 strace \
67 pypy \
68 python-dev \
69 python-pip \
70 python-setuptools \
71 python-yaml \
72 telnet \
73 unzip \
74 wget \
75 zip
76
77# perftools
78sudo apt-get install -y google-perftools libgoogle-perftools-dev
79
80# C++ dependencies
81sudo apt-get install -y libgflags-dev libgtest-dev libc++-dev clang
82
83# Python dependencies
84sudo pip install tabulate
Jan Tattermusch962c3872016-04-21 10:09:06 -070085sudo pip install google-api-python-client
86
Jan Tattermuscha30fc5d2016-03-25 14:00:23 -070087curl -O https://bootstrap.pypa.io/get-pip.py
88sudo pypy get-pip.py
89sudo pypy -m pip install tabulate
Jan Tattermusch962c3872016-04-21 10:09:06 -070090sudo pip install google-api-python-client
Jan Tattermuscha30fc5d2016-03-25 14:00:23 -070091
Jan Tattermuschb19b62c2016-03-31 17:18:54 -070092# Node dependencies (nvm has to be installed under user jenkins)
Jan Tattermuscha30fc5d2016-03-25 14:00:23 -070093touch .profile
94curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
95nvm install 0.12 && npm config set cache /tmp/npm-cache
96
97# C# dependencies (http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives)
98
99sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
100echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
101sudo apt-get update
102sudo apt-get install -y mono-devel nuget
103
104# Ruby dependencies
105gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
106curl -sSL https://get.rvm.io | bash -s stable --ruby
Jan Tattermuschbb1a4532016-03-30 18:04:01 -0700107
Jan Tattermusch962c3872016-04-21 10:09:06 -0700108# Install bundler (prerequisite for gRPC Ruby)
109source ~/.rvm/scripts/rvm
110gem install bundler
111
Jan Tattermuschbb1a4532016-03-30 18:04:01 -0700112# Java dependencies - nothing as we already have Java JDK 8