Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
62ee888
feat: implement trade document processing with Kafka messaging and F&…
ssd2658 Jun 24, 2025
75c59f0
feat: implement trade processing system with F&O support
ssd2658 Jun 24, 2025
016c66c
feat: implement trade model and lot size configuration for F&O trades
ssd2658 Jun 24, 2025
2c856c2
Added user and portfolio id passed in apis
ssd2658 Jul 2, 2025
b39ff19
Merge pull request #3 from AM-Portfolio/feature/trade-document-proces…
ssd2658 Aug 19, 2025
1b59610
added: build unified manual
Priyanshukpd Aug 20, 2025
1744247
fix errror& dockerfile
Priyanshukpd Aug 20, 2025
9fda843
fix helm
Priyanshukpd Aug 20, 2025
4a3dfe8
Merge branch 'main' of https://github.com/AM-Portfolio/am-document-pr…
ssd2658 Aug 21, 2025
348a867
chore: update Maven repository configuration to use separate GitHub p…
ssd2658 Aug 21, 2025
a70ef8f
chore: bump AM Common dependencies to 1.2.8-SNAPSHOT and add data ser…
ssd2658 Aug 21, 2025
07dd962
refactor: update Dockerfile to use Maven settings file and simplify p…
ssd2658 Aug 21, 2025
c4c75e5
refactor: move GitHub credentials setup before Maven settings in Dock…
ssd2658 Aug 21, 2025
5f3e207
refactor: improve Dockerfile structure with better organization and d…
ssd2658 Aug 21, 2025
a94b776
feat: optimize Docker build with multi-stage dependencies and paralle…
ssd2658 Aug 21, 2025
8d288fb
ci: add Docker build workflow with multi-arch support and GitHub Cont…
ssd2658 Aug 21, 2025
1024b92
ci: implement Docker build pipeline with multi-arch support and unifi…
ssd2658 Aug 21, 2025
6bf8d72
feat: add TradeService interface for processing trade file documents
ssd2658 Aug 21, 2025
581710e
feat: add Helm ingress configuration and preprod values for document …
ssd2658 Aug 21, 2025
908afff
feat: add Helm configuration for document processor with ingress and …
ssd2658 Aug 21, 2025
6b8e802
Create manual-develoment.yml
ssd2658 Aug 21, 2025
e4cf0f2
feat: add Kubernetes deployment configuration with Vault integration …
ssd2658 Aug 21, 2025
b0da0ed
feat: add Kubernetes deployment configuration with Vault integration …
ssd2658 Aug 21, 2025
8876036
config: add application.yml with database, Kafka and logging configur…
ssd2658 Aug 21, 2025
60b6d3f
feat: configure application properties for document processor service…
ssd2658 Aug 21, 2025
c1182b5
Update application.yml
ssd2658 Aug 21, 2025
0452c78
feat: add Kafka configuration with SASL authentication and topic setup
ssd2658 Aug 21, 2025
eb97d10
Merge branch 'feature/github-workflow' of https://github.com/AM-Portf…
ssd2658 Aug 21, 2025
6f55524
feat: implement Kafka configuration with SASL authentication and topi…
ssd2658 Aug 21, 2025
d88b01e
Merge pull request #4 from AM-Portfolio/feature/github-workflow
ssd2658 Aug 21, 2025
d698458
feat: update Kafka configuration with additional parameters and envir…
Priyanshukpd Aug 23, 2025
330734b
feat: update Kafka bootstrap server configuration to use the developm…
Priyanshukpd Aug 23, 2025
f9ae104
feat: update Kafka SASL JAAS configuration and add management actuato…
Priyanshukpd Aug 23, 2025
05e3328
fix: correct Kafka SASL JAAS configuration username and password
Priyanshukpd Aug 23, 2025
6a15608
feat: add MongoDB secret injection for database connection details
Priyanshukpd Aug 23, 2025
04f69c3
fix: update MongoDB URI for persistence configuration
Priyanshukpd Aug 23, 2025
3208bde
fix: update MongoDB URI and database name for persistence configuration
Priyanshukpd Aug 23, 2025
deffa8a
fix: update MongoDB URI and database name for persistence configuration
Priyanshukpd Aug 23, 2025
2ae51bc
feat: initialize document processor application with MongoDB and Kafk…
ssd2658 Aug 23, 2025
288fc0c
feat: create Spring Boot document processing application with compone…
ssd2658 Aug 23, 2025
a4f3fd9
feat: add Kubernetes deployment config and application properties for…
ssd2658 Aug 23, 2025
9b2bfc2
feat: add Kubernetes deployment config and application properties for…
ssd2658 Aug 23, 2025
a8bd195
feat: create document processor app with MongoDB support and remove S…
ssd2658 Aug 23, 2025
67e85cc
Merge pull request #6 from AM-Portfolio/feature/github-workflow
ssd2658 Aug 23, 2025
4214f7e
feat: remove postgress existance and used security serivce with mongo
ssd2658 Aug 24, 2025
769dbd6
feat: add Kubernetes ingress and service templates for document proce…
ssd2658 Aug 27, 2025
3364597
Merge pull request #8 from AM-Portfolio/feature/remove-postgress-sql
ssd2658 Aug 27, 2025
f64f7d4
comment ingress as it is removed and apache apisix work in progress
ssd2658 Aug 27, 2025
fd61a2d
No changes detected to summarize in commit message.
ssd2658 Aug 27, 2025
9649fe7
feat: update docker-compose and configuration for MongoDB and Kafka i…
ssd2658 Sep 20, 2025
9e03815
fix: update port configurations and environment variables for documen…
ssd2658 Sep 20, 2025
da281df
fix: update Kafka bootstrap server port and application server port; …
ssd2658 Sep 20, 2025
b09c345
fix: update application and Docker configurations to use port 8080 fo…
ssd2658 Sep 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MONGODB_URL = mongodb://ssd2658:ssd2658@host.docker.internal:27017/portfolio?authSource=admin

