- Install python
>=
3.11 - Install docker
- Install Kubectl
- Install AWS CLI
- Intall K9s
- Install act
- Vscode or any IDE of choice
- First and formost if you don't have a aws credentials create one
- Create a root user
- Create an IAM user
- Login as an IAM user
- Create the access_key and
- Add a programmatical access key token and align it with required permissions
- Permission required: AWS ECR related permission (assuming that a permission group is created and then that permission is assigned to the IAM user). Check the created credentials are working as expected and add the credentials created to aws cli by using. Reference
aws configure
- Permission required: AWS ECR related permission (assuming that a permission group is created and then that permission is assigned to the IAM user). Check the created credentials are working as expected and add the credentials created to aws cli by using. Reference
- Navigate to IAM console and select the created IAM and create a role called eksClusterRole. link
- Install pip - reference
python -m ensurepip --upgrade
- Install pipenv - reference
pip install pipenv
- Install all the requirements (assuming that requirements.txt is in project root directory)
pipenv install -r requirements.txt
- Add the below sensitive information to github secrets > actions > new repository secret
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- EKS_CLUSTER_ROLE
- EKS_NODE_ROLE
- Build the docker image
docker build . -t flask/cloud-native-monitoring:latest
- Use the docker compose to start running the container
docker compose up -OR- docker compose up --build
- Run without docker
for the above command, if there is a requirement of debug, then appending debug would suffice in each
python manage.py run -h <host_address> -p <port_number> -OR- python manage.py run -OR- python manage.py run -OR- gunicorn app:create_app() -b <host_address:port_number> -w <number_of_workers> --worker-class gevent --timeout <max_time_before_worker_reset> --max-requests <maximum_number_of_requests>
- Create a file called .secrets in the root directory to mimic the github secrets and store all the secrets
AWS_ACCESS_KEY_ID=<iam_key_id> AWS_SECRET_ACCESS_KEY=<iam_secret_access_key> EKS_CLUSTER_ROLE=<cluster_role_name> EKS_NODE_ROLE=<node_role_name>
- Once secret file is ready, then you are good to with the execution of the github workflow file locally
act --secret-file <relative_path_to_.secrets_file>