Skip to content

TMP: How to Update Knative for vHive

Bora M. Alper edited this page Jun 7, 2021 · 6 revisions

To be incorporated into the docs folder

This wiki page describes how to make changes to Knative Serving and use the changed version of Knative in vHive.

Get Knative

  1. Install Knative requirements:
    1. Install ko:
      wget -qO- https://github.com/google/ko/releases/download/v0.8.3/ko_0.8.3_Linux_x86_64.tar.gz | sudo tar -C /usr/bin/ -xz ko
      sudo chmod +x /usr/bin/ko 
    2. Install go (1.14 or later); already installed on CloudLab.
    3. Install git; already installed on CloudLab.
  2. Install docker:
    sudo apt install docker.io
    chown -R $USER:docker ~/.docker  # fixes a CloudLab bug?
    sudo usermod -aG docker $USER
  3. Logout and login again for changes to take effect.
  4. Login to Docker Hub account that the Knative images will be pushed to.
    docker login
  5. Set up your environment for building:
    cat << EOF >> ~/.bashrc
    export GOROOT=$(go env GOROOT)
    export GOPATH="$HOME/go"
    export PATH="${PATH}:${GOPATH}/bin"
    export KO_DOCKER_REPO='docker.io/<DOCKER HUB USERNAME>'
    EOF
    • <DOCKER HUB USERNAME> must be the same username that you used to login in the previous step.
  6. Git clone your fork:
    git clone --branch=<FEATURE BRANCH> https://github.com/ease-lab/serving
    cd serving
  7. Generate new Knative YAMLs (by building the relevant Docker images and uploading them to Docker Hub too):
    ./hack/generate-yamls.sh . new-yamls.txt
  8. Copy the generated Knative YAMLs to a well-known location:
    mkdir -p ~/new-yamls
    cp $(cat new-yamls.txt) ~/new-yamls
  9. Copy the generated Knative YAMLs to your local machine if you have used a remote server---execute the following on your local machine:
    # Say, you are at the root of ease-lab/vhive repository...
    rsync -zr <HOSTNAME>:new-yamls/ configs/knative_yamls/ --progress=info2
  10. Commit and push/merge your changes to/at both repos!
Clone this wiki locally