# Kafka
KAFKA_BOOTSTRAP_SERVERS = host.docker.internal:9093
KAFKA_SECURITY_PROTOCOL = PLAINTEXT
KAFKA_SASL_MECHANISM = PLAIN
KAFKA_SASL_JAAS_CONFIG = #org.apache.kafka.common.security.plain.PlainLoginModule required username="kafkaUser" password="kafkaPassword123!";

AM_DOCUMENT_PROCESSOR_MAX_RETRIES = 15
105 changes: 105 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Docker Build and Push

on:
push:
branches:
- 'main'
- 'develop'
- 'feature/**'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/am-document-processor

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
security-events: write

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

# Copy settings.xml from repo
- name: Setup Maven settings.xml
run: |
mkdir -p ~/.m2
cp settings.xml ~/.m2/settings.xml

# Build with Maven and cache dependencies
- name: Build with Maven
run: mvn clean package -DskipTests
env:
GITHUB_PACKAGES_USERNAME: ${{ github.actor }}
GITHUB_PACKAGES_TOKEN: ${{ github.token }}

# Verify the build output exists
- name: Verify build output
run: |
echo "Maven build output:"
ls -la target/

# Set up Docker Buildx for multi-architecture builds
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=v${{ github.run_id }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=develop,enable=${{ github.ref == 'refs/heads/develop' }}
type=ref,event=branch,prefix=feature-,enable=${{ startsWith(github.ref, 'refs/heads/feature/') }}

# Build and push Docker image using the pre-built JAR
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Save image tag to artifact
run: |
echo "v${{ github.run_id }}" > image-tag.txt

- name: Upload image tag as artifact
uses: actions/upload-artifact@v4
with:
name: image-tag
path: image-tag.txt
retention-days: 1

# Trigger deployment workflow
deploy:
needs: build-and-push
permissions:
contents: read
id-token: write
uses: ./.github/workflows/unified-deployment.yml
with:
image_tag: v${{ github.run_id }}
secrets: inherit
119 changes: 119 additions & 0 deletions .github/workflows/manual-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Manual AKS Deployment

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'preprod'
type: choice
options:
- preprod
- prod
- feature/*
image_tag:
description: 'Docker image tag to deploy'
required: true
type: string


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/am-document-processor
HELM_CHART_PATH: ./helm/am-document-processor

jobs:
deploy:
name: Deploy to AKS
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
# Checkout repository
# Checkout repository at the specified ref
- name: Checkout repository
uses: actions/checkout@v4

# Set environment-specific variables
- name: Set environment variables
id: set-vars
run: |
# Set environment-specific variables
if [[ "${{ github.event.inputs.environment }}" == "prod" ]]; then
echo "RESOURCE_GROUP=am-investing" >> $GITHUB_ENV
echo "CLUSTER_NAME=am-np-west" >> $GITHUB_ENV
echo "NAMESPACE=dev" >> $GITHUB_ENV
echo "Deploying to PRODUCTION environment"
elif [[ "${{ github.event.inputs.environment }}" == "feature" ]]; then
echo "RESOURCE_GROUP=am-investing" >> $GITHUB_ENV
echo "CLUSTER_NAME=am-np-west" >> $GITHUB_ENV
echo "NAMESPACE=dev" >> $GITHUB_ENV
echo "Deploying to FEATURE environment"
else
echo "RESOURCE_GROUP=am-investing" >> $GITHUB_ENV
echo "CLUSTER_NAME=am-np-west" >> $GITHUB_ENV
echo "NAMESPACE=dev" >> $GITHUB_ENV
echo "Deploying to PRE-PRODUCTION environment"
fi

# Set image tag from input
echo "IMAGE_TAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV

# Login to Azure
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

# Set AKS context
- name: Set AKS context
uses: azure/aks-set-context@v3
with:
resource-group: ${{ env.RESOURCE_GROUP }}
cluster-name: ${{ env.CLUSTER_NAME }}

# Setup Helm
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: 'v3.12.3'

# Deploy to AKS using Helm
- name: Deploy to AKS
run: |
# Create namespace if it doesn't exist
kubectl create namespace ${{ env.NAMESPACE }} --dry-run=client -o yaml | kubectl apply -f -

echo "Deploying image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}"
echo "Environment: ${{ github.event.inputs.environment }}"
echo "Resource Group: ${{ env.RESOURCE_GROUP }}"
echo "Cluster: ${{ env.CLUSTER_NAME }}"
echo "Namespace: ${{ env.NAMESPACE }}"

# Set values file based on environment
if [[ "${{ github.event.inputs.environment }}" == "feature" ]]; then
# For feature branches, use preprod values as base
VALUES_FILE="${{ env.HELM_CHART_PATH }}/values/preprod.yaml"
else
# For standard environments, use the corresponding values file
VALUES_FILE="${{ env.HELM_CHART_PATH }}/values/${{ github.event.inputs.environment }}.yaml"
fi

# Deploy using Helm with the appropriate values file
helm upgrade --install am-document-processor ${{ env.HELM_CHART_PATH }} \
--namespace ${{ env.NAMESPACE }} \
-f $VALUES_FILE \
--set image.repository=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} \
--set image.tag=${{ env.IMAGE_TAG }} \
--set deployment.version="${{ env.IMAGE_TAG }}" \
--wait --timeout 5m

# Verify deployment
- name: Verify deployment
run: |
kubectl rollout status deployment/am-document-processor -n ${{ env.NAMESPACE }}
echo "Deployment to ${{ github.event.inputs.environment }} completed successfully!"
echo "Deployment to ${{ github.event.inputs.environment }} completed successfully!"
136 changes: 136 additions & 0 deletions .github/workflows/unified-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Deployment

on:
# Manual deployment with environment selection
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'preprod'
type: choice
options:
- preprod
- prod
image_tag:
description: 'Docker image tag to deploy (leave empty for latest build)'
required: false
type: string

# Called by docker-build workflow
workflow_call:
inputs:
image_tag:
description: 'Docker image tag to deploy'
required: true
type: string

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/am-document-processor
HELM_CHART_PATH: ./helm/am-document-processor
IMAGE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || inputs.image_tag }}

jobs:
# Deploy to the selected environment
deploy:
environment: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.environment || 'preprod' }}
name: Deploy to Environment
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

env:
# Set environment based on workflow_dispatch input or default to preprod for workflow_call
ENVIRONMENT: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.environment || 'preprod' }}

steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v4

# Set environment-specific variables
- name: Set environment variables
id: set-vars
run: |
# Set environment-specific variables
if [[ "${{ env.ENVIRONMENT }}" == "prod" ]]; then
echo "RESOURCE_GROUP=am-investing" >> $GITHUB_ENV
echo "CLUSTER_NAME=am-np-west" >> $GITHUB_ENV
echo "NAMESPACE=dev" >> $GITHUB_ENV
echo "Deploying to PRODUCTION environment"
else
echo "RESOURCE_GROUP=am-investing" >> $GITHUB_ENV
echo "CLUSTER_NAME=am-np-west" >> $GITHUB_ENV
echo "NAMESPACE=dev" >> $GITHUB_ENV
echo "Deploying to PRE-PRODUCTION environment"
fi

# Set image tag from input
echo "IMAGE_TAG=${{ env.IMAGE_TAG }}" >> $GITHUB_ENV

# Login to Azure
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

# Set AKS context
- name: Set AKS context
uses: azure/aks-set-context@v3
with:
resource-group: ${{ env.RESOURCE_GROUP }}
cluster-name: ${{ env.CLUSTER_NAME }}

# Setup Helm
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: '3.12.3' # Removed 'v' prefix for stability

# Check and remove Helm locks if any exist
- name: Check and remove Helm locks
run: |
# Check if there's a release with pending operations
if kubectl get secret -n ${{ env.NAMESPACE }} | grep -q "sh.helm.release.v1.am-document-processor"; then
echo "Found existing Helm release, checking for locks..."
# Get all Helm secrets and check for pending operations
HELM_SECRETS=$(kubectl get secrets -n ${{ env.NAMESPACE }} -l owner=helm -o name)
for secret in $HELM_SECRETS; do
if [[ $secret == *"am-document-processor"* ]]; then
echo "Examining $secret for locks"
# Check if the secret contains a lock
LOCK_STATUS=$(kubectl get $secret -n ${{ env.NAMESPACE }} -o jsonpath='{.metadata.labels.status}')
if [[ $LOCK_STATUS == "pending-install" || $LOCK_STATUS == "pending-upgrade" || $LOCK_STATUS == "pending-rollback" ]]; then
echo "Found lock in $secret with status $LOCK_STATUS, removing..."
kubectl delete $secret -n ${{ env.NAMESPACE }}
echo "Lock removed"
fi
fi
done
else
echo "No existing Helm release found, proceeding with installation"
fi

# Deploy to AKS using Helm
- name: Deploy to AKS
run: |
# Create namespace if it doesn't exist
kubectl create namespace ${{ env.NAMESPACE }} --dry-run=client -o yaml | kubectl apply -f -

# Echo image and environment details for logging
echo "Deploying image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}"
echo "Environment: ${{ env.ENVIRONMENT }}"
echo "Resource Group: ${{ env.RESOURCE_GROUP }}"
echo "Cluster: ${{ env.CLUSTER_NAME }}"
echo "Namespace: ${{ env.NAMESPACE }}"

# Deploy using Helm with the appropriate values file
helm upgrade --install am-document-processor ${{ env.HELM_CHART_PATH }} \
--namespace ${{ env.NAMESPACE }} \
-f ${{ env.HELM_CHART_PATH }}/values/${{ env.ENVIRONMENT }}.yaml \
--set image.repository=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} \
--set image.tag=${{ env.IMAGE_TAG }} \
--set deployment.version="${{ env.IMAGE_TAG }}" \
--wait --timeout 5m
Loading
Loading