Skip to content
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

dev to main merge 29 dec #591

Merged
merged 53 commits into from
Dec 29, 2023
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
06409c5
clean up
TwinkleJoseph Oct 23, 2023
5bebc1c
Merge branch 'dev' of github.com:bcgov/nr-epd-digital-services into f…
TwinkleJoseph Oct 23, 2023
b89bd64
Merge branch 'dev' of github.com:bcgov/nr-epd-digital-services into f…
TwinkleJoseph Oct 24, 2023
aaab49e
etl build pipeline
TwinkleJoseph Oct 24, 2023
c3b39eb
yaml error fix
TwinkleJoseph Oct 24, 2023
c2642bc
yaml error fix
TwinkleJoseph Oct 24, 2023
bba38bf
custom build file for etl
TwinkleJoseph Oct 25, 2023
68d89d5
env var for debezium version
TwinkleJoseph Oct 25, 2023
8331a54
use env for vars
TwinkleJoseph Oct 25, 2023
9ff7c01
read vars from secrets
TwinkleJoseph Oct 25, 2023
61177d3
var change
TwinkleJoseph Oct 25, 2023
8cf0457
read etl env
TwinkleJoseph Oct 25, 2023
fc34c84
updated env
TwinkleJoseph Oct 25, 2023
ad01fc3
fix env
TwinkleJoseph Oct 25, 2023
3cd5b41
env fix
TwinkleJoseph Oct 25, 2023
bc5625a
trial n error
TwinkleJoseph Oct 25, 2023
42574ef
debug
TwinkleJoseph Oct 26, 2023
ae0af4a
another test
jaise-aot Oct 26, 2023
88b1e11
another test
jaise-aot Oct 26, 2023
fdb34c3
cleanup
jaise-aot Oct 26, 2023
66e0485
added more build files
jaise-aot Oct 26, 2023
274e245
print deb version
jaise-aot Oct 26, 2023
9d8d0f1
yet another change
jaise-aot Oct 26, 2023
6dd12cd
token fix
jaise-aot Oct 26, 2023
27c2241
define secret
jaise-aot Oct 26, 2023
9f36426
remove env
jaise-aot Oct 26, 2023
6dd6025
Merge branch 'dev' of github.com:bcgov/nr-epd-digital-services into f…
jaise-aot Nov 20, 2023
8cebd0a
remove custom docker builds
jaise-aot Nov 20, 2023
9b8cd1d
workflow for jdbc connect
jaise-aot Nov 20, 2023
787ca8d
update job name
jaise-aot Nov 20, 2023
630fe3a
use etl token - temp fix
jaise-aot Nov 20, 2023
84981c2
workflow for postgis customized for debezium
jaise-aot Nov 20, 2023
683c32a
update service account token
jaise-aot Nov 20, 2023
3db7970
env specific build for jdbc and branch change
jaise-aot Nov 30, 2023
a96bb41
remove the patch step
jaise-aot Nov 30, 2023
7e97ca2
remove patch step from connect
jaise-aot Nov 30, 2023
9ff54da
disabled formfields for reviewer roles
midhun-aot Dec 6, 2023
0469ca0
Update nom_application.ftl
midhun-aot Dec 6, 2023
4ab47d5
Merge pull request #585 from bcgov/srs-30
nikhila-aot Dec 6, 2023
40ab1cc
custom docker file for kafka log control
jaise-aot Dec 7, 2023
3983ee5
build and deployment file changes
jaise-aot Dec 7, 2023
ad527f7
update branch to dev
jaise-aot Dec 7, 2023
0ead6c1
Merge pull request #582 from bcgov/feat/srs-25-etl-deploy
acoard-aot Dec 7, 2023
3b3f6ed
Merge pull request #586 from bcgov/fix/task-164
acoard-aot Dec 7, 2023
c1ad01d
feat: update logo URL in templates
eric-bcps Dec 19, 2023
e95ca4f
feat: include the new `APP_HOST` variable in the compose file
eric-bcps Dec 19, 2023
eb5df66
feat: update workflow to fetch and set `host`
eric-bcps Dec 19, 2023
25c84a7
refactor: change logger to match style in other places
eric-bcps Dec 20, 2023
9f9125b
Merge pull request #587 from bcgov/feat/update-logo-in-emails
nikhila-aot Dec 20, 2023
ba82c05
added srcr keys to the logic to disable the form fields
midhun-aot Dec 26, 2023
b417692
Merge pull request #589 from bcgov/srs-30-fix
nikhila-aot Dec 26, 2023
65889ba
fix for 121
nikhila-aot Dec 29, 2023
fca3e5f
Merge pull request #590 from bcgov/feat/srs-121
midhun-aot Dec 29, 2023
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
71 changes: 71 additions & 0 deletions .github/workflows/cd-debezium-jdbc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: debezium-jdbc

