OpenArbor Development Linux
This is how to setup a Linux development environment for developing OpenArbor, debugging OpenArbor, running the automated test system, and other project-management activities.
For a quick guide to building and installing OpenArbor, see OpenArbor Build.
See also OpenArbor Testing.
It is assumed that all command line operations will be done in a bash shell in a desk maintainer environment.
Get a Docker Capable Workstation
- Follow the instructions here DESK_On_Docker_Project
Download and install Eclipse
- Request a VMWare DDCI virtual machine on the ESX server. For details, see: VMWare_Server_Ubuntu#Getting_A_Machine
- Access the virtual machine. For details, see: VMWare_Server_Ubuntu#Accessing_the_Machine
- RDC to the machine
- At the login to oem-virtual-machine
- Username: your username
- Password: your password
- If no icon for opening a terminal is available on the desktop, click on 'Activites'
- type 'terminal', then click on the terminal app to open a terminal
- As part of your first login you should run (from a terminal), the ddci-vm-fixup script. The fixup script enables samba (windows file sharing) and does some user specific config of RDP and the GUI to make things faster.
- ddci-vm-fixup
- Define access to the ddci repositories. For details, see:OpenArbor_Test_Machine_Setup#Define_access_to_ddci_repositories
- Install docker. For details, see: OpenArbor_Test_Machine_Setup#Get_docker_files
- Setup mount points. For details, see: OpenArbor_Test_Machine_Setup#Setup_needed_mount_points
- Install required desk packages. For details, see: OpenArbor_Test_Machine_Setup#Install_required_Desk_packages
- Install the OpenArbor development environment for Linux:
- sudo apt-get install openarbormaintainertools
- Allow OA building /testing to update /OpenArbor dir without asking for a linux password
- sudo bash -c "echo '$USER ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers"
- To update/debug the OA Test Harness, launch the Eclipse development environment in the vm
- /Eclipse/2023-06-R/eclipse/eclipse
- To debug a docker DDS, or a automated test, install and launch the Eclipse development environment from within the DDS docker image:
- Use the OA Test Harness to install a docker DDS (e.g. dds-docker-sales-deos-jupiter-20220524)
- Once the docker DDS is installed, in your linux vm, open a terminal window
- Run the docker image and allow the mount points defined on the vm to be available in the docker image
- run-docker -it --tty --rm --mount=type=bind,source=/mnt,target=/mnt dds-docker-sales-deos-jupiter-20220524
- Install the openarbor development environment in the docker image
- sudo apt-get install openarbormaintainertools
- Save the updated docker container to a new image
- Open a second terminal in the vm
- docker container ls -a
- docker container commit <container name> dds-docker-sales-deos-jupiter-20220524-dev (e.g. container name is something like determined_banzai from the ls of containers)
- Create the development workspace
- exit all docker containers
- From the linux VM, create the development workspace (e.g. ~/ddci_eclipse/workspace-10.n.n)
- (Note: if you accidentally create the dev workspace while in a docker container, launching OA will result in an error that the .metadata folder is read-only!)
- Now from any terminal you an run the development environment for the dds:
- ./run-docker -i --rm --tty --mount=type=bind,source=/mnt,target=/mnt dds-docker-sales-deos-jupiter-20220524-dev
- Setup DDCIFLEX_LICENSE_FILE
- export DDCIFLEX_LICENSE_FILE=/home/username/all_prods.lic
- Launch Eclipse to debug OA source and/or OA automated tests within the docker image
- /Eclipse/2023-06-R/eclipse/eclipse
- On an OA Linux development vm, you can setup subversion to store your personal password so Eclipse will not keep asking for your password when your synchronizing plugin dirs, etc.
- In ~/.subversion/config, uncomment the store-passwords=no line, and change no to yes
- In ~/.subversion/config, uncomment the store-auth-creds=no line, and change no to yes
Check out the development workspaces
mkdir -p /home/<username>/ddci_eclipse svn co https://deos.ddci.com/svn/DDCI/products/openarbor/openarbor/branches /home/<username>/ddci_eclipse/branches
Workspace configuration
- Shortcuts are not yet supported. Use the following command to launch the OA dev environment:
/Eclipse/2023-03-R/eclipse/eclipse - Create a new workspace such as:
/home/<username>/ddci_eclipse/workspace-<branchName>- Rationale: Branches come and go, and sometimes you just hose up your working copy. Keeping the workspace and the working copy separate makes it easier to switch branches or delete and re-download your SVN checkouts without having to worry about losing your workspace configuration.
- Import Existing projects into workspace
File->Import...->General->Existing Projects Into Workspace- Browse... to
/home/<username>/ddci_eclipse/branches/mainline/workspace - OK
- Finish
- Import the launch configurations.
File->Import...->Run/Debug->Launch Configurations- Set
From Directoryto/Eclipse/2021-12-R/eclipse/launches - Check the
launchescheckbox.- The
DDS Dev Launchis for debugging OpenArbor, theDDS Test Launchis for debugging tests.
- The
- Set
- If this is your first launch, use
Window->Preferences->Run/Debug->String Substitutionto create the string substitution variables username, ddsBranchName, ddsConfigName and ddsName as per #Dds_Variables.
- In
Window->Preferences->Java->Editor->Save Actions- Check the 'Perform the selected actions on save' box
- Fix auto-props for both environments.
- In your DESK maintainer environment, edit
/etc/subversion/config; change the line that saysenable-auto-props = notoenable-auto-props = yes. You will also have to uncomment the preceding[miscellany]. - In Eclipse, go to
Window->Preferences->Team->SVNand change theconfiguration locationat the bottom to point to the/etc/subversion/location of your maintainer environment, i.e., the result of the shell commandcygpath -wa /etc/subversion/
- In your DESK maintainer environment, edit
- To start OpenArbor:
Run->Run Configurations...->Eclipse Application->DDS Dev Launch.
DDS Variables
The imported launch configurations use several environment variables to allow developers to easily switch between multiple installed DDS' when both developing and/or usring the automated test system. It is possible to test multiple bsp's for an installed DDS. The developer should only need to specify the ddsBranchName, ddsConfigName and ddsName. When a DDS is installed using the automated test system (OpenArbor_Testing), the DDS is installed at C:\oatestharness\workspace\DDS-list\$(ddsName). A workspace for that DDS is created at C:\oatestharness\workspace \ddses\$(ddsName\$(ddsConfigName)\workspace.
| Variable | Example Value | Description |
|---|---|---|
| ddsBranchName | mainline | Must match the SVN branch name under development/test. Used by the testSystemInvocation variable to form the --branchRoot option to the test system. |
| ddsConfigName | deos_arm_qemu | Indicates the bsp under development/test. Used by the launch configurations to location the DDS workspace directory. |
| ddsName | DDS-docker-sales-jupiter-20230731 | Indicates the dds under development/test. Used by the deosInstallDir and testWorkspacePrefix variables to locate the DDS installation directory and DDS workspace directory. |
| deosInstallDir | / | Indicates the location of the DDS installation directory. |
| deskRootLocation | / | Indicates the location of the DESK installation directory. |
| oaTestHarnessWorkspace | /home/${username}/oaTestHarness/workspace | Indicates the location of all test harness data. |
| testSystemInvocation | --installationRoot ${deosInstallDir} --branchRoot ${oaTestHarnessWorkspace}/branches/${ddsBranchName} | Indicates the the arguments the test system needs to run. |
| testWorkspacePrefix | ${oaTestHarnessWorkspace}/ddses/${ddsName} | Indicates where the workspaces will be located. |
| username | scoretest | Ubuntu only: indicates user for launching tests |
Installing Experimental Packages
Sometimes, you may want to test changes to the cygwin package scripts or package structure without pushing anything to a live server. This can be done by using an existing DDS as a base to modify.
- Download the DDS you want to use as a base for your changes and put it somewhere.
- Drill down into {DDS_LOC}/deos-heartos-posix/deos/{PACKAGE_NAME} to find the tar.bz2 you want to modify. Make a backup copy just in case.
- make a temporary directory somewhere, and extract the contents of the tar.bz2 to the temporary directory, using tar -xjvf.
- extract the contents of the tar file to this same temporary directory as well
- You will likely have two directories "etc" and "<some package dir (ie. OpenArbor>". Modify the contents of either director as required.
- To re-zip the updated directories, issue the following command at the top-most level of the temporary directory containing the updated files: tar jcvf {PACKAGE_NAME} {dir1} {dir2} (ie. tar jcvf trac-docs-258-4.tar.bz2 etc TRAC_)
- Find the setup.ini file in {DDS_LOC}/deos-heartos-posix/, and find your package name inside this file.
- Use md5sum to recalculate your new package, and ls -l to get the exact size of the new package. Replace the corresponding values in the setup.ini, and change the location of the archive, if you are using an alternative location.
- The installer can now be run with the changes in place. Try it and see what happens.
- example line from setup.ini:
- install: deos/trac-docs/trac-docs-258-4.tar.bz2 3308783 5ad42277e650bdc69a4be5fd48768071
- size is 3308783 in the line above
- md5sum is 5ad42277e650bdc69a4be5fd48768071 in the line above
- install: deos/trac-docs/trac-docs-258-4.tar.bz2 3308783 5ad42277e650bdc69a4be5fd48768071
Developing the OpenArbor Test Harness
- make directory C:\ddci_eclipse_test_harness_dev
- cd to the above directory and use svn to checkout a fresh copy of: https://deos.ddci.com/svn/DDCI/products/openarbor/utils/dds-manager/dds-manager-e4/
- svn co --username=<username> --password=<password> --no-auth-cache https://deos.ddci.com/svn/DDCI/products/openarbor/utils/dds-manager/dds-manager-e4/ dds-manager
- Using the OpenArbor Test Harness, install a DDS, and add a test config.
- /Eclipse/2023-03-R/eclipse/eclipse
- /home/scoretest/ddci_eclipse_test_harness_dev/dds-manager-e4
- String substitution settings: Media:linux-debug-testharness-settings.png
Setup test machine on Linux (Deprecated)
Linux/Ubuntu
- RDC to the machine
- At the login to oem-virtual-machine
- Username: scoretest
- Password: (scoretest password)
- If no icon for opening a terminal is available on the desktop, click on 'Activites'
- type 'terminal', then click on the terminal app to open a terminal
Define access to ddci repositories
- Run the vm setup script
- ddci-vm-fixup
- Open a terminal
- sudo -i
- Modify /etc/apt/sources.list to use the DDCI package mirror
- cd /etc/apt
- mv /etc/apt/sources.list sources.list.bak
- nano sources.list
- Paste the content of the sources_list2.txt file below into empty sources.list file
Media:sources_list2.txt
- Add the DDCI DDS distribution-specific http server directory as a new package repository. (note, do no cut/paste from here due to windows line endings)
- distribution=jupiter
- echo "deb [trusted=yes arch=amd64] http://redhat5.ddci.com/Workstation/ubuntu-ddci/ ${distribution} ddci" > \
- /etc/apt/sources.list.d/ddci-dist-${distribution}.list \
- && echo "deb [trusted=yes arch=amd64] http://redhat5.ddci.com/Workstation/ubuntu-ddci/ ${distribution} ddci-unreleased" > \
- /etc/apt/sources.list.d/ddci-dist-${distribution}-unreleased.list
- exit sudo
- exit
Get docker files
- Checkout docker files from svn
- mkdir ~/scm
- svn co -N --username $USER@ddci.com https://deos.ddci.com/scm/Deos ~/scm/Deos
- svn up --parents ~/scm/Deos/maintainer-tools/docker/branches/mainline
- login to docker (one time operation for a machine)
- docker login redhat5.ddci.com -u username@ddci.com
- Allow 'run-docker' to be executed from anywhere, by updating .bashrc, adding the following line:
- PATH=$HOME/scm/Deos/maintainer-tools/docker/branches/mainline:$PATH
- Add this to end of .bashrc to display the 'dkr' prompt when running a docker image.
#If executing in docker (ref https://stackoverflow.com/questions/20010199/how-to-determine-if-a-process-runs-inside-lxc-docker)
if grep -Fqs docker /proc/1/cgroup > /dev/null ; then
PS1='dkr \W$ '
fi
- Start the apt cacher
- cd to docker installation dir
- ./start-apt-cacher
Install required Desk packages
- From the linux vm, update and upgrade to get the latest packages:
- sudo apt-get update
- sudo apt-get --with-new-pkgs upgrade
- To get the desk components:
- sudo apt-get install desk-python-tools make zip rename gcc-arm-eabi maven
- Create a link for python
- cd /bin
- sudo ln -s python2 python
- Create links for /lib64 (work around for flexnet tools)
- cd /lib64
- sudo ln -s ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
- sudo ln -s ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
- Update .bashrc file
- gedit ~/.bashrc
- DDCIFLEX_LICENSE_FILE=/home/scoretest/all_prods.lic; export DDCIFLEX_LICENSE_FILE
- DDCI_FLEXNET_TOOLS_LOC=~/ddci_eclipse_test_harness_dev/dds-manager-e4/build/test-harness/64bit/linux/FLEXnet; export DDCI_FLEXNET_TOOLS_LOC
Setup needed mount points
- Create mount points for the required directory locations
- Install cifs-utils
- cd /home/scoretest
- wget http://archive.ubuntu.com/ubuntu/pool/main/c/cifs-utils/cifs-utils_6.9-1_amd64.deb (? why not sudo apt-get install cifs-utils ?)
- sudo dpkg -i cifs-utils_6.9-1_amd64.deb
- Create the ~/.cifcreds file to add two lines
- touch ~/.cifcreds
- gedit ~/.cifcreds
- username=scoretest
- password=scteorste1
- Modify the permissions for ~/.cifcreds
- sudo chmod 400 ~/.cifcreds
- Add a directory for each mount point in /media. The first 3 must match those defined in Util.java DDS_LOCATIONS_LINUX, /media/sf_temp is used as unix temp dir by test code
- cd /mnt
- sudo mkdir /mnt/sf_DDCI_integration
- sudo chmod 755 /mnt/sf_DDCI_integration
- sudo mkdir /mnt/sf_approved
- sudo chmod 755 /mnt/sf_approved
- sudo mkdir /mnt/sf_other
- sudo chmod 755 /mnt/sf_other
- sudo mkdir /mnt/sf_temp
- sudo chmod 777 /mnt/sf_temp
- sudo mkdir /mnt/sf_TestResults
- sudo chmod 777 /mnt/sf_TestResults
- sudo mkdir /mnt/sf_Downloads
- sudo chmod 755 /mnt/sf_Downloads
- sudo mkdir /mnt/sf_LinuxRCP
- sudo chmod 755 /mnt/sf_LinuxRCP
- Edit the /etc/fstab file to add a line for each mount point. (Use arrow keys to move cursor to new line, Ctrl-X to save and exit)
- sudo nano /etc/fstab
- For \\ddsbuild\DDCI_integration
- //10.0.0.47/DDCI_integration /mnt/sf_DDCI_integration/ cifs ro,auto,,vers=2.0,credentials=/home/scoretest/.cifcreds 0 0
- For \\nx3000\ship\dds\ubuntu\approved
- //10.0.1.219/ship/dds/ubuntu/approved /mnt/sf_approved/ cifs ro,auto,vers=1.0,credentials=/home/scoretest/.cifcreds 0 0
- For \\nx3000\ship\dds\ubuntu\other
- //10.0.1.219/ship/dds/ubuntu/other /mnt/sf_other/ cifs ro,auto,vers=2.0,credentials=/home/scoretest/.cifcreds 0 2
- For \\nx3000\openarbor\TestResults
- //10.0.1.219/openarbor/TestResults /mnt/sf_TestResults/ cifs guest,uid=845601180,rw,auto,vers=2.0,credentials=/home/scoretest/.cifcreds 0 2
- For \\nx3000\openarbor\Downloads
- //10.0.1.219/openarbor/Downloads /mnt/sf_Downloads/ cifs ro,auto,vers=2.0,credentials=/home/scoretest/.cifcreds 0 2
- For \\nx3000\OAStage (LinuxRCP)
- //10.0.1.219/OAStage /mnt/LinuxRCP cifs ro,auto,vers=2.0,credentials=/home/scoretest/.cifcreds 0 2
- For /mnt/sf_temp
- No definition is needed here. /mnt/sf_temp will just be a directory on the vm to be used for temporary files.
- Mount the drive locations
- sudo mount -a
Create a Dummy Sound Card Device
Have the virtual machine create a dummy sound device to be passed to docker containers
running Eclipse. This is necessary because eclipse generates an error if there is no sound
device. The container has no sound device by default, and neither does a virtual machine
(apparently the expectation is that a remote desktop client will supply the sound device).
For some reason the RDP is not reliably creating said device, so we need to have a dummy in
the container, but there is no bundled ALSA (kernel) sound driver in docker, so it is
necessary to create the dummy device in the VM, then pass it to the container using the
sound switches defined in the test harness, which will execute the ensure-dummy-sound-device-exists
script
- From the linux vm, create the snd-dummy.conf file
- sudo bash -c '(echo "# create dummy sound device"; echo "snd-dummy") > /etc/modules-load.d/snd-dummy.conf'
- Add scoretest to the audio group
- sudo usermod -aG audio $USER
- Reboot
- sudo reboot
- Create the ensure-dummy-sound-device-exists script
- sudo nano ~/oaTestHarness/workspace/ensure-dummy-sound-device-exists
- paste the content of the file below into ensure-dummy-sound-device-exists
Media:ensure-dummy-sound-device-exists.txt
- sudo chmod +x ensure-dummy-sound-device-exists
Setup VNC
- Install VNCServer
- Detailed instructions are here https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-20-04
- sudo apt update
- sudo apt install xfce4 xfce4-goodies
- when prompted for a default display manager, press ENTER
- sudo apt install tightvncserver
- vncserver
- enter the scoretest password (scteorste1)
- reply n to not create a view only password
- Configure the VNC Server
- vncserver -kill :1
- mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
- nano ~/.vnc/xstartup
- #!/bin/bash
- xrdb $HOME/.Xresources
- startxfce4 &
- Restart the VNC Server
- chmod +x ~/.vnc/xstartup
- vncserver
- Running VNC as a System Service
- sudo nano /etc/systemd/system/vncserver@.service
- Add the following lines to the file
- [Unit]
- Description=Start TightVNC server at startup
- After=syslog.target network.target
- [Service]
- Type=forking
- User=scoretest
- Group=score
- WorkingDirectory=/home/scoretest
- PIDFile=/home/scoretest/.vnc/%H:%i.pid
- ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
- ExecStart=/usr/bin/vncserver -depth 16 -geometry 1920x1080 :%i
- ExecStop=/usr/bin/vncserver -kill :%i
- [Install]
- WantedBy=multi-user.target
- Make the system aware of the new file
- sudo systemctl daemon-reload
- sudo systemctl enable vncserver@1.service
- Stop the server if it's still running
- vncserver -kill :1
- Start it as a service
- sudo systemctl start vncserver@1
- Verify it has started
- sudo systemctl status vncserver@1
- If it started correctly you should see output like this:
- vncserver@1.service - Start TightVNC server at startup
- Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: enabled)
- Active: active (running) since Wed 2022-05-18 10:23:32 MST; 1h 28min ago
- Process: 880 ExecStartPre=/usr/bin/vncserver -kill :1 > /dev/null 2>&1 (code=exited, status=2)
- Process: 926 ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :1 (code=exited, status=0/SUCCES>
- Main PID: 941 (Xtightvnc)
- Tasks: 152 (limit: 9360)
- Memory: 312.1M
- CGroup: /system.slice/system-vncserver.slice/vn
- ...
- Reboot the machine
- sudo reboot
- Login using TightVNC Viewer
- testlinux01::5901
- scteorste1
Build and start the OA Test Harness
- Check out test harness code from SVN and build the test harness
- Open a terminal
- cd ~
- mkdir ddci_eclipse_test_harness_dev
- cd ddci_eclipse_test_harness_dev
- svn co https://deos.ddci.com/svn/DDCI/products/openarbor/utils/dds-manager/dds-manager-e4/ dds-manager-e4
- cd dds-manager-e4
- make MAVEN_OFFLINE=""
- ./oaTestHarness -n