-
Notifications
You must be signed in to change notification settings - Fork 1
Getting started with Longhorn Development
This page will go over setting up your environment for development work on the current version of longhorn. Since longhorn involves in system programming, it should be tested in Linux environment. If you want to use IDE such as GoLand in your MacOS, you may need to set up a linux server.
In GoLand
-
Click Tools -> Deployment -> Configuration -> “+” button
-
Choose SFTP
-
In Connection
- Host: IP address of the remote server
- User Name: user name of the remote host
- Authentication: choose Key pair, find your private key path (usually
~/.ssh/id_rsa
) - Root path: click Autodetect
-
In Mappings
- Local path: your repo path
- Deployment path: the corresponding repo path on your remote host
-
Deployment configuration completed
-
Click Tools -> Deployment -> Options Upload changed files automatically to the default server: choose Always or On explicit save action
Cautions: Since the local repo and the remote repo are different local from git perspective, please keep git commit operations in the same side
-
Set up your local Linux System. Here Ubuntu 16.04 is set up as example.
-
Click Settings -> Shared Folders, create a shared folder. Do not check Auto-mount.
-
Enable creating Symbol links: Add the following line in /Users/shuo_wu/your_mac_os_username/VirtualBox/VirtualBox.xml
<ExtraDataItem name="VBoxInternal2/SharedFoldersEnableSymlinksCreate//Users/_your_mac_os_username_/go" value="1"/>
Please close Virtual Box before editing. -
Network configuration for SSH access Click Settings -> Network -> Adapter 1(by default have attached to as NAT) -> Advanced -> Port Forwarding -> Add a new entry (click on + to add) with the following settings: Host Port: 1111, Guest Port: 22, leave the host IP and guest IP blank. After completing your virtual machine configuration, you can connect from your Mac cmd shell using the following cmd:
ssh -p 1111 _your_local_server_username_@localhost
-
Install Virtual Box Guest Additions
sudo apt-get update
sudo apt upgrade
sudo apt-get install virtualbox-guest-dkms
-
Enable auto mount: In your local server Add the following line in
/etc/fstab
shared_folder_name mount_point vboxsf uid=_your_uid_,_gid=your_gid_ 0 0
-
Config SSH In your local server
sudo apt-get install openssh-server
Save public key of the client in~/.ssh/authorized_keys
Config SSH in/etc/ssh/sshd_config
:RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no
/etc/init.d/ssh restart
Install the latest version of go
sudo snap install --classic go
You should add the gopath bin directory to your path. Add the following to your .profile
or .bashrc
or other shell file
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
sudo apt install -y open-iscsi
sudo apt-get install jq
sudo apt install python-pip
sudo apt install python2.7
curl -L https://releases.rancher.com/install-docker/18.09.sh | sh
You can choose other version here:
install-docker support by rancher