Developer Onboarding

Pre-Requisites

Versions

Replace the variables in the code snippets below with the following values:

  • PYTHON_VERSION: 3.9.18

  • NODEJS_VERSION: 16.3.0

  • CDK_VERSION: 2.95.1

Prepare environment

Python <PYTHON_VERSION>

pyenv install --skip-existing $PYTHON_VERSION

NodeJS <NODEJS_VERSION>

nvm install $NODEJS_VERSION
nvm use $NODEJS_VERSION

AWS CDK <CDK_VERSION>

Note: Do NOT install CDK globally using npm -g or yarn global add

Follow the instructions below:

mkdir -p ~/.idea/lib/idea-cdk && pushd ~/.idea/lib/idea-cdk
npm init --force --yes
npm install aws-cdk@$CDK_VERSION --save
popd

If you want to upgrade CDK version for your existing IDEA dev environment, run:

invoke devtool.upgrade-cdk

Docker Desktop (Optional)

Follow instructions on the below link to install Docker Desktop. (Required if you are working with creating Docker Images)

https://docs.docker.com/desktop/mac/install/

Clone Git Repo

All CRs will be accepted only against the main branch.

git clone https://github.com/awslabs/integrated-digital-engineering-on-aws.git
cd integrated-digital-engineering-on-awsb
// make your changes

Virtual Environment

Activate your python virtual environment via:

PYENV_VERSION=$PYTHON_VERSION python -m venv venv
source venv/bin/activate

If your PYENV_VERSION command is not working for any reason, you can create venv using below command:

$HOME/.pyenv/versions/$PYTHON_VERSION/bin/python3 -m venv venv

Install Dev Requirements

pip install -r requirements/dev.txt
Note for MacOS users

BigSur Note: cryptography and orjson library requirements fail to install on MacOS BigSur.

To fix cryptography, follow the instructions mentioned here: https://stackoverflow.com/questions/64919326/pip-error-installing-cryptography-on-big-sur

env LDFLAGS="-L$(brew --prefix [email protected])/lib" CFLAGS="-I$(brew --prefix [email protected])/include" pip install cryptography==36.0.1

To fix orjson, run:

brew install rust
# Upgrade your pip
python3 -m pip install --upgrade pip

Verify Dev Setup

Run below command to check if development environment is working as expected, run:

invoke -l

Running this command should print output like below:

Clean, Build and Package

invoke clean build package

Run idea-admin.sh in Developer Mode

The IDEA_DEV_MODE environment variable is used to indicate if idea-admin.sh should use the Docker Image or Run from sources.

  • If IDEA_DEV_MODE=true, idea-admin.sh will execute administrator app directly using sources.

  • If IDEA_DEV_MODE=false (default), idea-admin.sh will attempt to download the docker image for the latest release version and execute administrator app using Docker Container.

Export IDEA_DEV_MODE=true on your terminal, before executing idea-admin.sh on from project root.

# Enable Dev Mode
export IDEA_DEV_MODE=true

You will need to run export IDEA_DEV_MODE=true, each time you open a new Terminal session.

Verify if Developer Mode is enabled

To verify, if Developer Mode is enabled, run below command. This should print (Developer Mode) at the end of the banner.

Last updated