To get started with development you will need:
Assuming you have been granted necessary access permissions to the Shared Service Account, please follow the NVVS DevOps best practices provided step-by-step guide to configure your AWS Vault and AWS Cli with AWS SSO.
- Copy
.env.example
to.env
- Modify the
.env
file and provide values for variables as below:
Variables | How? |
---|---|
AWS_PROFILE= |
your AWS-CLI profile name for the Shared Services AWS account. Check this guide if you need help. |
SHARED_SERVICES_ACCOUNT_ID= |
Account ID of the MoJO Shared Services AWS account. |
REGISTRY_URL= |
<MoJO Development AWS Account ID> .dkr.ecr.eu-west-2.amazonaws.com |
ENV= |
Your Terraform namespace from the DNS DHCP Infrastructure repo. |
The Docker base image is stored in ECR. Prior to building the container you must authenticate Docker to the ECR registry. Details can be found here.
If you have aws-vault configured according to NVVS DevOps best practices, do the following to authenticate:
make authenticate-docker
See the target run
in the Makefile
To run the tests locally run
make test
This will first clear out any leases in the local database. perfdhcp
is used to emulate a number of clients and multiple DORA cycles. The number of created leases is checked to ensure the server is operating as expected. The dhcp_test.sh script will exit with a non zero code if the expected number of leases were not created.
-
Run
ifconfig
to find the name for the docker-compose network interface. -
Run
sudo nmap --script broadcast-dhcp-discover -e <NETWORK_INTERFACE>
- The DHCP server should respond with an offer, e.g:
Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-28 14:53 BST Pre-scan script results: | broadcast-dhcp-discover: | Response 1 of 1: | IP Offered: 192.0.2.10 | DHCP Message Type: DHCPOFFER | Subnet Mask: 255.255.255.0 | IP Address Lease Time: 1h06m40s |_ Server Identifier: 172.29.0.4 WARNING: No targets were specified, so 0 hosts scanned. Nmap done: 0 IP addresses (0 hosts up) scanned in 0.53 seconds