Skip to content

Getting started with Longhorn Development

Shuo Wu edited this page Mar 1, 2019 · 23 revisions

Setting up for 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.

Using GoLand + remote server

In GoLand

  1. Click Tools -> Deployment -> Configuration -> “+” button
  2. Choose SFTP
  3. In Connection
    1. Host: IP address of the remote server
    2. User Name: user name of the remote host
    3. Authentication: choose Key pair, find your private key path (usually ~/.ssh/id_rsa)
    4. Root path: click Autodetect
  4. In Mappings
    1. Local path: your repo path
    2. Deployment path: the corresponding repo path on your remote host
  5. Deployment configuration completed
  6. 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

Using Virtual Box

  1. Set up your local Linux System. Here Ubuntu 16.04 is set up as example.
  2. Click Settings -> Shared Folders, create a shared folder. Do not check Auto-mount.
  3. 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.
  4. 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: ssh -p 1111 _your_local_server_username_@localhost
  5. Install Virtual Box Guest Additions sudo apt-get update sudo apt-get install virtualbox-guest-dkms
  6. Enable auto mount: In your local server Add line shared_folder_name mount_point vboxsf uid=_your_uid_,_gid=your_gid_ 0 0 in /etc/fstab
  7. 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

Go

Install the latest version of go sudo snap install --classic go

Clone this wiki locally