Skip to content

TMP: How to Update Knative for vHive

Anshal Shukla edited this page Feb 11, 2023 · 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. Login to Docker Hub account that the Knative images will be pushed to.

    ko login index.docker.io -u <DOCKERHUB USERNAME> -p <DOCKERHUB PASSWORD>
  3. 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/<DOCKERHUB USERNAME>'
    EOF
    • <DOCKER HUB USERNAME> must be the same username that you used to login in the previous step.
  4. Git clone your fork.

    git clone https://github.com/ease-lab/serving
    cd serving
  5. Add knative/serving as an upstream and pull the version branch.

    git remote add upstream https://github.com/knative/serving.git
    git pull upstream <FEATURE BRANCH>:<NEW LOCAL BRANCH>
    git checkout <NEW LOCAL BRANCH>
  6. We maintain our serving branch as a pull request here. Take this as reference and make changes accordingly.

  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. Update the vhive/configs/knative_yamls with newly generated yamls.

  11. Commit and push/merge your changes to/at both repos!