Skip to content

Latest commit

 

History

History
101 lines (61 loc) · 2.81 KB

develop-on-linux.md

File metadata and controls

101 lines (61 loc) · 2.81 KB

Setup Guide

Welcome developers! This guide will help you on setting up development environment for Shifu on Linux

This guide has been tested on the following platform

Ubuntu 20.04 LTS

Please submit an issue to GitHub if you are having issue following this guide/you have noticed anything wrong with this guide.

Steps

1. Setting up the environment

1.1 Clone Shifu repository

Use the following command to clone Shifu:

git clone https://github.com/Edgenesis/shifu.git

1.2 Install Docker

Follow the official installation guide from Docker official website.

1.3 Install Visual Studio Code (Optional, but highly recommended)

Download the installation deb and install.

After installation, use "File --> Open Folder" to open Shifu directory:

Open folder

A prompt should show up automatically to open this project in remote container:

Remote container prompt

Click on that, VSCode should open your project in remote container. Your development environment is ready!

Note: If you use Visual Studio Code with Dev Container you can skip all below environment setup steps.

1.4 Install Go

From Go, download and install go using the following command:

wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.profile

1.5 Install kind

from kind, install with:

curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.16.0/kind-linux-amd64 \
&& chmod +x ./kind \
&& mv ./kind /usr/local/bin/kind

1.6 Install kubectl

from kubernetes, install with:

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

1.7 Install kubebuilder

from kubebuilder, install with:

curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$(go env GOOS)/$(go env GOARCH)
chmod +x kubebuilder && mv kubebuilder /usr/local/bin/

1.8 Install Go dependencies

Navigate to shifu's directory, issue:

GO111MODULE=on go mod download

(Optional) If you are having issue download dependencies, add a proxy by using:

GOPROXY=https://goproxy.cn,direct GO111MODULE=on go mod download

What's next?

Follow our build guide and start building Shifu.