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

Feat/srs 26 #571

Merged
merged 18 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
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
4 changes: 2 additions & 2 deletions etl/debezium-jdbc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ WORKDIR /app/
COPY ./ ./
RUN mvn clean install

RUN echo "DEBEZIUM_VERSION is $DEBEZIUM_VERSION"


FROM debezium/connect:$DEBEZIUM_VERSION
FROM debezium/connect:1.9

ARG ORACLE_JDBC_VERSION
ARG ORACLE_JDBC_MD5
Expand Down
4 changes: 3 additions & 1 deletion etl/debezium-postgis/15-3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ COPY --from=build /usr/share/postgresql/$PG_MAJOR/extension/decoderbufs.control
COPY postgresql.conf.sample /usr/share/postgresql/postgresql.conf.sample

# Copy the script which will initialize the replication permissions
COPY /docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
COPY /docker-entrypoint-initdb.d/init-permissions.sh /docker-entrypoint-initdb.d/init-permissions.sh

RUN chmod +x /docker-entrypoint-initdb.d/init-permissions.sh
101 changes: 101 additions & 0 deletions openshift/templates/etl/debezium-jdbc.build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: "${API_NAME}-build-template"
creationTimestamp:
objects:
- kind: ImageStream
apiVersion: v1
metadata:
name: "${API_NAME}"
- kind: BuildConfig
apiVersion: v1
metadata:
name: "${API_NAME}-build"
labels:
app: "${API_NAME}-build"
spec:
runPolicy: Serial
source:
type: Git
git:
uri: "${GIT_REPO_URL}"
ref: "${GIT_REF}"
contextDir: "${SOURCE_CONTEXT_DIR}"
strategy:
type: Docker
dockerStrategy:
dockerfilePath: "${DOCKER_FILE_PATH}"
env:
- name: "DEBEZIUM_VERSION"
value: "${DEBEZIUM_VERSION}"
- name: "ORACLE_JDBC_VERSION"
value: "${ORACLE_JDBC_VERSION}"
- name: "ORACLE_JDBC_MD5"
value: "${ORACLE_JDBC_MD5}"
- name: "KAFKA_JDBC_VERSION"
value: "${KAFKA_JDBC_VERSION}"
- name: "ORACLE_DB_HOST"
value: "${ORACLE_DB_HOST}"
- name: "ORACLE_DB_PORT"
value: "${ORACLE_DB_PORT}"

output:
to:
kind: ImageStreamTag
name: "${API_NAME}:latest"
parameters:
- name: API_NAME
displayName: Name
description: The name assigned to all of the resources defined in this template.
required: true
value: debezium-jdbc
- name: GIT_REPO_URL
displayName: Git Repo URL
description: The URL to your GIT repo.
required: true
value: https://github.com/bcgov/nr-epd-digital-services
- name: GIT_REF
displayName: Git Reference
description: The git reference or branch.
required: true
value: feat/srs-26
- name: SOURCE_CONTEXT_DIR
displayName: Source Context Directory
description: The source context directory.
required: false
value: etl/debezium-jdbc
- name: DOCKER_FILE_PATH
displayName: Docker File Path
description: The path to the docker file defining the build.
required: false
value: "Dockerfile"
- name: DEBEZIUM_VERSION
displayName: Debezium Version
description: Debezium image version.
required: false
value: "1.9"
- name: ORACLE_JDBC_VERSION
displayName: Oracle JDBC Version
description: Oracle JDBC Version.
required: false
value: "21.6.0.0"
- name: ORACLE_JDBC_MD5
displayName: Oracle JDBC Checksum
description: Oracle JDBC File Checksum.
required: false
value: "312e6f4ec9932bbf74a4461669970c4b"
- name: KAFKA_JDBC_VERSION
displayName: Kafka JDBC Version
description: Kafka Jdbc Version.
required: false
value: "5.3.1"
- name: ORACLE_DB_HOST
displayName: Oracle DB Host
description: Oracle Database Host Name
required: true
- name: ORACLE_DB_PORT
displayName: Oracle DB Port
description: Oracle Database Port.
required: true
151 changes: 151 additions & 0 deletions openshift/templates/etl/debezium-jdbc.deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
annotations:
description: Deployment template for Debezium JDBC Connector.
tags: "${API_NAME}"
name: "${API_NAME}-deploy"
objects:
- kind: DeploymentConfig
apiVersion: apps.openshift.io/v1
metadata:
name: "${API_NAME}"
labels:
app: "${API_NAME}"
app-group: "${APP_GROUP}"
template: "${API_NAME}-deploy"
spec:
strategy:
type: Rolling
rollingParams:
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 600
maxUnavailable: 25%
maxSurge: 25%
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- "${API_NAME}"
from:
kind: ImageStreamTag
namespace: "${IMAGE_NAMESPACE}"
name: "${API_NAME}:${TAG_NAME}"
replicas: 1
test: false
selector:
app: "${API_NAME}"
deploymentconfig: "${API_NAME}"
template:
metadata:
labels:
app: "${API_NAME}"
app-group: "${APP_GROUP}"
deploymentconfig: "${API_NAME}"
template: "${API_NAME}-deploy"
role: api
spec:
containers:
- name: "${API_NAME}"
image: "${API_NAME}"
imagePullPolicy: Always
ports:
- containerPort: 8083
protocol: TCP
env:
- name: BOOTSTRAP_SERVERS
value: "debezium-kafka:9092"
- name: GROUP_ID
value: "1"
- name: CONFIG_STORAGE_TOPIC
value: "epd_connect_configs"
- name: OFFSET_STORAGE_TOPIC
value: "epd_connect_offsets"
- name: STATUS_STORAGE_TOPIC
value: "epd_connect_statuses"
- name: KAFKA_DEBUG
value: "true"
- name: DEBUG_SUSPEND_FLAG
value: "n"
resources:
requests:
cpu: "150m"
memory: "500Mi"
limits:
cpu: "250m"
memory: "1Gi"
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
- kind: Service
apiVersion: v1
metadata:
name: "${API_NAME}"
creationTimestamp:
labels:
app: "${API_NAME}"
app-group: "${APP_GROUP}"
template: "${API_NAME}-deploy"
spec:
ports:
- name: 8083-tcp
protocol: TCP
port: 8083
targetPort: 8083
selector:
deploymentconfig: "${API_NAME}"
type: ClusterIP
sessionAffinity: None
# status:
# loadBalancer: {}
- kind: Route
apiVersion: v1
metadata:
name: "${API_NAME}"
labels:
app: "${API_NAME}"
app-group: "${APP_GROUP}"
template: "${API_NAME}-deploy"
spec:
to:
kind: Service
name: "${API_NAME}"
weight: 100
port:
targetPort: 8083-tcp
tls:
termination: edge
wildcardPolicy: None
host: "${API_NAME}-${TAG_NAME}.apps.silver.devops.gov.bc.ca"
parameters:
- name: API_NAME
displayName: Name
description: The name assigned to all of the OpenShift resources associated to the
server instance.
required: true
value: debezium-jdbc
- name: APP_GROUP
displayName: App Group
description: The name assigned to all of the deployments in this project.
required: true
value: epd
- name: IMAGE_NAMESPACE
displayName: Image Namespace
required: true
description: The namespace of the OpenShift project containing the imagestream for
the application.
value: c6a6e5-tools
- name: TAG_NAME
displayName: Environment TAG name
description: The TAG name for this environment, e.g., dev, test, prod
required: true
value: latest
Loading