|
| 1 | +# MIT License |
| 2 | +# |
| 3 | +# Copyright (c) 2020 Shyam Jesalpura and EASE lab |
| 4 | +# |
| 5 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | +# of this software and associated documentation files (the "Software"), to deal |
| 7 | +# in the Software without restriction, including without limitation the rights |
| 8 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | +# copies of the Software, and to permit persons to whom the Software is |
| 10 | +# furnished to do so, subject to the following conditions: |
| 11 | +# |
| 12 | +# The above copyright notice and this permission notice shall be included in all |
| 13 | +# copies or substantial portions of the Software. |
| 14 | +# |
| 15 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | +# SOFTWARE. |
| 22 | + |
| 23 | +#!/bin/bash |
| 24 | + |
| 25 | +if [ -z $1 ] || [ -z $2 ]; then |
| 26 | + echo "Parameters missing" |
| 27 | + echo "USAGE: rebuild_deps.sh <fccd git branch> <Knative serving branch>" |
| 28 | + exit -1 |
| 29 | +fi |
| 30 | +FCCD_BRANCH=$1 |
| 31 | +KNATIVE_BRANCH=$2 |
| 32 | + |
| 33 | +set -x |
| 34 | +PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 35 | +$PWD/install_go.sh |
| 36 | +$PWD/install_docker.sh |
| 37 | +sudo apt install -y git |
| 38 | + |
| 39 | +cd $HOME |
| 40 | +git clone -b $FCCD_BRANCH --recurse-submodules https://github.com/ease-lab/firecracker-containerd |
| 41 | +cd firecracker-containerd |
| 42 | +make image |
| 43 | +make firecracker |
| 44 | +make all |
| 45 | + |
| 46 | +# copy binaries to vhive/bin |
| 47 | +# cp runtime/containerd-shim-aws-firecracker $PWD/../bin/ |
| 48 | +# cp firecracker-control/cmd/containerd/firecracker-containerd $PWD/../bin/ |
| 49 | +# cp firecracker-control/cmd/containerd/firecracker-ctr $PWD/../bin/ |
| 50 | + |
| 51 | +# cp _submodules/firecracker/build/cargo_target/x86_64-unknown-linux-musl/release/firecracker $PWD/../bin/ |
| 52 | +# cp _submodules/firecracker/build/cargo_target/x86_64-unknown-linux-musl/release/jailer $PWD/../bin/ |
| 53 | + |
| 54 | +# install knative dependencies |
| 55 | +VERSION=0.8.1 # choose the latest version |
| 56 | +OS=Linux # or Darwin |
| 57 | +ARCH=x86_64 # or arm64, i386, s390x |
| 58 | +curl -L https://github.com/google/ko/releases/download/v${VERSION}/ko_${VERSION}_${OS}_${ARCH}.tar.gz | tar xzf - ko |
| 59 | +chmod +x ./ko |
| 60 | +sudo mv ko /usr/bin/ |
| 61 | + |
| 62 | +wget -c https://github.com/google/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip |
| 63 | +sudo unzip protoc-3.11.4-linux-x86_64.zip -d /usr/local |
| 64 | + |
| 65 | +export GOROOT=$(go env GOROOT) |
| 66 | +go get github.com/gogo/protobuf/protoc-gen-gogofaster |
| 67 | + |
| 68 | +#build knative |
| 69 | +git clone -b $KNATIVE_BRANCH https://github.com/ease-lab/serving |
| 70 | +$PWD/serving/hack/generate-yamls.sh $PWD/serving/ $PWD/serving/new-yamls.txt |
0 commit comments