-
Notifications
You must be signed in to change notification settings - Fork 37
HCMPRE-2709: Integrate Geopode with Boundary Service #1583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
abishekTa-egov
wants to merge
37
commits into
geopode-adapter-dev
Choose a base branch
from
HCMPRE-2709-modified
base: geopode-adapter-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
97ed08e
Creating geopode-adapter service
tanishi-egov 1756afe
Creating geopode-adapter service - Hierarchy setup
tanishi-egov e466dc6
Boundary fetch
abishekTa-egov 0349a20
Arcgis endpoint and mdms request
abishekTa-egov 29dd8ee
Resolving comments
abishekTa-egov b537778
Resolving comments
abishekTa-egov a54b2a2
Resolving comments changes
abishekTa-egov 2b78f85
Creating ChildBoundaryCreationUtil
abishekTa-egov 67629de
Working ChildBoundaryCreationUtil with logs
abishekTa-egov a820400
Response of createRoot with logs
abishekTa-egov e615915
Removing logs
abishekTa-egov 6ff6999
Making from local to unified-dev
abishekTa-egov b3e4a86
Build-config for geopode
abishekTa-egov fff7160
arcgis endpoint being made into two
abishekTa-egov f6bab09
Chnaging context path
abishekTa-egov 280d263
Validation change
abishekTa-egov 5680190
Logging number of children
abishekTa-egov e51c50e
Resolving comments
abishekTa-egov 998eb68
Adding comments for method createChildrenAsync
abishekTa-egov c0a9f44
Adding comments for method createChildrenAsync
abishekTa-egov ca9a676
Logging statements
abishekTa-egov cdd6799
Duplicate countries not being allowed in same HierarchyType
abishekTa-egov 9f57dcc
Adding @Autowired
abishekTa-egov a3b33df
Formatting and Adding Service constants for Arcgis Search
abishekTa-egov 44a6264
Removing searchBoundaryHierarchyDefinition from GeopodeAdapterService
abishekTa-egov b8be666
Moving SearchBoundary to ArcgisUtil
abishekTa-egov 4581683
Removing unnecessary properties in application.properties
abishekTa-egov f4269ed
BoundaryResponse and function to mdmsUtil
abishekTa-egov 870d1e9
Moving functions to MdmsUtil for extractCountryNameFromMDms
abishekTa-egov efda0c7
Adding changes for Multi-Architecture Docker Images
RajeswariGangula-egov 2d0915b
Merge pull request #1638 from RajeswariGangula-egov/MULTI-ARCH-GEOPODE
Priyanka-eGov 0283163
Formatting changes
abishekTa-egov 9c61dfd
Formatting, removing unneccesary api paths and adding error constants
abishekTa-egov d07eb57
Merge branch 'HCMPRE-2709-modified' of github.com:egovernments/health…
abishekTa-egov 3df9d49
tenantId coming from user not ServiceConstants
abishekTa-egov 5fe1cee
Adding List of List of dataStructure and adding Object for parentList…
abishekTa-egov 8d1edb3
Removing generated date
abishekTa-egov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,223 @@ | ||
| name: Build Pipeline | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| service_folder: | ||
| description: 'Folder prefix for the service' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - core-services | ||
| - health-services | ||
| default: core-services | ||
| service: | ||
| description: 'Name of the service to build and deploy' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - "mdms-v2" | ||
| - "audit-service" | ||
| - "boundary-service" | ||
| - "build" | ||
| - "chatbot" | ||
| - "docs" | ||
| - "egov-accesscontrol" | ||
| - "egov-common-masters" | ||
| - "egov-data-uploader" | ||
| - "egov-document-uploader" | ||
| - "egov-enc-service" | ||
| - "egov-filestore" | ||
| - "egov-idgen" | ||
| - "egov-indexer" | ||
| - "egov-localization" | ||
| - "egov-location" | ||
| - "egov-mdms-service" | ||
| - "egov-notification-mail" | ||
| - "egov-notification-sms" | ||
| - "egov-otp" | ||
| - "egov-persister" | ||
| - "egov-pg-service" | ||
| - "egov-searcher" | ||
| - "egov-telemetry" | ||
| - "egov-url-shortening" | ||
| - "egov-user-event" | ||
| - "egov-user" | ||
| - "egov-workflow-v2" | ||
| - "gateway" | ||
| - "internal-gateway-scg" | ||
| - "internal-gateway" | ||
| - "libraries" | ||
| - "national-dashboard-ingest" | ||
| - "national-dashboard-kafka-pipeline" | ||
| - "nlp-engine" | ||
| - "pdf-service" | ||
| - "report" | ||
| - "service-request" | ||
| - "tenant" | ||
| - "user-otp" | ||
| - "xstate-chatbot" | ||
| - "zuul" | ||
| - "geopode-adapter" | ||
| default: "audit-service" | ||
|
|
||
| env: | ||
| DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }} | ||
| DOCKER_PASSWORD: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| service: [ "${{ github.event.inputs.service }}" ] | ||
|
|
||
| outputs: | ||
| docker_image: ${{ steps.save_docker_image.outputs.docker_image }} | ||
| db_image: ${{ steps.save_db_image.outputs.db_image }} | ||
|
|
||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install yq | ||
| run: | | ||
| VERSION="4.30.8" | ||
| URL="https://github.com/mikefarah/yq/releases/download/v${VERSION}/yq_linux_amd64" | ||
| sudo curl -sSL "$URL" -o /usr/local/bin/yq | ||
| sudo chmod +x /usr/local/bin/yq | ||
|
|
||
| - name: Determine Dockerfile path from build-config.yml | ||
| id: pick_dockerfile | ||
| run: | | ||
| SERVICE="${{ matrix.service }}" | ||
| DEFAULT_DOCKERFILE="build/maven/Dockerfile" | ||
|
|
||
| # Debug: list all image-name / dockerfile pairs | ||
| echo "All build entries from build-config.yml:" | ||
| yq eval '.config[].build[] | "✱ image-name: \(.["image-name"]) → dockerfile: \(.dockerfile // "N/A")"' build/build-config.yml || true | ||
|
|
||
| # Try matching with the SERVICE variable directly (no strenv) | ||
| DF=$(yq eval ".config[].build[] | select(.\"image-name\" == \"${SERVICE}\") | .dockerfile // \"\"" build/build-config.yml) | ||
|
|
||
| if [ -z "$DF" ] || [ "$DF" = "null" ]; then | ||
| echo "No dockerfile entry found for \"$SERVICE\" in build-config.yml; using default" | ||
| DF="$DEFAULT_DOCKERFILE" | ||
| else | ||
| echo "Found dockerfile \"$DF\" for service \"$SERVICE\"." | ||
| fi | ||
|
|
||
| echo "dockerfile_path=$DF" >> "$GITHUB_OUTPUT" | ||
| echo "DOCKERFILE_PATH=$DF" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
|
|
||
| - name: Cache Docker Layers | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: /tmp/.buildx-cache | ||
| key: ${{ runner.os }}-buildx-${{ matrix.service }}-${{ github.ref_name }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-buildx- | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| username: ${{ env.DOCKER_USERNAME }} | ||
| password: ${{ env.DOCKER_PASSWORD }} | ||
|
|
||
| - name: Generate the Next Tag | ||
| id: tag | ||
| run: | | ||
| set -euxo pipefail | ||
|
|
||
| BRANCH="${GITHUB_REF##*/}" | ||
| COMMIT_HASH=$(git rev-parse --short HEAD) | ||
| SERVICE_NAME="${{ matrix.service }}" | ||
|
|
||
| TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/users/login/" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "{\"username\": \"$DOCKER_USERNAME\", \"password\": \"$DOCKER_PASSWORD\"}" \ | ||
| | jq -r .token) | ||
|
|
||
| if [ -z "$TOKEN" ]; then | ||
| echo "Failed to authenticate with Docker Hub." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| REPO_CHECK=$(curl -s -o /dev/null -w '%{http_code}' \ | ||
| -H "Authorization: JWT $TOKEN" \ | ||
| "https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/$SERVICE_NAME/") | ||
|
|
||
| if [ "$REPO_CHECK" -ne 200 ]; then | ||
| NEXT_TAG="${BRANCH}-${COMMIT_HASH}" | ||
| else | ||
| EXISTING_TAGS=$(curl -s -H "Authorization: JWT $TOKEN" \ | ||
| "https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/$SERVICE_NAME/tags?page_size=100" \ | ||
| | jq -r '.results[].name') | ||
| LATEST_TAG=$(echo "$EXISTING_TAGS" | grep "^${BRANCH}-${COMMIT_HASH}" || true | sort -V | tail -n 1) | ||
| NEXT_TAG="${LATEST_TAG:-${BRANCH}-${COMMIT_HASH}}" | ||
| fi | ||
|
|
||
| echo "tag=$NEXT_TAG" >> "$GITHUB_OUTPUT" | ||
| echo "NEXT_TAG=$NEXT_TAG" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Build and Push Application Docker Image | ||
| id: build_push_docker | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| platforms: linux/amd64,linux/arm64 | ||
| context: . | ||
| file: ${{ env.DOCKERFILE_PATH }} | ||
| push: true | ||
| tags: | | ||
| egovio/${{ matrix.service }}:${{ steps.tag.outputs.tag }} | ||
| build-args: | | ||
| WORK_DIR=${{ github.event.inputs.service_folder }}/${{ matrix.service }} | ||
|
|
||
| - name: Check if DB folder exists | ||
| id: check-db-folder | ||
| run: | | ||
| FOLDER_PATH="${{ github.event.inputs.service_folder }}/${{ matrix.service }}/src/main/resources/db" | ||
| if [ -d "$FOLDER_PATH" ]; then | ||
| echo "folder_exists=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "folder_exists=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Build and Push Database Docker Image | ||
| if: ${{ steps.check-db-folder.outputs.folder_exists == 'true' }} | ||
| id: build_push_db_docker | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| platforms: linux/amd64,linux/arm64 | ||
| context: ${{ github.event.inputs.service_folder }}/${{ matrix.service }}/src/main/resources/db | ||
| file: ${{ github.event.inputs.service_folder }}/${{ matrix.service }}/src/main/resources/db/Dockerfile | ||
| push: true | ||
| tags: | | ||
| egovio/${{ matrix.service }}-db:${{ steps.tag.outputs.tag }} | ||
|
|
||
| - name: Save Application Docker Image | ||
| id: save_docker_image | ||
| run: | | ||
| IMG="egovio/${{ matrix.service }}:${{ steps.tag.outputs.tag }}" | ||
| echo "$IMG" | ||
| echo "docker_image=$IMG" >> "$GITHUB_OUTPUT" | ||
|
|
||
| # Append to GitHub Actions summary | ||
| echo "### Application Docker Image" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "$IMG" >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Save Database Docker Image | ||
| id: save_db_image | ||
| if: ${{ steps.check-db-folder.outputs.folder_exists == 'true' }} | ||
| run: | | ||
| IMG="egovio/${{ matrix.service }}-db:${{ steps.tag.outputs.tag }}" | ||
| echo "$IMG" | ||
| echo "db_image=$IMG" >> "$GITHUB_OUTPUT" | ||
|
|
||
| # Append to GitHub Actions summary | ||
| echo "### Database Docker Image" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "$IMG" >> "$GITHUB_STEP_SUMMARY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,27 @@ | ||
|
|
||
| FROM egovio/amazoncorretto:17-alpine3.19 AS build | ||
| # FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build | ||
| #FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build | ||
| FROM maven:3.9.6-amazoncorretto-17 AS build | ||
| ARG WORK_DIR | ||
| WORKDIR /app | ||
|
|
||
| # Install Maven | ||
| RUN apk add --no-cache maven | ||
|
|
||
| # copy the project files | ||
| # Copy project files | ||
| COPY ${WORK_DIR}/pom.xml ./pom.xml | ||
| COPY build/maven/start.sh ./start.sh | ||
|
|
||
| # not useful for stateless builds | ||
| # RUN mvn -B dependency:go-offline | ||
|
|
||
| COPY ${WORK_DIR}/src ./src | ||
| RUN mvn -B -f /app/pom.xml package | ||
|
|
||
|
|
||
| # Create runtime image | ||
| #FROM egovio/8-openjdk-alpine | ||
| #FROM ghcr.io/egovernments/8-openjdk-alpine:latest | ||
| FROM egovio/amazoncorretto:17-alpine3.19 | ||
| # Build the project | ||
| RUN mvn -B -f /app/pom.xml package | ||
|
|
||
| # Runtime image – using a multi-arch base image | ||
| FROM amazoncorretto:17-alpine | ||
|
|
||
| WORKDIR /opt/egov | ||
|
|
||
| # Copy artifacts from the build stage | ||
| COPY --from=build /app/target/*.jar /app/start.sh /opt/egov/ | ||
|
|
||
| RUN chmod +x /opt/egov/start.sh | ||
| # Ensure the start script has correct line endings and is executable | ||
| RUN dos2unix /opt/egov/start.sh && chmod +x /opt/egov/start.sh | ||
|
|
||
| # Verify architecture inside the container | ||
| RUN uname -m | ||
|
|
||
| CMD ["/opt/egov/start.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,26 @@ | ||
|
|
||
| FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build | ||
| #FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build | ||
| # ──────────────── BUILD STAGE ──────────────── | ||
| FROM maven:3.9.6-amazoncorretto-8-debian AS build | ||
| ARG WORK_DIR | ||
| WORKDIR /app | ||
|
|
||
| # copy the project files | ||
| COPY ${WORK_DIR}/pom.xml ./pom.xml | ||
| COPY build/maven/start.sh ./start.sh | ||
|
|
||
| # not useful for stateless builds | ||
| # RUN mvn -B dependency:go-offline | ||
|
|
||
| COPY ${WORK_DIR}/src ./src | ||
| RUN mvn -B -f /app/pom.xml package | ||
|
|
||
| # Copy POM, entrypoint script, and source | ||
| COPY ${WORK_DIR}/pom.xml ./pom.xml | ||
| COPY build/maven-java8/start.sh ./start.sh | ||
| COPY ${WORK_DIR}/src ./src | ||
|
|
||
| # Create runtime image | ||
| FROM egovio/8-openjdk-alpine | ||
| #FROM ghcr.io/egovernments/8-openjdk-alpine:latest | ||
| # Build the app (skip tests for speed) | ||
| RUN mvn -B -f pom.xml package -DskipTests | ||
|
|
||
|
|
||
| # ─────────────── RUNTIME STAGE ─────────────── | ||
| FROM openjdk:8-jdk-alpine AS runtime | ||
| WORKDIR /opt/egov | ||
|
|
||
| COPY --from=build /app/target/*.jar /app/start.sh /opt/egov/ | ||
| # Pull in the fat JAR and our startup script | ||
| COPY --from=build /app/target/*.jar ./application.jar | ||
| COPY --from=build /app/start.sh ./start.sh | ||
|
|
||
| RUN chmod +x /opt/egov/start.sh | ||
| RUN chmod +x ./start.sh | ||
|
|
||
| CMD ["/opt/egov/start.sh"] | ||
| # Override any Alpine tini entrypoint and launch via shell | ||
| ENTRYPOINT ["sh", "./start.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Swagger generated server | ||
|
|
||
| Spring Boot Server | ||
|
|
||
| ## Overview | ||
| This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. | ||
| By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub. | ||
| This is an example of building a swagger-enabled server in Java using the SpringBoot framework. | ||
|
|
||
| The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox) | ||
|
|
||
| Start your server as a simple java application | ||
|
|
||
| You can view the api documentation in swagger-ui by pointing to | ||
| http://localhost:8080/ | ||
abishekTa-egov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Change default port value in application.properties | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.