Development Environment Setup
Browser Bookmarks
See Developer Bookmarks for a set of helpful links that you may import into your browser.
Homebrew
Homebrew is a package manager for installing many of the tools you will need. Install Homebrew from https://brew.sh/
git
Install from https://git-scm.com/download/mac
Update your git config with your real name and work email:
git config --global user.name "<NAME>"
git config --global user.email "<NAME>@apothesource.com"
git config --global core.trustctime false
SDKMan
To make it easier to manage your development environment, it is recommended that you install SDKMan, the Software Development Kit Manager. Execute the following to install SDKMan:
curl -s "https://get.sdkman.io" | bash
Follow the instructions in the terminal output to source your shell configuration after installation.
Java
NGSS projects use Java 21 and Java 17. Install using SDKMan.
sdk install java
This will install Java 21 (currently 21.0.6-tem) and set it as default.
To install another java version, use its identifier. For example, to install the previous Java 21 version:
sdk install java 21.0.5-tem
Install Java 17 in the same way:
sdk install java 17.0.13-tem
You will be prompted whether you want these versions to be the default during installation. To see which java versions are installed and available:
sdk list java
The current default version will be denoted with ` >>>` next to its version number. If you want to change which version of Java your system is using:
sdk default java <identifier>
Alternatively, if you just want to update which version of Java your current shell is using:
sdk use java <identifier>
Enable Auto-Switching of JDK Versions
In order to allow SDKMan to auto-switch to a service’s configured JDK (found in the service’s .sdkmanrc file), set the following in ~/.sdkman/etc/config:
sdkman_auto_env=true
For information about other configuration options, go to https://sdkman.io/.
Maven
Install using SDKMan.
sdk install maven
Check your install for any errors using
mvn --version
The default installed version should work fine, but if you have any issues, you can use the steps above to list other available versions and set as your default. Since Maven is installed with SDKMan, the version of Java used by Maven should match the configured default or shell JDK.
Gradle
Install using SDKMan.
sdk install gradle
The default installed version should work fine, but if you have any issues, you can use the steps above to list other available versions and set as your default.
Skaffold/Kustomize
Install Skaffold and Kustomize, set up your environment according to the documentation:
Optionally but highly recommended, install the Gemini Code Assist/Cloud Code (formally Google Cloud Code) for IntelliJ:
Orbstack
Orbstack is our preferred container runtime for development.
Follow the migration guide instructions to install and configure it for your environment.
|
To obtain an Orbstack license:
|
Docker Desktop
Alternately, you can use Docker Desktop for your container runtime. Download and install the community edition from Docker.
If you have an Apple Silicon Mac, make sure to enable Apple Virtualization framework under General→Virtual Machine Options, and turn on Use Rosetta for x86/amd64 emulation on Apple Silicon (Docker v4.16.1 and up).
K8s Monitoring Tools
Use Brew to install Headlamp, an easy-to-use tool for monitoring your kubernetes cluster, deployments, pod logs, etc.
brew install --cask --no-quarantine headlamp
There are also links to other monitoring tool options found on the K8s Monitoring Tools page.
IntelliJ
Most developers use IntelliJ as their preferred IDE. Download IntelliJ Ultimate here. You can obtain a license key from Amy Calvert.
Open a Project
This should be done after you can Build a Java service.
After you can successfully build, open IntelliJ and go to File → Open → select location-service/pom.xml and then select "Open as Project".
| See Skaffold Debugging with IntelliJ for tips on debugging Skaffold services and connecting to local databases with IntelliJ. |
PlantUML Integration
We use PlantUML and the PlantUML IntelliJ plugin for generating diagrams from .puml files. To setup this integration:
-
Install PlantUML. From a terminal, execute
brew install plantuml. -
Install the PlantUML Integration plugin. In IntelliJ, go to IntelliJ → Settings → Plugins → search for "PlantUML", and install the PlantUML Integration plugin.
-
Configure the PlantUML plugin. In IntelliJ, go to IntelliJ → Settings → Languages and Frameworks → PlantUML. In the
Graphviz dot executablefield, enter/opt/homebrew/bin/dotand select OK. Restart IntelliJ for this to take effect.
Postman
Postman is a tool for sending and testing API requests. Download and install it here.
Other Tools
A list of other useful development tools can be found here.
Adjust Settings
Add Credentials To Container Registry
Run the steps below in the terminal to add your credentials using OSX Keychain to ~/.docker/config.json.
docker login dtr.mapsandbox.net
Username: <YOUR DTR_USER>
Password: <YOUR DTR_PWD>
Login Succeeded
Docker Desktop Settings
If using Docker Desktop, make the following updates:
-
In Docker Settings→Kubernetes:
-
Enable Kubernetes
-
-
In Docker Settings→Resources:
-
set CPU to 8
-
set Memory to at least 20GB on 32GB systems (recommend 32GB on 64GB systems)
-
set Swap to 4GB
-
set Disk image size to at least 128GB
-