Skip to content

Commit

Permalink
Merge pull request #838 from egovernments/rollout-dashbard-indexer
Browse files Browse the repository at this point in the history
Added rollout dashboard cronjob indexer for sending data to indexer
  • Loading branch information
debasishchakraborty-egovt authored Jul 2, 2024
2 parents a34f93f + c83789b commit 37451a4
Show file tree
Hide file tree
Showing 8 changed files with 1,144 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ config:
- work-dir: "utilities/rollout-dashboard-cronjob"
image-name: "rollout-dashboard-cronjob"
dockerfile: "utilities/rollout-dashboard-cronjob/Dockerfile"
- name: "builds/mGramSeva/utilities/rollout-dashboard-cronjob-indexer"
build:
- work-dir: "utilities/rollout-dashboard-cronjob-indexer"
image-name: "rollout-dashboard-cronjob-indexer"
dockerfile: "utilities/rollout-dashboard-cronjob-indexer/Dockerfile"
- name: "builds/mGramSeva/municipal-services/property-services"
build:
- work-dir: "municipal-services/property-services"
Expand Down
11 changes: 11 additions & 0 deletions utilities/rollout-dashboard-cronjob-indexer/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Database Credentials
DB_HOST=test
DB_SCHEMA=test
DB_USER=test
DB_PWD=tesrt
DB_PORT=5432

#mdms call
API_URL= https://localhost:8080/
TENANT_ID=pb
IFIX_DEP_ENTITY_URL= https://localhost:8080/
7 changes: 7 additions & 0 deletions utilities/rollout-dashboard-cronjob-indexer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

All notable changes to this module will be documented in this file.


## 1.0.0 - 2024-07-02
Rollouot Dashboard indexer initial version release
17 changes: 17 additions & 0 deletions utilities/rollout-dashboard-cronjob-indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.9-slim-buster

RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app/cron/
COPY requirements.txt .

RUN python3.9 -m pip install --no-cache-dir --upgrade \
pip \
setuptools \
wheel
RUN python3.9 -m pip install --no-cache-dir \
-r requirements.txt

COPY app.py app.py
15 changes: 15 additions & 0 deletions utilities/rollout-dashboard-cronjob-indexer/LOCALSETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
For local setup:
1. install python version3.
refer link for installing python 3 on linux system--> https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/
2. install pip3
ex. apt install python3-pip
for version check -> pip3 --version
refer link: https://digit-discuss.atlassian.net/wiki/spaces/DD/pages/1865777171/DIGIT+Internal+Datamart+deployment+steps
3. install required libraries like requests, pandas, psycopg2-binary etc. mentiond in requirnments.txt file using pip command.
ex. pip3 install requests
4. To run the application locally, we have to load the variable from the .env file to environment so that script can use to do so run below command (NOTE: this to run locally, when running on the pod these variables will be loaded from help)
``while read LINE; do export "$LINE"; done < ./.env``
4. for running app.py use command
ex. python3 app.py


2 changes: 2 additions & 0 deletions utilities/rollout-dashboard-cronjob-indexer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Written python script collecting for each tenant data from mdms and mgramseva db based on some critria commented in script 'app.py' for each method.
2. Collecting data and dumping data into mgramseva db in 'roll_out_dashboard' table then loading that data into metabase.
Loading

0 comments on commit 37451a4

Please sign in to comment.