Jan Tattermusch | a30fc5d | 2016-03-25 14:00:23 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Craig Tiller | 6169d5f | 2016-03-31 07:46:18 -0700 | [diff] [blame] | 2 | # Copyright 2015, Google Inc. |
Jan Tattermusch | a30fc5d | 2016-03-25 14:00:23 -0700 | [diff] [blame] | 3 | # 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 | |
| 35 | set -ex |
| 36 | |
| 37 | sudo apt-get update |
| 38 | |
Jan Tattermusch | bb1a453 | 2016-03-30 18:04:01 -0700 | [diff] [blame] | 39 | # Install Java 8 JDK (to build gRPC Java) |
| 40 | sudo apt-get install -y openjdk-8-jdk |
Jan Tattermusch | a30fc5d | 2016-03-25 14:00:23 -0700 | [diff] [blame] | 41 | sudo apt-get install -y unzip lsof |
| 42 | |
Jan Tattermusch | a30fc5d | 2016-03-25 14:00:23 -0700 | [diff] [blame] | 43 | # 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. |
| 46 | cat jenkins_master.pub | sudo tee --append ~jenkins/.ssh/authorized_keys |
| 47 | |
| 48 | sudo 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 |
| 78 | sudo apt-get install -y google-perftools libgoogle-perftools-dev |
| 79 | |
| 80 | # C++ dependencies |
| 81 | sudo apt-get install -y libgflags-dev libgtest-dev libc++-dev clang |
| 82 | |
| 83 | # Python dependencies |
| 84 | sudo pip install tabulate |
Jan Tattermusch | 962c387 | 2016-04-21 10:09:06 -0700 | [diff] [blame] | 85 | sudo pip install google-api-python-client |
| 86 | |
Jan Tattermusch | a30fc5d | 2016-03-25 14:00:23 -0700 | [diff] [blame] | 87 | curl -O https://bootstrap.pypa.io/get-pip.py |
| 88 | sudo pypy get-pip.py |
| 89 | sudo pypy -m pip install tabulate |
Jan Tattermusch | 962c387 | 2016-04-21 10:09:06 -0700 | [diff] [blame] | 90 | sudo pip install google-api-python-client |
Jan Tattermusch | a30fc5d | 2016-03-25 14:00:23 -0700 | [diff] [blame] | 91 | |
Jan Tattermusch | b19b62c | 2016-03-31 17:18:54 -0700 | [diff] [blame] | 92 | # Node dependencies (nvm has to be installed under user jenkins) |
Jan Tattermusch | a30fc5d | 2016-03-25 14:00:23 -0700 | [diff] [blame] | 93 | touch .profile |
| 94 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash |
| 95 | nvm 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 | |
| 99 | sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF |
| 100 | echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list |
| 101 | sudo apt-get update |
| 102 | sudo apt-get install -y mono-devel nuget |
| 103 | |
| 104 | # Ruby dependencies |
| 105 | gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 |
| 106 | curl -sSL https://get.rvm.io | bash -s stable --ruby |
Jan Tattermusch | bb1a453 | 2016-03-30 18:04:01 -0700 | [diff] [blame] | 107 | |
Jan Tattermusch | 962c387 | 2016-04-21 10:09:06 -0700 | [diff] [blame] | 108 | # Install bundler (prerequisite for gRPC Ruby) |
| 109 | source ~/.rvm/scripts/rvm |
| 110 | gem install bundler |
| 111 | |
Jan Tattermusch | bb1a453 | 2016-03-30 18:04:01 -0700 | [diff] [blame] | 112 | # Java dependencies - nothing as we already have Java JDK 8 |