generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: CE-491 Adding Jetstream prevent duplicate complaints (#312)
Co-authored-by: afwilcox <[email protected]>
- Loading branch information
Showing
13 changed files
with
240 additions
and
189 deletions.
There are no files selected for viewing
This file contains 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,50 +1,56 @@ | ||
name: Deploy NATS to OpenShift | ||
|
||
on: | ||
pull_request: | ||
pull_request: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up OpenShift CLI | ||
uses: redhat-actions/oc-login@v1 | ||
with: | ||
openshift_server_url: ${{ vars.OC_SERVER }} | ||
openshift_token: ${{ secrets.OC_TOKEN }} | ||
namespace: ${{ vars.OC_NAMESPACE }} | ||
- name: Set up OpenShift CLI | ||
uses: redhat-actions/oc-login@v1 | ||
with: | ||
openshift_server_url: ${{ vars.OC_SERVER }} | ||
openshift_token: ${{ secrets.OC_TOKEN }} | ||
namespace: ${{ vars.OC_NAMESPACE }} | ||
|
||
- name: Add NATS Helm repo | ||
run: helm repo add nats https://nats-io.github.io/k8s/helm/charts/ | ||
|
||
- name: Check if NATS release exists | ||
id: check_release | ||
run: | | ||
RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats | ||
if helm list -q | grep -q $RELEASE_NAME; then | ||
echo "Release $RELEASE_NAME already exists. Skipping install." | ||
echo "release_exists=true" >> $GITHUB_ENV | ||
else | ||
echo "Release $RELEASE_NAME does not exist. Proceeding with install." | ||
echo "release_exists=false" >> $GITHUB_ENV | ||
fi | ||
- name: Deploy NATS using Helm | ||
if: env.release_exists == 'false' | ||
run: | | ||
helm install ${{ github.event.repository.name }}-${{ github.event.number }}-nats nats/nats \ | ||
--set natsBox.enabled=false \ | ||
--set container.merge.resources.requests.cpu=25m \ | ||
--set container.merge.resources.limits.cpu=100m \ | ||
--set container.merge.resources.requests.memory=100Mi \ | ||
--set container.merge.resources.limits.memory=200Mi \ | ||
--set reloader.enabled=false \ | ||
--set replicaCount=1 | ||
- name: Add NATS Helm repo | ||
run: helm repo add nats https://nats-io.github.io/k8s/helm/charts/ | ||
|
||
- name: Label NATS Deployment | ||
run: | | ||
RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats | ||
oc label statefulset $RELEASE_NAME app=${{ github.event.repository.name }}-${{ github.event.number }} | ||
- name: Check if NATS release exists | ||
id: check_release | ||
run: | | ||
RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats | ||
if helm list -q | grep -q $RELEASE_NAME; then | ||
echo "Release $RELEASE_NAME already exists. Skipping install." | ||
echo "release_exists=true" >> $GITHUB_ENV | ||
else | ||
echo "Release $RELEASE_NAME does not exist. Proceeding with install." | ||
echo "release_exists=false" >> $GITHUB_ENV | ||
fi | ||
- name: Deploy NATS using Helm | ||
if: env.release_exists == 'false' | ||
run: | | ||
helm install ${{ github.event.repository.name }}-${{ github.event.number }}-nats nats/nats \ | ||
--set config.jetstream.enabled=true \ | ||
--set config.jetstream.fileStore.pvc.size=200Mi \ | ||
--set config.jetstream.memoryStore.enabled=true \ | ||
--set config.jetstream.memoryStore.maxSize=250Mi \ | ||
--set cluster.enabled=true \ | ||
--set natsBox.enabled=false \ | ||
--set persistence.enabled=true \ | ||
--set persistence.size=200Mi \ | ||
--set container.merge.resources.requests.cpu=25m \ | ||
--set container.merge.resources.limits.cpu=100m \ | ||
--set container.merge.resources.requests.memory=50Mi \ | ||
--set container.merge.resources.limits.memory=250Mi \ | ||
--set reloader.enabled=false \ | ||
--set replicaCount=1 | ||
- name: Label NATS Deployment | ||
run: | | ||
RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats | ||
oc label statefulset $RELEASE_NAME app=${{ github.event.repository.name }}-${{ github.event.number }} |
This file contains 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 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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,6 +1,14 @@ | ||
export const NATS_NEW_COMPLAINTS_TOPIC_NAME = "new_complaints"; | ||
export const NATS_NEW_COMPLAINTS_TOPIC_CONSUMER = "new_complaints_consumer"; | ||
export const NATS_UPDATED_COMPLAINTS_TOPIC_NAME = "updated_complaints"; | ||
export const NEW_STAGING_COMPLAINTS_TOPIC_NAME = "new_staging_complaints"; | ||
export const NEW_STAGING_COMPLAINTS_TOPIC_CONSUMER = "new_staging_complaints_consumer"; | ||
export const NATS_STREAM_NAME = "complaints_stream"; | ||
|
||
export const STAGING_API_ENDPOINT = "staging-complaint"; | ||
export const COMPLAINT_API_ENDPOINT = "complaint-internal"; | ||
export const NATS_QUEUE_GROUP_STAGING = "staging_complaints_queue_group"; | ||
export const NATS_QUEUE_GROUP_COMPLAINTS = "complaints_queue_group"; | ||
export const NATS_DURABLE_COMPLAINTS = "nats_durable_complaints"; | ||
export const NATS_DURABLE_STAGING = "nats_durable_staging"; | ||
export const NATS_DELIVER_SUBJECT = "complaints_deliver_subject"; |
51 changes: 35 additions & 16 deletions
51
webeoc/src/complaints-publisher/complaints-publisher.service.ts
This file contains 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
Oops, something went wrong.