Skip to content

Latest commit

 

History

History
174 lines (108 loc) · 4.83 KB

DEVELOPMENT.md

File metadata and controls

174 lines (108 loc) · 4.83 KB

Developer Guide

I'm glad you can see this document and I'm looking forward to your contributions to the Yatai.

Yatai does not rely on cloud-native, but it is accessible to cloud-native based yatai-deployment as a RESTful api-server, so how to bridge the network between the Kubernetes cluster and the local development environment is a problem that needs to be solved

As you know, Kubernetes has a complex network environment, so developing cloud-native related products locally can be a challenge. But don't worry, this document will show you how to develop Yatai locally easily, quickly and comfortably.

Prerequisites

  • Git LFS

    Yatai Git project use LFS to storage large image files in the documentation.

  • A Yatai installed in the development environment for development and debugging

    NOTE: Since you are developing, you must not use the production environment, so we recommend using the quick install script to install Yatai in the local minikube

    Using a pre-installed Yatai in the development environment, the aim is to quickly provide a range of out-of-the-box infrastructure dependencies

    You can start by reading this installation document to install Yatai. It is highly recommended to use the quick install script to install Yatai

    Remember, never use infrastructure from the production environment, only use newly installed infrastructure in the cluster, such as SQL databases, blob storage, docker registry, etc. The quick install script mentioned above will prevent you from using the infrastructure in the production environment, this script will help you to install all the infrastructure from scratch, you can use it without any worries.

    If you have already installed it, please verify that your kubectl context is correct with the following command:

    kubectl config current-context
  • jq

    Used to parse json from the command line

  • Go language compiler

    Yatai api-server is implemented by Go Programming Language

  • Node.js

    Yatai Web UI is implemented by TypeScript + React

    • We recommend installing NodeJS using nvm which allows developers to quickly install and use different versions of node:
    # Install NVM
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
    
    nvm install 14.17.1
    nvm alias default 14.17.1
  • Yarn Package Manager

    Yatai Web UI uses yarn to manage dependencies.

    npm install -g yarn
  • Telepresence

    The most critical dependency in this document for bridging the local network and the Kubernetes cluster network

Start Developing

  1. Fork the Yatai project on GitHub

  2. Clone the source code from your fork of Yatai's GitHub repository:

    git clone git@github.com:${your github username}/Yatai.git && cd Yatai
  3. Add the Yatai upstream remote to your local Yatai clone:

    git remote add upstream git@github.com:bentoml/Yatai.git
  4. Installing Go dependencies

    go mod download

Making Changes

1. Make sure you're on the main branch.
git checkout main
  1. Use the git pull command to retrieve content from the BentoML GitHub repository.

    git pull upstream main -r
  2. Create a new branch and switch to it.

    git checkout -b your-new-branch-name
  3. Make your changes!

  4. Use the git add command to save the state of files you have changed.

    git add <names of the files you have changed>
  5. Commit your changes.

    git commit -m 'your commit message'
  6. Synchronize upstream changes

    git pull upstream main -r
  7. Push all changes to your forked repo on GitHub.

    git push origin your-new-branch-name

Run Yatai api-server

  1. Connect to the Kubernetes cluster network

    telepresence connect
  2. Run Yatai api-server

    NOTE: The following command uses the infrastructure of the Kubernetes environment in the current kubectl context and replaces the behavior of Yatai in the current Kubernetes environment, so please proceed with caution

    make start-dev
  3. ✨ Enjoy it!

Run Yatai Web UI

  1. Install dependencies

    cd dashboard
    yarn
    cd -
  2. Run frontend proxy server

    cd dashboard
    yarn start
  3. ✨ Enjoy it!