Skip to content

Latest commit

 

History

History
93 lines (77 loc) · 4.34 KB

File metadata and controls

93 lines (77 loc) · 4.34 KB

Building DAQ

Building DAQ is only required if you are doing active development on DAQ itself (or using head-of branch features); it will require installing more prerequisites that aren't indicated above. In addition to some standard packages, it requires specific versions of mininet and FAUCET that are tied to this specific build (but, you will have to manually update them in the future).

Major Steps

$ bin/clean_dev # Clean up any previous development installs.

$ bin/setup_dev # Setup of basic dev environment dependencies.

$ cmd/build # Build internal docker images.

$ cmd/clean # Clean up docker images that may be lingering.

Sadly, there's no easy way to know when you need to run what when, since they simply address different dependencies. See cmd/build help for more details on different image build options.

Tests, Tests, and More Tests

In a whirlwind of flagrant appropriateness, the baseline for DAQ development is... testing. Specifically, there is a suite of continuous integration tests that run using Github actions that puts the system through a barrage of tests to make sure all is good. Any PR submission will require that these tests pass.

For more information, please see developing docs.

Incremental Builds

The environment variable DAQ_TARGETS is a CSV-field that can be used to only build specific targets. E.g. to just build the ping tests use the short form DAQ_TARGETS=test_ping cmd/build. Using a more sticky exported varaible, for ping and nmap, would look something like:

~/daq$ export DAQ_TARGETS=test_ping,test_nmap
~/daq$ cmd/build
Loading config from local/system.conf...
Enabling target test_ping
Enabling target test_nmap
Including tests from config/modules/host.conf
Including build files from docker
…
Skipping non-enabled daq/test_mudgee
Skipping non-enabled daq/test_pass
Build docker/modules/Dockerfile.test_ping into daq/test_ping, log to build/docker_build.test_ping...
Skipping non-enabled daq/test_brute
Build subset/pentests/Dockerfile.test_nmap into daq/test_nmap, log to build/docker_build.test_nmap...
Skipping non-enabled daq/test_switch
Updating .build_hash
~/daq$

Build Debugging

cmd/run and cmd/build have some internal checks that attempt to make sure the built Docker images are current with the existing filesystem setup. This is only a hint and optimization. If there are consistent messages about the build hash being out of date, and it's not clear why, then the following steps will help clarify what file is changed that is triggering the warning.

~/daq$ cmd/run
Loading config from local/system.conf
Local build hash does not match, or not found.
Please run cmd/build, or if you know what you're doing:
echo ab1a2dac87a9316676db74a16c5927cfd21b9976fcbf9850e42c5e5b7bdba5fe > .build_hash
~/daq$ diff .build_built .build_files
7d6
< 8c7daf2497ad5f35db5fb2ce340b5d47e42a10de  docker/Dockerfile.switch~
29,30d27
< 22b83fb943e92968bb29116c1fc93672c90139f6  misc/discover_config/port-01/ping_runtime.sh~
< 510742d89d5da3a171662597d95caffbb55788e7  misc/discover_config/port-02/monitor_filter.txt~
~/daq$ cmd/build
Loading config from local/system.conf...
Including build files from docker
Including build files from subset/pentests
Build docker/modules/Dockerfile.aardvark into daq/aardvark, log to build/docker_build.aardvark...
Build docker/modules/Dockerfile.default into daq/default, log to build/docker_build.default...
…
Build subset/pentests/Dockerfile.test_brute into daq/test_brute, log to build/docker_build.test_brute...
Build subset/pentests/Dockerfile.test_nmap into daq/test_nmap, log to build/docker_build.test_nmap...
Updating .build_hash
~/daq$ cmd/run
Loading config from local/system.conf
Starting Mon Feb 11 08:40:12 PST 2019

The file .build_built includes the hashes from the last time the system successfully completed a cmd/build run, while .build_files contains the hashes after the most recent cmd/run hash mismatch. The example diff above indicates that some files were deleted from the docker/ and misc/ directories, triggering the rebuild requirement.