Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
fef815c
feat: production deployment changes
aswindevs Jan 29, 2024
fd1ee28
Add CI & CD for Server & UI
raveenapv Feb 6, 2024
0d05038
cicd for stg
raveenapv Feb 12, 2024
3a49d27
Merge pull request #1 from KeyValueSoftwareSystems/feat/pipeline
raveenapv Feb 12, 2024
ae1db17
corrected server cd yaml
raveenapv Feb 12, 2024
8810672
Merge pull request #2 from KeyValueSoftwareSystems/feat/pipeline
raveenapv Feb 13, 2024
e074bfe
feat: Add migration scripts to add initial workflows, tasks and event…
muhammad-keyvalue Feb 20, 2024
59a56b5
Add stg related config for UI
raveenapv Feb 20, 2024
c15b199
Merge pull request #4 from KeyValueSoftwareSystems/feat/stg
raveenapv Feb 20, 2024
d215ff9
feat: Create initial workflows and tasks using eventlistener
muhammad-keyvalue Feb 20, 2024
15b71f4
refactor: Add new line at EOF
muhammad-keyvalue Feb 20, 2024
12e613f
feat: Handle errors while creating already existing resources
muhammad-keyvalue Feb 21, 2024
a63195f
refactor: Refactor update task method
muhammad-keyvalue Feb 21, 2024
4d7924e
feat: Update finalize execution workflow description
muhammad-keyvalue Feb 21, 2024
bf571b2
feat: Update api url
muhammad-keyvalue Feb 21, 2024
9933a0b
fix: Initialize Siren resources as per property value
sreeraj-keyvalue Feb 29, 2024
ac791a5
feat: Add traceId to sirenWebhookWorkflow
muhammad-keyvalue Mar 4, 2024
dcf2aff
fix: Correct workflow name in event handler
muhammad-keyvalue Mar 4, 2024
175dcb8
feat: Add workflow input to finalize_workflow_execution_task input-pa…
muhammad-keyvalue Mar 5, 2024
1ed26e8
feat: Remove traceId param from siren webhook workflow
muhammad-keyvalue Mar 6, 2024
376dedb
Merge pull request #3 from KeyValueSoftwareSystems/add_siren_migratio…
Sherif-kv Mar 6, 2024
0938446
feat: Update owner-email of finalize workflow
muhammad-keyvalue Mar 6, 2024
ce4c4cc
Merge pull request #6 from KeyValueSoftwareSystems/update_email_final…
Sherif-kv Mar 6, 2024
bee1be3
Http failure handling (#7)
vigneshwarKV Mar 25, 2024
9c60da0
fix: 5XX series issues (#8)
Sherif-kv Mar 26, 2024
7bd459b
chrom: http 1XX response (#9)
Sherif-kv Mar 26, 2024
7d4c2c7
Revert "chrom: http 1XX response (#9)" (#10)
Sherif-kv Mar 26, 2024
367b1f0
feat: Add campaign workflow definition (#11)
muhammad-keyvalue Apr 17, 2024
53ba217
feat: Update siren finalize eventhandler, finalize workflow and campa…
muhammad-keyvalue Apr 27, 2024
8012938
fix: Increase email attachment size to support minimum 10mb (#12)
arjun-keyvalue May 8, 2024
bc834a1
fix: spotless (#14)
Sherif-kv May 8, 2024
a0c0152
debug_external_bucket (#15)
Sherif-kv May 14, 2024
714f1c1
chore: stack trace (#16)
Sherif-kv May 14, 2024
f85619d
fix: ci file for pushing image to public ecr
Ujjwal048 May 24, 2024
c25072d
fix: ci with region change for public ecr login
Ujjwal048 May 24, 2024
123f3ec
add: docker build action for public ecr
Ujjwal048 May 24, 2024
5413250
fix: build step name for public ecr
Ujjwal048 May 24, 2024
6dc13a4
fox: ci trigger for conductor server
Ujjwal048 May 24, 2024
8a27539
Merge pull request #17 from KeyValueSoftwareSystems/add/ci-public-ecr…
Ujjwal048 May 27, 2024
f7e3d8e
Update action deployment verison
Sherif-kv Jan 22, 2025
3a08c55
Merge pull request #18 from KeyValueSoftwareSystems/fix-deployment-ve…
johaan-thomas Jan 22, 2025
bc8ec6d
Add eks deployment pipeline (#21)
gayathridevii Mar 17, 2025
d157530
changed ci cd pipeline for conductor ui (#22)
gayathridevii Mar 25, 2025
7b41ca0
minor fix in eks cluster variable (#23)
gayathridevii Apr 1, 2025
8da72c7
Merge pull request #24 from KeyValueSoftwareSystems/dev
gayathridevii Apr 1, 2025
27fa7f9
fix: Add web identity setup in s3 config (#20)
anandu-kv Apr 2, 2025
18fc707
chore: Add procedure migrations (#25)
anandu-kv Apr 2, 2025
79232dc
DEV to STG
muhammad-keyvalue Apr 2, 2025
c361144
fetch values from infra repo
gayathridevii Apr 8, 2025
9a084ad
fix in fetching variables
gayathridevii Apr 8, 2025
89cacf8
typo fix in values path
gayathridevii Apr 8, 2025
18dcd06
DEV to STG
muhammad-keyvalue Apr 8, 2025
b82fb14
chore: Update archival procedure (#29)
anandu-kv Oct 16, 2025
30ee3e5
Staging
muhammad-keyvalue Oct 16, 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
60 changes: 60 additions & 0 deletions .github/actions/deploy-ecs/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Deploy to ECS"
description: "Deploy new image to given ECS service by updating task definition file"
inputs:
aws-role:
required: true
description: "AWS ROLE"
aws-region:
required: true
description: "AWS REGION"
task-definition:
required: true
description: "TASK DEFINITION"
container-name:
required: true
description: "CONTAINER NAME"
ecs-service:
required: true
description: "ECS SERVICE"
ecs-cluster:
required: true
description: "ECS CLUSTER"
image:
required: true
description: "APP IMAGE"
runs:
using: "composite"
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.aws-role }}
aws-region: ${{ inputs.aws-region }}

- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition ${{ inputs.task-definition }} \
--query taskDefinition > task-definition.json
shell: bash

- name: Fill in the new image ID in the Amazon ECS task definition
id: task_def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: ${{ inputs.container-name }}
image: ${{ inputs.image }}

- name: Remove unwanted fields from task definition
id: task_def_cleanup
shell: bash
run: |
jq 'del(.taskDefinitionArn, .revision, .status, .requiresAttributes, .compatibilities, .registeredAt, .registeredBy)' ${{ steps.task_def.outputs.task-definition }} > updated-task-definition.json

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: updated-task-definition.json
service: ${{ inputs.ecs-service }}
cluster: ${{ inputs.ecs-cluster }}
wait-for-service-stability: true
34 changes: 34 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Conductor CI/CD Workflow

This repository contains workflow files for implementing Continuous Integration (CI) and Continuous Deployment (CD) processes separately for Conductor UI and server components. The workflow is designed to deploy to both development (dev) and production (prd) environments on AWS (ECS).

## Workflow Overview

The CI/CD workflow is triggered manually & comprises two main components:

1. **Conductor UI CI/CD:**
- Workflow file: `.github/workflows/ci-ui.yaml`
`.github/workflows/cd-ui.yaml`
- These workflows handle the CI & CD process for Conductor UI.

2. **Conductor Server CI/CD:**
- Workflow file: `.github/workflows/ci-server.yaml`
`.github/workflows/cd-server.yaml`
- These workflows handle the CI & CD process for Conductor server.

## Deployment Strategy

- **Branches:**
- The `production` branch is considered the master branch for all deployments.
- All deployments to both development and production environments are triggered from the `production` branch.

- **Input Variables:**
- The workflow takes the following input variables:
1. **Branch:** Specifies the branch to be deployed (e.g., `production`).
2. **Environment:** Specifies the deployment environment (e.g., `dev` or `prd`).
3. **Tag:** Specifies the version to be deployed. This version is used for tagging the Docker image.

## Versioning and Docker Image Tagging

The version provided as an input variable is crucial for versioning and tagging Docker images. The workflow utilizes this version to tag the Docker image before deploying to the AWS Elastic Container Registry (ECR). During ECS deployment, this tagged image is fetched from ECR.

162 changes: 162 additions & 0 deletions .github/workflows/cd-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Deploy Conductor Server

on:
workflow_dispatch:
inputs:
Environment:
required: true
type: choice
description: Choose aws env
options:
- dev
- stg
- prd
Tag:
required: true
type: string
description: Provide tag (Eg:v3.14.0)
permissions:
id-token: write
contents: write
packages: read
actions: read
env:
SERVICE_NAME: conductor
AWS_REGION: "ap-south-1"
HELM_CHART_NAME: "application-helm-chart"

jobs:
prepare-env:
name: Prepare Env
runs-on: "ubuntu-latest"
timeout-minutes: 2
outputs:
AWS_ROLE: ${{ steps.vars.outputs.AWS_ROLE }}
ENV: ${{ steps.vars.outputs.ENV }}
PROJECT_PREFIX: ${{ steps.vars.outputs.PROJECT_PREFIX }}
K8S_CLUSTER: ${{ steps.vars.outputs.K8S_CLUSTER }}
ECR_REPOSITORY: ${{ steps.set_env.outputs.ECR_REPOSITORY }}
ENVIRONMENT_BUCKET: ${{ steps.set_env.outputs.ENVIRONMENT_BUCKET }}
SLACK_WEBHOOK_URL: ${{ steps.vars.outputs.SLACK_WEBHOOK_URL }}
AWS_ACCOUNT_ID: ${{ steps.vars.outputs.AWS_ACCOUNT_ID}}

steps:
- id: vars
shell: bash
run: |
BRANCH="${GITHUB_REF#refs/heads/}"
ENV=${{ github.event.inputs.environment }}
IMAGE_TAG=${{ github.event.inputs.tag }}
echo $BRANCH

if [ -z "$ENV" ]
then
case $BRANCH in
"dev")
ENV="dev"
;;
"stg")
ENV="stg"
;;
"main")
ENV="prd"
;;
*)
echo "ENV not configured" && exit 1
;;
esac
fi
if [[ $ENV == 'prd' && $BRANCH == 'production' ]]
then
echo "AWS_ROLE=PRD_AWS_ROLE" >> $GITHUB_OUTPUT
echo "PROJECT_PREFIX=sirn-prd-mb" >> $GITHUB_OUTPUT
echo "SLACK_WEBHOOK_URL=PRD_SLACK_WEBHOOK_URL" >> $GITHUB_OUTPUT
echo "AWS_ACCOUNT_ID=PRD_AWS_ACCOUNT_ID" >> $GITHUB_OUTPUT
echo "K8S_CLUSTER=sirn-prd-mb-prime" >> $GITHUB_OUTPUT
elif [ $ENV == 'stg' ]
then
echo "AWS_ROLE=STG_AWS_ROLE" >> $GITHUB_OUTPUT
echo "PROJECT_PREFIX=sirn-stg-mb" >> $GITHUB_OUTPUT
echo "SLACK_WEBHOOK_URL=DEV_SLACK_WEBHOOK_URL" >> $GITHUB_OUTPUT
echo "AWS_ACCOUNT_ID=NON_PRD_AWS_ACCOUNT_ID" >> $GITHUB_OUTPUT
echo "K8S_CLUSTER=sirn-dev-mb-prime" >> $GITHUB_OUTPUT
elif [ $ENV == 'dev' ]
then
echo "AWS_ROLE=DEV_AWS_ROLE" >> $GITHUB_OUTPUT
echo "PROJECT_PREFIX=sirn-dev-mb" >> $GITHUB_OUTPUT
echo "SLACK_WEBHOOK_URL=DEV_SLACK_WEBHOOK_URL" >> $GITHUB_OUTPUT
echo "AWS_ACCOUNT_ID=NON_PRD_AWS_ACCOUNT_ID" >> $GITHUB_OUTPUT
echo "K8S_CLUSTER=sirn-dev-mb-prime" >> $GITHUB_OUTPUT
else
echo "Branch not configured!"
exit 1
fi
echo "ENV=$ENV" >> $GITHUB_OUTPUT
echo ":rocket: Environment - $ENV " >> $GITHUB_STEP_SUMMARY
echo ":label: Image Tag - $IMAGE_TAG " >> $GITHUB_STEP_SUMMARY
- name: set variables
id: set_env
run: |
PROJECT_PREFIX=${{ steps.vars.outputs.PROJECT_PREFIX }}
echo "ENVIRONMENT_BUCKET=$PROJECT_PREFIX-s3-environment" >> $GITHUB_OUTPUT
echo ":seedling: Branch:${GITHUB_REF#refs/heads/}" >> $GITHUB_STEP_SUMMARY
echo "ECR_REPOSITORY=$PROJECT_PREFIX-ecr-conductor-server" >> $GITHUB_OUTPUT

# Deploy Conductor UI Image to ECS
deploy-to-k8s:
name: Deploy to k8s
runs-on: ubuntu-latest
container:
image: public.ecr.aws/kvsiren-dev/pipeline/helm-deploy:latest
timeout-minutes: 15
permissions:
id-token: write
pull-requests: write
contents: read
needs:
- prepare-env
env:
AWS_ACCOUNT_ID: ${{ needs.prepare-env.outputs.AWS_ACCOUNT_ID }}
ECR_REPOSITORY: ${{ needs.prepare-env.outputs.ECR_REPOSITORY }}
steps:
- name: Checkout code from action
uses: actions/checkout@v2

- name: Checkout values.yaml from siren-infra
uses: actions/checkout@v4
with:
repository: KeyvalueSoftwareSystems/siren-infra
ref: main
token: ${{secrets.SIREN_PAT}}
sparse-checkout: |
k8s/siren-services/${{ env.SERVICE_NAME }}/${{ needs.prepare-env.outputs.ENV }}-values.yaml
sparse-checkout-cone-mode: false

- name: Rename values.yaml for Helm
shell: bash
run: |
cp k8s/siren-services/${{ env.SERVICE_NAME }}/${{ needs.prepare-env.outputs.ENV }}-values.yaml ./values.yaml
cat ./values.yaml

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ vars[env.AWS_ACCOUNT_ID] }}:role/github-actions
aws-region: ${{ env.AWS_REGION }}

- name: Deploy to Kubernetes
shell: bash
run: |
aws eks update-kubeconfig --name ${{ needs.prepare-env.outputs.K8S_CLUSTER }}
aws ecr get-login-password --region ${{ env.AWS_REGION }} | helm registry login --username AWS --password-stdin ${{ vars[env.AWS_ACCOUNT_ID] }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com

# Construct base Helm command
HELM_CMD="helm upgrade --install ${{ env.SERVICE_NAME }} oci://${{ vars[env.AWS_ACCOUNT_ID] }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.HELM_CHART_NAME }} \
--namespace ${{ needs.prepare-env.outputs.ENV }} \
--values values.yaml \
--set default.image.repository='${{ vars[env.AWS_ACCOUNT_ID] }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPOSITORY }}' \
--set default.image.tag='${{ github.event.inputs.tag }}'"

# Run the Helm command
echo "Running: $HELM_CMD"
eval $HELM_CMD
Loading