Difference between revisions of "WOCE Build Environment"

From WebOS-Ports
Jump to navigation Jump to search
m (→‎Installation Procedure: Added link to vagrant install guide)
 
(27 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
<big>Develop in your environment, Build in ours. </big>
 
<big>Develop in your environment, Build in ours. </big>
  
 +
== WOCE Build Environment ==
  
== WOCE Self-Contained Development Environment ==
+
===Introduction===
 
 
  
===Introduction===
+
The WOCE BE uses Vagrant and Virtualbox to create a self-contained build environment for use on OSX and Linux Hosts.
  
The WOCE SDE uses Vagrant and Virtualbox to create a self-contained build environment for use on Windows, OSX and Linux Hosts.
+
''Note: Windows Hosts will work, but are unsupported.''
  
 
Our goal is to create a consistent build setup for developers so that if there are issues with builds we can know that we all are singing off the same sheet of music.
 
Our goal is to create a consistent build setup for developers so that if there are issues with builds we can know that we all are singing off the same sheet of music.
Line 13: Line 13:
 
'''Minimum Requirements'''
 
'''Minimum Requirements'''
  
x86 based computer running Windows(XP minimum), OSX(10.5 minimum) or Linux(32bit or 64bit).
+
x86 based computer running OSX(10.5 minimum) or Linux(32bit or 64bit).
  
 
Enough resources to allot:  
 
Enough resources to allot:  
Line 29: Line 29:
 
3.  Install Virtualbox
 
3.  Install Virtualbox
  
4.  Install Vagrant [http://vagrantup.com/v1/docs/getting-started/index.html (Vagrant Getting Started Guide)]
+
4.  Install Vagrant [https://docs-v1.vagrantup.com/v1/docs/getting-started/index.html (Vagrant Getting Started Guide)]
  
5.  From a Command Prompt in the directory you have set aside for your woce-be VM
+
5.  From a Command Prompt in the directory you have set aside for the build environment
  
  $ vagrant box add woce-be http://bit.ly/QS3G1p
+
  git clone git://www.github.com/woce/woce-be
  
$ vagrant init woce-be
+
===Usage===
  
$ vagrant up
+
From a Command Prompt in the woce-be directory:
  
===Host Setup===
+
'''Bring the VM online'''
 +
vagrant up
 +
''(You can ignore stdin: not a tty errors- these are normal.)''
  
====OSX Setup====
+
'''SSH into the VM'''
 +
vagrant ssh
  
1. Edit:
+
From here, there will be a woce-build directory in /vagrant/home, cloned down from git during 'vagrant up'.
/System/Library/LaunchDaemons/com.apple.nfsd.plist
 
''(requires superuser)''
 
  
2. Scroll down to the line that reads:
+
When you're done:
  <string>/sbin/nfsd</string>
+
'''Shut down the VM'''
 +
  vagrant halt
  
3. Add a new line below it that reads:
+
And if you want to destroy the VM to start with a clean slate:
  <string>-N</string>
+
  vagrant destroy
  
4. Save the file, close it
+
===Shared Folder===
  
5. Edit:
+
Also note there ''is'' a shared folder between the host and virtual machine. The folder your vagrant files are stored in is shared with the virtual machine in /srv/share. This is useful in allowing you to do dev work in the environment you are most comfortable with while still making it easy to use our build environment. Anything you want the build environment to be able to access for the build should be placed in this folder. Assuming your vagrant install is as recommended, see the following as an example.
/etc/exports
 
''(requires superuser)''
 
  
6. Add the following:
+
'''Host System:'''
 +
~/woce-be/
  
/path/to/shared/dir -mapall=501
+
''*is*''
  
7. Save and close it
+
'''Virtual Machine:'''
 +
/srv/share/
  
8. Open Terminal.app and run the following:
+
===Extra===
  
sudo nfsd enable
+
To maximize build performance, it is recommended to configure the Virtual Machine with as many CPU cores and as much RAM as is possible.
  
sudo nfsd checkexports
+
This can be done through the VirtualBox Settings dialogue ''or'' via editing Vagrantfile, recommended settings are half of the host system's CPU cores, and half of it's RAM.
  
showmount -e
+
'''WARNING:''' If you plan on editing Vagrantfile, make sure you know what you are doing!
  
If successful, your share's path should be printed to stdout.
 
  
 +
Example:
  
 +
'''Host System:'''
  
 +
8 CPU Cores
 +
8Gb RAM
  
====Windows Setup====
 
 
1.  Download the [http://soft.hanewin.de/nfs125.exe Hanwin NFS Server]
 
 
2.  Install the Hanwin NFS server
 
 
3.  Use Install SunRPC PortMap Daemon from the start menu to install and start the daemon
 
 
4.  With the control panel applet NFS Server you can configure and monitor the service.
 
*''Administrator rights are required to change settings from the applet.''
 
 
5. Create an exports file with the directories you want to access from NFS clients.
 
*''(The format of the exports file is the same as on Linux. Details are specified below.)''
 
 
6.  Use Install NFS Server service from the start menu to install and start the server
 
 
====Ubuntu Setup====
 
 
1. Install NFS Server
 
sudo apt-get install nfs-kernel-server
 
 
2. Edit:
 
/etc/exports
 
''(requires superuser)''
 
 
3. Add the following to the end:
 
/PATH/TO/HOST/SHARE 127.0.0.1(rw,sync,insecure,no_root_squash)
 
 
4. Save and close /etc/exports
 
 
5. Run the following command:
 
sudo nfs-kernel-server restart
 
 
====Arch Linux Setup====
 
 
1. Install NFS Server
 
sudo pacman -S nfs-utils
 
 
2. Edit:
 
/etc/exports
 
''(requires superuser)''
 
 
3. Add the following to the end:
 
/PATH/TO/HOST/SHARE 127.0.0.1(rw,sync,insecure,no_root_squash)
 
 
4. Save and close /etc/exports
 
 
5. Run the following commands in this order:
 
rc.d start rpcbind (or: rc.d start portmap)
 
rc.d start nfs-common (or: rc.d start nfslock)
 
rc.d start nfs-server (or: rc.d start nfsd)
 
 
===Client Setup===
 
 
1. Connect to VM
 
vagrant ssh
 
  
2. Edit:  
+
'''Virtual Machine:'''
/etc/fstab
 
  
3. Modify the bottom line, replacing:
+
4 CPU Cores
  /PATH/TO/HOST/SHARE
+
  4Gb RAM
with the location of woce-build clone on your host machine
 
  
4. Save and close the fstab
+
If you plan on making changes in Vagrantfile, you'll want to make changes like the following.
  
5 run the following command:
+
config.vm.customize ["modifyvm", :id, "--memory", 2048]
  sudo mount /srv/share
+
  config.vm.customize ["modifyvm", :id, "--cpus", 2]
''(Subject to change if using the host's WOCE folder)''
 

Latest revision as of 20:21, 31 March 2016

Develop in your environment, Build in ours.

WOCE Build Environment

Introduction

The WOCE BE uses Vagrant and Virtualbox to create a self-contained build environment for use on OSX and Linux Hosts.

Note: Windows Hosts will work, but are unsupported.

Our goal is to create a consistent build setup for developers so that if there are issues with builds we can know that we all are singing off the same sheet of music.

Minimum Requirements

x86 based computer running OSX(10.5 minimum) or Linux(32bit or 64bit).

Enough resources to allot:

  • 1 "Virtual CPU"
  • 1GB "Virtual RAM"
  • 20GB "Virtual HD"

Installation Procedure

1. From your development host go to Vagrant Downloads and download the latest version for your host.

2. From your development host go to Virtualbox Downloads and download the latest version for your host.

3. Install Virtualbox

4. Install Vagrant (Vagrant Getting Started Guide)

5. From a Command Prompt in the directory you have set aside for the build environment

git clone git://www.github.com/woce/woce-be

Usage

From a Command Prompt in the woce-be directory:

Bring the VM online

vagrant up

(You can ignore stdin: not a tty errors- these are normal.)

SSH into the VM

vagrant ssh

From here, there will be a woce-build directory in /vagrant/home, cloned down from git during 'vagrant up'.

When you're done: Shut down the VM

vagrant halt

And if you want to destroy the VM to start with a clean slate:

vagrant destroy

Shared Folder

Also note there is a shared folder between the host and virtual machine. The folder your vagrant files are stored in is shared with the virtual machine in /srv/share. This is useful in allowing you to do dev work in the environment you are most comfortable with while still making it easy to use our build environment. Anything you want the build environment to be able to access for the build should be placed in this folder. Assuming your vagrant install is as recommended, see the following as an example.

Host System:

~/woce-be/

*is*

Virtual Machine:

/srv/share/

Extra

To maximize build performance, it is recommended to configure the Virtual Machine with as many CPU cores and as much RAM as is possible.

This can be done through the VirtualBox Settings dialogue or via editing Vagrantfile, recommended settings are half of the host system's CPU cores, and half of it's RAM.

WARNING: If you plan on editing Vagrantfile, make sure you know what you are doing!


Example:

Host System:

8 CPU Cores 
8Gb RAM


Virtual Machine:

4 CPU Cores 
4Gb RAM

If you plan on making changes in Vagrantfile, you'll want to make changes like the following.

config.vm.customize ["modifyvm", :id, "--memory", 2048]
config.vm.customize ["modifyvm", :id, "--cpus", 2]