on:
workflow_dispatch:
inputs:
START_BUILD:
required: true
type: boolean
description: This value is ignored, just to trigger dispatch.
push:
branches:
- dev
- main
- feat/srs-25-etl-deploy
paths:
- 'etl/**'
- '.github/workflows/**'

defaults:
run:
shell: bash
working-directory: ./etl/debezium-jdbc
env:
APP_NAME: "debezium-jdbc"

jobs:
etl-debezium-jdbc-cd-by-push:
runs-on: ubuntu-20.04

if: github.repository == 'bcgov/nr-epd-digital-services'
steps:
- uses: actions/checkout@v2
- name: Set ENV variables
id: set-variable
# make sure to update the TOOLS_NAME once all the environment for forms-flow-ai-web is ready
run: |
if [ '${{ github.ref_name }}' == 'dev' ]; then
echo "For ${{ github.ref_name }} branch"
echo "TOOLS_NAME=${{secrets.OC_ETL_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV
echo "TAG_NAME="dev"" >> $GITHUB_ENV
echo "BRANCH_NAME="dev"" >> $GITHUB_ENV
echo "ENV_NAME="dev"" >> $GITHUB_ENV
elif [ '${{ github.ref_name }}' == 'main' ]; then
echo "For ${{ github.ref_name }} branch"
echo "TOOLS_NAME=${{secrets.OC_ETL_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV
echo "TAG_NAME="test"" >> $GITHUB_ENV
echo "BRANCH_NAME="main"" >> $GITHUB_ENV
echo "ENV_NAME="test"" >> $GITHUB_ENV
else
echo "For ${{ github.ref_name }} branch, defaulting to dev values"
echo "TOOLS_NAME=${{secrets.OC_ETL_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV
echo "TAG_NAME="dev"" >> $GITHUB_ENV
echo "BRANCH_NAME="dev"" >> $GITHUB_ENV
fi
shell: bash

- name: Login Openshift
shell: bash
run: |
oc login --server=${{secrets.OC_SERVER}} --token=${{secrets.OC_TOKEN}}

- name: Tools project
shell: bash
run: |
oc project ${{ secrets.OC_ETL_NAMESPACE_NAMEPLATE }}-tools

- name: Start Build Openshift
shell: bash
run: |
oc start-build ${{ env.APP_NAME }}-${{ env.TAG_NAME }}-build --wait

83 changes: 83 additions & 0 deletions .github/workflows/cd-debezium-postgis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: debezium-postgis Custom

on:
workflow_dispatch:
inputs:
START_BUILD:
required: true
type: boolean
description: This value is ignored, just to trigger dispatch.
push:
branches:
- dev
- main
- feat/srs-25-etl-deploy
paths:
- 'etl/**'
- '.github/workflows/**'

defaults:
run:
shell: bash
working-directory: ./etl/debezium-postgis
env:
APP_NAME: "debezium-postgis"

jobs:
etl-debezium-postgis-cd-by-push:
runs-on: ubuntu-20.04

if: github.repository == 'bcgov/nr-epd-digital-services'
steps:
- uses: actions/checkout@v2
- name: Set ENV variables
id: set-variable
# make sure to update the TOOLS_NAME once all the environment for forms-flow-ai-web is ready
run: |
if [ '${{ github.ref_name }}' == 'dev' ]; then
echo "For ${{ github.ref_name }} branch"
echo "TOOLS_NAME=${{secrets.OC_ETL_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV
echo "TAG_NAME="dev"" >> $GITHUB_ENV
echo "BRANCH_NAME="dev"" >> $GITHUB_ENV
echo "ENV_NAME="dev"" >> $GITHUB_ENV
elif [ '${{ github.ref_name }}' == 'main' ]; then
echo "For ${{ github.ref_name }} branch"
echo "TOOLS_NAME=${{secrets.OC_ETL_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV
echo "TAG_NAME="test"" >> $GITHUB_ENV
echo "BRANCH_NAME="main"" >> $GITHUB_ENV
echo "ENV_NAME="test"" >> $GITHUB_ENV
else
echo "For ${{ github.ref_name }} branch, defaulting to dev values"
echo "TOOLS_NAME=${{secrets.OC_ETL_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV
echo "TAG_NAME="dev"" >> $GITHUB_ENV
echo "BRANCH_NAME="dev"" >> $GITHUB_ENV
fi
shell: bash

- name: Login Openshift
shell: bash
run: |
oc login --server=${{secrets.OC_SERVER}} --token=${{secrets.OC_TOKEN}}

- name: Tools project
shell: bash
run: |
oc project ${{ secrets.OC_ETL_NAMESPACE_NAMEPLATE }}-tools

# Build from either dev or main branch as appropriate
- name: Build from ${{ env.BRANCH_NAME }} branch
shell: bash
run: |
oc patch bc/${{ env.APP_NAME }}-build -p '{"spec":{"source":{"git":{"ref":"${{ env.BRANCH_NAME }}"}}}}'

- name: Start Build Openshift
shell: bash
run: |
oc start-build ${{ env.APP_NAME }}-build --wait


- name: Tag+Deploy for ${{ env.TAG_NAME }}
shell: bash
run: |
oc tag ${{ env.APP_NAME }}:latest ${{ env.APP_NAME }}:${{ env.TAG_NAME }}

36 changes: 0 additions & 36 deletions .github/workflows/ci-cd-debezium-tools.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci-cd-openshift-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
paths:
- 'backend/**'
- 'frontend/**'
- '.github/workflows/ci-cd-openshift-tools.yaml'
- '.github/workflows/ci-cd-openshift-tools.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ snyk.sarif

# Docker/Podman volumes
.volumes
backend/etl/debezium-jdbc/.settings/org.eclipse.m2e.core.prefs
backend/etl/debezium-jdbc/.settings/org.eclipse.jdt.core.prefs
backend/etl/debezium-jdbc/.settings/org.eclipse.core.resources.prefs
backend/etl/debezium-jdbc/.project
backend/etl/debezium-jdbc/.classpath
backend/etl/debezium-jdbc/target/
etl/debezium-jdbc/.settings/org.eclipse.m2e.core.prefs
etl/debezium-jdbc/.settings/org.eclipse.jdt.core.prefs
etl/debezium-jdbc/.settings/org.eclipse.core.resources.prefs
etl/debezium-jdbc/.project
etl/debezium-jdbc/.classpath
etl/debezium-jdbc/target/


notes/
Expand Down
54 changes: 53 additions & 1 deletion etl/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,60 @@ jdbc:oracle:thin:@(description=(address=(protocol=tcps)(host=172.18.215.225.nip.

# Create sample data in postgresql using init.sql

# OpenShift Build and Deploy process

## 1. Build custom postgis

```
oc process -f debezium-postgis.build.yaml |oc apply -f -
```

## 2. Build kafka jdbc connect component

```
oc process -f debezium-jdbc.build.yaml --param-file=.env |oc apply -f -
```

## 3. Build kafka broker.
```
oc process -f debezium-kafka.build.yaml |oc apply -f -
```

## 4. Deploy postgis (switch to correct project for env before this step)
```
oc process -f debezium-postgis.deploy.yaml |oc apply -f -
```
## 5. Deploy zookeeper
```
oc process -f debezium-zookeeper.deploy.yaml |oc apply -f -
```
## 6. Deploy kafka
```
oc process -f debezium-kafka.deploy.yaml |oc apply -f -
```
## 7. Deploy kafka-jdbc connect.
```
oc process -f debezium-jdbc.deploy.yaml |oc apply -f -
```

# Register postgresql connector
```
curl -H "Content-Type: application/json" -d @register-postgres-source-connector.json http://localhost:8083/connectors/

curl -H "Content-Type: application/json" -d @register-postgres-source-connector.json https://debezium-jdbc-latest.apps.silver.devops.gov.bc.ca/connectors/



```

# Register Oracle jdbc sink connector

```
curl -H "Content-Type: application/json" -d @register-oracle-jdbc-sink-connector.json http://localhost:8083/connectors/

curl -H "Content-Type: application/json" -d @register-oracle-jdbc-sink-connector.json https://debezium-jdbc-latest.apps.silver.devops.gov.bc.ca/connectors/


```

# Test with a kafka console consumer.
Expand All @@ -67,6 +109,16 @@ curl -X DELETE localhost:8083/connectors/<connector-name>

curl -X DELETE localhost:8083/connectors/oracle-jdbc-sink-connector
curl -X DELETE localhost:8083/connectors/postgres-source-connector
```

curl -X DELETE https://debezium-jdbc-latest.apps.silver.devops.gov.bc.ca/connectors/oracle-jdbc-sink-connector
curl -X DELETE https://debezium-jdbc-latest.apps.silver.devops.gov.bc.ca/connectors/postgres-source-connector

```

# Get all connectors registered.
```
curl localhost:8083/connectors/
curl https://debezium-jdbc-latest.apps.silver.devops.gov.bc.ca/connectors
```


13 changes: 13 additions & 0 deletions etl/debezium-jdbc/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
Expand Down
Binary file not shown.
Binary file not shown.
4 changes: 0 additions & 4 deletions etl/debezium-jdbc/target/maven-archiver/pom.properties

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions etl/debezium-kafka/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

FROM debezium/kafka:1.9


COPY connect-log4j.properties /kafka/config/
COPY log4j.properties /kafka/config/
Loading
Loading