From 2c54289b5484b29c59511337524f07bfda1e9889 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 1 Jun 2026 15:27:24 -0700 Subject: [PATCH 01/20] 33590 - Test --- jobs/colin-extract-refresh/.env.sample | 12 ++ jobs/colin-extract-refresh/Dockerfile | 49 ++++++ jobs/colin-extract-refresh/Makefile | 41 +++++ jobs/colin-extract-refresh/README.md | 0 jobs/colin-extract-refresh/checks/__init__.py | 0 .../checks/check_business.py | 28 ++++ .../checks/check_colin.py | 35 +++++ jobs/colin-extract-refresh/config.py | 146 ++++++++++++++++++ .../colin-extract-refresh/openshift/Readme.md | 1 + .../openshift/templates/bc.yaml | 21 +++ .../openshift/templates/cronjob.yaml | 137 ++++++++++++++++ jobs/colin-extract-refresh/requirements.txt | 4 + jobs/colin-extract-refresh/setup.cfg | 3 + jobs/colin-extract-refresh/setup.py | 22 +++ .../test_connectivity.py | 18 +++ 15 files changed, 517 insertions(+) create mode 100644 jobs/colin-extract-refresh/.env.sample create mode 100644 jobs/colin-extract-refresh/Dockerfile create mode 100644 jobs/colin-extract-refresh/Makefile create mode 100644 jobs/colin-extract-refresh/README.md create mode 100644 jobs/colin-extract-refresh/checks/__init__.py create mode 100644 jobs/colin-extract-refresh/checks/check_business.py create mode 100644 jobs/colin-extract-refresh/checks/check_colin.py create mode 100644 jobs/colin-extract-refresh/config.py create mode 100644 jobs/colin-extract-refresh/openshift/Readme.md create mode 100644 jobs/colin-extract-refresh/openshift/templates/bc.yaml create mode 100644 jobs/colin-extract-refresh/openshift/templates/cronjob.yaml create mode 100644 jobs/colin-extract-refresh/requirements.txt create mode 100644 jobs/colin-extract-refresh/setup.cfg create mode 100644 jobs/colin-extract-refresh/setup.py create mode 100644 jobs/colin-extract-refresh/test_connectivity.py diff --git a/jobs/colin-extract-refresh/.env.sample b/jobs/colin-extract-refresh/.env.sample new file mode 100644 index 0000000000..1e25ada2fc --- /dev/null +++ b/jobs/colin-extract-refresh/.env.sample @@ -0,0 +1,12 @@ + +DATABASE_USERNAME_COLIN_ORACLE= +DATABASE_PASSWORD_COLIN_ORACLE= +DATABASE_NAME_COLIN_ORACLE= +DATABASE_HOST_COLIN_ORACLE= +DATABASE_PORT_COLIN_ORACLE= + +DATABASE_USERNAME_COLIN_MIGR= +DATABASE_PASSWORD_COLIN_MIGR= +DATABASE_NAME_COLIN_MIGR= +DATABASE_HOST_COLIN_MIGR= +DATABASE_PORT_COLIN_MIGR= \ No newline at end of file diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile new file mode 100644 index 0000000000..2fc835a684 --- /dev/null +++ b/jobs/colin-extract-refresh/Dockerfile @@ -0,0 +1,49 @@ +FROM python:3.11-slim + +ARG VCS_REF="missing" +ARG BUILD_DATE="missing" + +ENV VCS_REF=${VCS_REF} +ENV BUILD_DATE=${BUILD_DATE} +ENV PYTHONUNBUFFERED=1 +ENV ORACLE_CLIENT_LIB_DIR=/opt/oracle/instantclient_21_1 + + +# Configure Jupyter to use user-writable paths + +LABEL org.label-schema.vcs-ref=${VCS_REF} \ + org.label-schema.build-date=${BUILD_DATE} + + +USER root + +WORKDIR /opt/oracle + +RUN apt-get update; \ + apt-get install -y --no-install-recommends libaiol wget unzip ca-certificates; \ + wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-basiclite-linux.x64-21.1.0.0.0.zip; \ + unzip instantclient-basiclite-linux.x64-21.1.0.0.0.zip; \ + rm -f instantclient-basiclite-linux.x64-21.1.0.0.0.zip; \ + cd "${ORACLE_CLIENT_LIB_DIR}"; \ + rm -f *jdbc* *occi* *mysql* *README *jar uidvrci genezi adrci; \ + echo "${ORACLE_CLIENT_LIB_DIR}" > /etc/ld.so.conf.d/oracle-instantclient.conf; \ + ldconfig; \ + rm -rf /var/lib/apt/lists/* + +# Create directories with proper permissions +RUN mkdir -p /opt/app-root && \ + chmod 755 /opt/app-root + +WORKDIR /opt/app-root + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application files +COPY . . + +USER 1001 + +EXPOSE 8080 + +CMD [ "python", "/opt/app-root/test_connectivity.py" ] diff --git a/jobs/colin-extract-refresh/Makefile b/jobs/colin-extract-refresh/Makefile new file mode 100644 index 0000000000..22425aabe8 --- /dev/null +++ b/jobs/colin-extract-refresh/Makefile @@ -0,0 +1,41 @@ +.PHONY: help setup install build build-nc run + +MKFILE_PATH:=$(abspath $(lastword $(MAKEFILE_LIST))) +CURRENT_ABS_DIR:=$(patsubst %/,%,$(dir $(MKFILE_PATH))) + +DOCKER_NAME:=colin-extract-refresh +TAG_NAME ?= dev + + +################################################################################# +# COMMANDS -- Setup # +################################################################################# +setup: install ## Setup the project + +install: ## Install python virtual environment + test -f .venv/bin/activate || python3.11 -m venv $(CURRENT_ABS_DIR)/.venv ;\ + . .venv/bin/activate ;\ + pip install --upgrade pip ;\ + pip install -Ur requirements.txt + +run: ## Run the project in local + . .venv/bin/activate && python test_connectivity.py + +build: + docker build -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) \ + --build-arg VCS_REF=$$(git -C $(CURRENT_ABS_DIR) rev-parse --short HEAD 2>/dev/null || echo missing) \ + --build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +build-nc: + docker build --no-cache -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) + +run-docker: build + docker run --rm --env-file $(CURRENT_ABS_DIR)/.env $(DOCKER_NAME):$(TAG_NAME) + +################################################################################# +# Self Documenting Commands # +################################################################################# +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +.DEFAULT_GOAL := help diff --git a/jobs/colin-extract-refresh/README.md b/jobs/colin-extract-refresh/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jobs/colin-extract-refresh/checks/__init__.py b/jobs/colin-extract-refresh/checks/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jobs/colin-extract-refresh/checks/check_business.py b/jobs/colin-extract-refresh/checks/check_business.py new file mode 100644 index 0000000000..04345e0800 --- /dev/null +++ b/jobs/colin-extract-refresh/checks/check_business.py @@ -0,0 +1,28 @@ +import sys + +from sqlalchemy import create_engine, text +from config import get_named_config + +def run_check() -> int: + cfg = get_named_config() + if not all([cfg.DB_USER_COLIN_MIGR, cfg.DB_PASSWORD_COLIN_MIGR, cfg.DB_NAME_COLIN_MIGR, cfg.DB_HOST_COLIN_MIGR, cfg.DB_PORT_COLIN_MIGR]): + raise RuntimeError( + "Missing business env vars" + ) + print(f"[business-api] connecting to {cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR}") + engine = create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR) + with engine.connect() as conn: + row = conn.execute(text("SELECT * FROM corporation LIMIT 1")).mappings().first() + if row is None: + print("no rows in business mig db") + else: + print(f"sample row: {dict(row)}") + return 0 + + +if __name__ == "__main__": + try: + raise SystemExit(run_check()) + except Exception as exc: + print(f"business db check failed: {exc}", file=sys.stderr) + raise diff --git a/jobs/colin-extract-refresh/checks/check_colin.py b/jobs/colin-extract-refresh/checks/check_colin.py new file mode 100644 index 0000000000..3aff61aaee --- /dev/null +++ b/jobs/colin-extract-refresh/checks/check_colin.py @@ -0,0 +1,35 @@ +import sys +import oracledb +from sqlalchemy import create_engine, text +from config import get_named_config + +def _colin_oracle_init() -> None: + oracledb.init_oracle_client(lib_dir="/opt/oracle/instantclient_23_3") + print('👷 Enable thick mode:', not oracledb.is_thin_mode()) + print('👷 Instant Client version:', oracledb.clientversion()) + + +def run_check() -> int: + cfg = get_named_config() + if not all([cfg.DB_USER_COLIN_ORACLE, cfg.DB_PASSWORD_COLIN_ORACLE, cfg.DB_NAME_COLIN_ORACLE, cfg.DB_HOST_COLIN_ORACLE, cfg.DB_PORT_COLIN_ORACLE]): + raise RuntimeError( + "Missing colin env vars" + ) + print(f"[business-api] connecting to {cfg.SQLALCHEMY_DATABASE_URI_COLIN_ORACLE}") + _colin_oracle_init() + engine = create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_ORACLE) + with engine.connect() as conn: + row = conn.execute(text("SELECT * FROM corporation FETCH FIRST 1 ROWS ONLY")).mappings().first() + if row is None: + print("no rows in COLIN db") + else: + print(f"COLIN sample row: {dict(row)}") + return 0 + + +if __name__ == "__main__": + try: + raise SystemExit(run_check()) + except Exception as exc: + print(f"business db check failed: {exc}", file=sys.stderr) + raise diff --git a/jobs/colin-extract-refresh/config.py b/jobs/colin-extract-refresh/config.py new file mode 100644 index 0000000000..7b68092720 --- /dev/null +++ b/jobs/colin-extract-refresh/config.py @@ -0,0 +1,146 @@ +# Copyright © 2026 Province of British Columbia +# +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""All of the configuration for the service is captured here. + +All items are loaded, or have Constants defined here that +are loaded into the Flask configuration. +All modules and lookups get their configuration from the +Flask config, rather than reading environment variables directly +or by accessing this configuration directly. +""" +import os +import sys + +from dotenv import find_dotenv, load_dotenv + + +# this will load all the envars from a .env file located in the project root (api) +load_dotenv(find_dotenv()) + + +def _get_int(name: str, default: int = 0) -> int: + """Safe int env parsing that avoids None.isnumeric() crashes.""" + val = os.getenv(name) + return int(val) if (val and val.isnumeric()) else default + + +def _get_strict_int(name: str, default: int = 0) -> int: + """Parse an integer env var, raising when a non-blank value is invalid.""" + val = os.getenv(name) + if val is None or val.strip() == '': + return default + try: + return int(val) + except ValueError as exc: + raise ValueError(f'{name} must be a valid integer') from exc + + +def _get_bool(name: str, default: bool = False) -> bool: + """Safe bool env parsing (case-insensitive).""" + val = os.getenv(name) + if val is None: + return default + return val.strip().lower() == 'true' + + +def get_named_config(config_name: str = 'production'): + """Return the configuration object based on the name. + + :raise: KeyError: if an unknown configuration is requested + """ + if config_name in ['production', 'staging', 'default']: + config = ProdConfig() + elif config_name == 'testing': + config = TestConfig() + elif config_name == 'development': + config = DevConfig() + else: + raise KeyError(f'Unknown configuration: {config_name}') + return config + + +class _Config(): # pylint: disable=too-few-public-methods + """Base class configuration that should set reasonable defaults. + + Used as the base for all the other configurations. + """ + + DATA_LOAD_ENV = os.getenv('DATA_LOAD_ENV', '') + + # POSTGRESQL COLIN MIGRATION DB + DB_USER_COLIN_MIGR = os.getenv('DATABASE_USERNAME_COLIN_MIGR', '') + DB_PASSWORD_COLIN_MIGR = os.getenv('DATABASE_PASSWORD_COLIN_MIGR', '') + DB_NAME_COLIN_MIGR = os.getenv('DATABASE_NAME_COLIN_MIGR', '') + DB_HOST_COLIN_MIGR = os.getenv('DATABASE_HOST_COLIN_MIGR', '') + DB_PORT_COLIN_MIGR = os.getenv('DATABASE_PORT_COLIN_MIGR', '5432') + SQLALCHEMY_DATABASE_URI_COLIN_MIGR = 'postgresql://{user}:{password}@{host}:{port}/{name}'.format( + user=DB_USER_COLIN_MIGR, + password=DB_PASSWORD_COLIN_MIGR, + host=DB_HOST_COLIN_MIGR, + port=int(DB_PORT_COLIN_MIGR), + name=DB_NAME_COLIN_MIGR, + ) + SQLALCHEMY_TRACK_MODIFICATIONS = os.getenv('SQLALCHEMY_TRACK_MODIFICATIONS', False) + + + DATABASE_POOL_PRE_PING = os.getenv('DATABASE_POOL_PRE_PING', 'True') == 'True' + DATABASE_POOL_SIZE = os.getenv('DATABASE_POOL_SIZE', '5') + DATABASE_MAX_OVERFLOW = os.getenv('DATABASE_MAX_OVERFLOW', '10') + + SQLALCHEMY_ENGINE_OPTIONS = { + "pool_pre_ping": DATABASE_POOL_PRE_PING, + "pool_size": int(DATABASE_POOL_SIZE), + "max_overflow": int(DATABASE_MAX_OVERFLOW) + } + + # ORACLE COLIN DB + DB_USER_COLIN_ORACLE = os.getenv('DATABASE_USERNAME_COLIN_ORACLE', '') + DB_PASSWORD_COLIN_ORACLE = os.getenv('DATABASE_PASSWORD_COLIN_ORACLE', '') + DB_NAME_COLIN_ORACLE = os.getenv('DATABASE_NAME_COLIN_ORACLE', '') + DB_HOST_COLIN_ORACLE = os.getenv('DATABASE_HOST_COLIN_ORACLE', '') + DB_PORT_COLIN_ORACLE = os.getenv('DATABASE_PORT_COLIN_ORACLE', '1521') + SQLALCHEMY_DATABASE_URI_COLIN_ORACLE = 'oracle+oracledb://{user}:{password}@{host}:{port}/{name}'.format( + user=DB_USER_COLIN_ORACLE, + password=DB_PASSWORD_COLIN_ORACLE, + host=DB_HOST_COLIN_ORACLE, + port=int(DB_PORT_COLIN_ORACLE), + name=DB_NAME_COLIN_ORACLE, + ) + + TESTING = False + DEBUG = False + + +class DevConfig(_Config): # pylint: disable=too-few-public-methods + """Creates the Development Config object.""" + + TESTING = False + DEBUG = True + + +class TestConfig(_Config): # pylint: disable=too-few-public-methods + """In support of testing only. + + Used by the py.test suite + """ + + DEBUG = True + TESTING = True + + +class ProdConfig(_Config): # pylint: disable=too-few-public-methods + """Production environment configuration.""" + + TESTING = False + DEBUG = False diff --git a/jobs/colin-extract-refresh/openshift/Readme.md b/jobs/colin-extract-refresh/openshift/Readme.md new file mode 100644 index 0000000000..c8cd8e76bd --- /dev/null +++ b/jobs/colin-extract-refresh/openshift/Readme.md @@ -0,0 +1 @@ +# test extract job \ No newline at end of file diff --git a/jobs/colin-extract-refresh/openshift/templates/bc.yaml b/jobs/colin-extract-refresh/openshift/templates/bc.yaml new file mode 100644 index 0000000000..e0426c7dcb --- /dev/null +++ b/jobs/colin-extract-refresh/openshift/templates/bc.yaml @@ -0,0 +1,21 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + labels: + app: ${NAME} + name: ${NAME}-build +objects: +- apiVersion: v1 + kind: ImageStream + metadata: + name: ${NAME} + labels: + app: ${NAME} +parameters: + - description: | + The name assigned to all of the objects defined in this template. + You should keep this as default unless your know what your doing. + displayName: Name + name: NAME + required: true + value: colin-extract-refresh diff --git a/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml new file mode 100644 index 0000000000..0a512b6fbc --- /dev/null +++ b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml @@ -0,0 +1,137 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + labels: + name: ${NAME} + name: ${NAME}-cronjob +objects: +- kind: "CronJob" + apiVersion: "batch/v1" + metadata: + name: "${NAME}-${TAG}" + labels: + name: "${NAME}" + environment: "${TAG}" + role: "${ROLE}" + spec: + schedule: "${SCHEDULE}" + concurrencyPolicy: "Forbid" + successfulJobsHistoryLimit: ${SUCCESS_JOBS_HISTORY_LIMIT} + failedJobsHistoryLimit: ${FAILED_JOBS_HISTORY_LIMIT} + jobTemplate: + metadata: + labels: + name: "${NAME}" + environment: "${TAG}" + role: "${ROLE}" + spec: + backoffLimit: ${JOB_BACKOFF_LIMIT} + activeDeadlineSeconds: ${ACTIVE_DEADLINE_SECONDS} + template: + metadata: + labels: + name: "${NAME}" + environment: "${TAG}" + role: "${ROLE}" + spec: + containers: + - name: "${NAME}-${TAG}" + image: "${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/${NAME}:${TAG}" + imagePullPolicy: Always + envFrom: + - secretRef: + name: ${APP_SECRET_NAME} + resources: + requests: + cpu: "${CPU_REQUEST}" + memory: "${MEMORY_REQUEST}" + limits: + cpu: "${CPU_LIMIT}" + memory: "${MEMORY_LIMIT}" +parameters: + + - name: NAME + displayName: Name + description: The name assigned to all of the OpenShift resources associated to the server instance. + required: true + value: colin-extract-refresh + + - name: TAG + displayName: Environment TAG name + description: The TAG name for this environment, e.g., dev, test, prod + value: dev + required: true + + - name: ROLE + displayName: Role + description: Role + required: true + value: job + + + - name: IMAGE_NAMESPACE + displayName: Image Namespace + required: true + description: The namespace of the OpenShift project containing the imagestream for the application. + value: cc892f-tools + + - name: IMAGE_REGISTRY + displayName: Image Registry + required: true + description: The image registry of the OpenShift project. + value: image-registry.openshift-image-registry.svc:5000 + + - name: APP_SECRET_NAME + displayName: App Secret Name + description: Secret with business-api and colin-api + required: true + value: colin-extract-refresh-secret + + - name: "SCHEDULE" + displayName: "Cron Schedule" + description: "Cron Schedule to Execute the Job (using local cluster system TZ) to run at 0:55 * * TUE-SAT at pacific time so it will be 7:55 at UTC" + value: "55 7 * * TUE-SAT" + required: true + + - name: "SUCCESS_JOBS_HISTORY_LIMIT" + displayName: "Successful Job History Limit" + description: "The number of successful jobs that will be retained" + value: "5" + required: true + + - name: "FAILED_JOBS_HISTORY_LIMIT" + displayName: "Failed Job History Limit" + description: "The number of failed jobs that will be retained" + value: "2" + required: true + + - name: "JOB_BACKOFF_LIMIT" + displayName: "Job Backoff Limit" + description: "The number of attempts to try for a successful job outcome" + value: "0" + required: false + + - name: ACTIVE_DEADLINE_SECONDS + displayName: Active deadline seconds + required: true + value: "300" + + - name: CPU_REQUEST + displayName: CPU request + required: true + value: 50m + + - name: CPU_LIMIT + displayName: CPU limit + required: true + value: 200m + + - name: MEMORY_REQUEST + displayName: memory request + required: true + value: 128Mi + + - name: MEMORY_LIMIT + displayName: Memory Limit + required: true + value: 512Mi \ No newline at end of file diff --git a/jobs/colin-extract-refresh/requirements.txt b/jobs/colin-extract-refresh/requirements.txt new file mode 100644 index 0000000000..399c01c0d2 --- /dev/null +++ b/jobs/colin-extract-refresh/requirements.txt @@ -0,0 +1,4 @@ +SQLAlchemy==2.0.36 +psycopg2-binary==2.9.9 +oracledb==3.1.1 +python-dotenv==1.1.1 \ No newline at end of file diff --git a/jobs/colin-extract-refresh/setup.cfg b/jobs/colin-extract-refresh/setup.cfg new file mode 100644 index 0000000000..95a2b3967e --- /dev/null +++ b/jobs/colin-extract-refresh/setup.cfg @@ -0,0 +1,3 @@ +[flake8] +exclude = .git,.venv +max-line-length = 120 diff --git a/jobs/colin-extract-refresh/setup.py b/jobs/colin-extract-refresh/setup.py new file mode 100644 index 0000000000..3f51a3d92b --- /dev/null +++ b/jobs/colin-extract-refresh/setup.py @@ -0,0 +1,22 @@ +# Copyright © 2019 Province of British Columbia. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Installer and setup for this module.""" + +from setuptools import find_packages, setup + + +setup( + name='colin-extract-refresh', + packages=find_packages() +) diff --git a/jobs/colin-extract-refresh/test_connectivity.py b/jobs/colin-extract-refresh/test_connectivity.py new file mode 100644 index 0000000000..84079f9aa2 --- /dev/null +++ b/jobs/colin-extract-refresh/test_connectivity.py @@ -0,0 +1,18 @@ +import sys + +from checks.check_business import run_check as run_business_check +from checks.check_colin import run_check as run_colin_check + +def main() -> int: + print("== running test_connectivity.py ==") + # run_business_check() + run_colin_check() + print("== done test_connectivity.py ==") + return 0 + + +if __name__ == "__main__": + try: + raise SystemExit(main()) + except Exception as exc: + print(f"[test-connectivity] failed: {exc}", file=sys.stderr) \ No newline at end of file From 3aa7df2d53600b1f8c76775fabfbc0c41216eda0 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 1 Jun 2026 16:31:54 -0700 Subject: [PATCH 02/20] updated config --- .../openshift/templates/cronjob.yaml | 66 ++++++++----------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml index 0a512b6fbc..c716ae715e 100644 --- a/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml +++ b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml @@ -15,9 +15,9 @@ objects: role: "${ROLE}" spec: schedule: "${SCHEDULE}" - concurrencyPolicy: "Forbid" - successfulJobsHistoryLimit: ${SUCCESS_JOBS_HISTORY_LIMIT} - failedJobsHistoryLimit: ${FAILED_JOBS_HISTORY_LIMIT} + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 1 jobTemplate: metadata: labels: @@ -25,8 +25,8 @@ objects: environment: "${TAG}" role: "${ROLE}" spec: - backoffLimit: ${JOB_BACKOFF_LIMIT} - activeDeadlineSeconds: ${ACTIVE_DEADLINE_SECONDS} + backoffLimit: 0 + activeDeadlineSeconds: 300 template: metadata: labels: @@ -36,18 +36,24 @@ objects: spec: containers: - name: "${NAME}-${TAG}" - image: "${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/${NAME}:${TAG}" + image: "${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/${NAME}:${IMAGE_TAG}" imagePullPolicy: Always + command: + - python + - /opt/app-root/test_connectivity.py envFrom: - secretRef: - name: ${APP_SECRET_NAME} - resources: - requests: - cpu: "${CPU_REQUEST}" - memory: "${MEMORY_REQUEST}" - limits: - cpu: "${CPU_LIMIT}" - memory: "${MEMORY_LIMIT}" + name: ${APP_SECRET_NAME} + resources: + requests: + cpu: "${CPU_REQUEST}" + memory: "${MEMORY_REQUEST}" + limits: + cpu: "${CPU_LIMIT}" + memory: "${MEMORY_LIMIT}" + restartPolicy: Never + terminationGracePeriodSeconds: 30 + parameters: - name: NAME @@ -68,13 +74,18 @@ parameters: required: true value: job - - name: IMAGE_NAMESPACE displayName: Image Namespace required: true description: The namespace of the OpenShift project containing the imagestream for the application. value: cc892f-tools + - name: IMAGE_TAG + displayName: Environment TAG name + description: The TAG name for this environment, e.g., dev, test, prod + value: dev + required: true + - name: IMAGE_REGISTRY displayName: Image Registry required: true @@ -87,35 +98,12 @@ parameters: required: true value: colin-extract-refresh-secret - - name: "SCHEDULE" + - name: SCHEDULE displayName: "Cron Schedule" description: "Cron Schedule to Execute the Job (using local cluster system TZ) to run at 0:55 * * TUE-SAT at pacific time so it will be 7:55 at UTC" value: "55 7 * * TUE-SAT" required: true - - name: "SUCCESS_JOBS_HISTORY_LIMIT" - displayName: "Successful Job History Limit" - description: "The number of successful jobs that will be retained" - value: "5" - required: true - - - name: "FAILED_JOBS_HISTORY_LIMIT" - displayName: "Failed Job History Limit" - description: "The number of failed jobs that will be retained" - value: "2" - required: true - - - name: "JOB_BACKOFF_LIMIT" - displayName: "Job Backoff Limit" - description: "The number of attempts to try for a successful job outcome" - value: "0" - required: false - - - name: ACTIVE_DEADLINE_SECONDS - displayName: Active deadline seconds - required: true - value: "300" - - name: CPU_REQUEST displayName: CPU request required: true From 97c2cdd9d66fc8c4bfcebb0f8b6a64d272e81f5d Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Wed, 3 Jun 2026 10:22:31 -0700 Subject: [PATCH 03/20] updated installation for oracle instant client --- jobs/colin-extract-refresh/Dockerfile | 29 ++++++++++++------- .../checks/check_colin.py | 2 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 2fc835a684..a327c66ec9 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -6,7 +6,7 @@ ARG BUILD_DATE="missing" ENV VCS_REF=${VCS_REF} ENV BUILD_DATE=${BUILD_DATE} ENV PYTHONUNBUFFERED=1 -ENV ORACLE_CLIENT_LIB_DIR=/opt/oracle/instantclient_21_1 +# ENV ORACLE_CLIENT_LIB_DIR=/opt/oracle/instantclient_21_1 # Configure Jupyter to use user-writable paths @@ -17,18 +17,25 @@ LABEL org.label-schema.vcs-ref=${VCS_REF} \ USER root -WORKDIR /opt/oracle + +ENV LD_LIBRARY_PATH=/opt/oracle/instantclient_21_4 RUN apt-get update; \ - apt-get install -y --no-install-recommends libaiol wget unzip ca-certificates; \ - wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-basiclite-linux.x64-21.1.0.0.0.zip; \ - unzip instantclient-basiclite-linux.x64-21.1.0.0.0.zip; \ - rm -f instantclient-basiclite-linux.x64-21.1.0.0.0.zip; \ - cd "${ORACLE_CLIENT_LIB_DIR}"; \ - rm -f *jdbc* *occi* *mysql* *README *jar uidvrci genezi adrci; \ - echo "${ORACLE_CLIENT_LIB_DIR}" > /etc/ld.so.conf.d/oracle-instantclient.conf; \ - ldconfig; \ - rm -rf /var/lib/apt/lists/* + apt-get install -y libpq-dev zlib1g-dev build-essential shared-mime-info libaio1 libaio-dev unzip wget --no-install-recommends; \ + wget https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-sdk-linux.x64-21.4.0.0.0dbru.zip; \ + wget https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-sqlplus-linux.x64-21.4.0.0.0dbru.zip; \ + wget https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip; \ + mkdir -p /opt/oracle; \ + cp instantclient-* /opt/oracle/ ; \ + cd /opt/oracle/ ; \ + unzip instantclient-basic-linux.x64-21.4.0.0.0dbru.zip ; \ + unzip instantclient-sdk-linux.x64-21.4.0.0.0dbru.zip ; \ + unzip instantclient-sqlplus-linux.x64-21.4.0.0.0dbru.zip ; \ + rm -rf /var/lib/apt/lists/* instantclient-basic-linux.x64-21.4.0.0.0dbru.zip instantclient-sdk-linux.x64-21.4.0.0.0dbru.zip instantclient-sqlplus-linux.x64-21.4.0.0.0dbru.zip ; \ + apt -y clean ; \ + apt -y remove wget unzip ; \ + apt -y autoremove ; \ + rm -rf /var/cache/apt # Create directories with proper permissions RUN mkdir -p /opt/app-root && \ diff --git a/jobs/colin-extract-refresh/checks/check_colin.py b/jobs/colin-extract-refresh/checks/check_colin.py index 3aff61aaee..60c22aaac1 100644 --- a/jobs/colin-extract-refresh/checks/check_colin.py +++ b/jobs/colin-extract-refresh/checks/check_colin.py @@ -4,7 +4,7 @@ from config import get_named_config def _colin_oracle_init() -> None: - oracledb.init_oracle_client(lib_dir="/opt/oracle/instantclient_23_3") + oracledb.init_oracle_client(lib_dir="/opt/oracle/instantclient_21_4") print('👷 Enable thick mode:', not oracledb.is_thin_mode()) print('👷 Instant Client version:', oracledb.clientversion()) From 2687d3659d57abbe16b9977f037df8cabd6793e1 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Wed, 3 Jun 2026 12:11:48 -0700 Subject: [PATCH 04/20] updated --- jobs/colin-extract-refresh/Dockerfile | 45 ++++++++++--------- .../checks/check_colin.py | 4 +- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index a327c66ec9..059d604555 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -6,10 +6,10 @@ ARG BUILD_DATE="missing" ENV VCS_REF=${VCS_REF} ENV BUILD_DATE=${BUILD_DATE} ENV PYTHONUNBUFFERED=1 -# ENV ORACLE_CLIENT_LIB_DIR=/opt/oracle/instantclient_21_1 -# Configure Jupyter to use user-writable paths + + LABEL org.label-schema.vcs-ref=${VCS_REF} \ org.label-schema.build-date=${BUILD_DATE} @@ -17,25 +17,28 @@ LABEL org.label-schema.vcs-ref=${VCS_REF} \ USER root - -ENV LD_LIBRARY_PATH=/opt/oracle/instantclient_21_4 - -RUN apt-get update; \ - apt-get install -y libpq-dev zlib1g-dev build-essential shared-mime-info libaio1 libaio-dev unzip wget --no-install-recommends; \ - wget https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-sdk-linux.x64-21.4.0.0.0dbru.zip; \ - wget https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-sqlplus-linux.x64-21.4.0.0.0dbru.zip; \ - wget https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip; \ - mkdir -p /opt/oracle; \ - cp instantclient-* /opt/oracle/ ; \ - cd /opt/oracle/ ; \ - unzip instantclient-basic-linux.x64-21.4.0.0.0dbru.zip ; \ - unzip instantclient-sdk-linux.x64-21.4.0.0.0dbru.zip ; \ - unzip instantclient-sqlplus-linux.x64-21.4.0.0.0dbru.zip ; \ - rm -rf /var/lib/apt/lists/* instantclient-basic-linux.x64-21.4.0.0.0dbru.zip instantclient-sdk-linux.x64-21.4.0.0.0dbru.zip instantclient-sqlplus-linux.x64-21.4.0.0.0dbru.zip ; \ - apt -y clean ; \ - apt -y remove wget unzip ; \ - apt -y autoremove ; \ - rm -rf /var/cache/apt +ENV ORACLE_CLIENT_LIB_DIR=/opt/oracle/instantclient_21_4 +ENV LD_LIBRARY_PATH=${ORACLE_CLIENT_LIB_DIR} + + +WORKDIR /opt/oracle/ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends unzip wget ca-certificates;\ + apt-get install -y --no-install-recommends libaio1 || apt-get install -y --no-install-recommends libaio1t64; \ + ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 || true; \ + ln -sf /lib/x86_64-linux-gnu/libaio.so.1t64 /lib/x86_64-linux-gnu/libaio.so.1 || true; \ + wget -q https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip; \ + unzip instantclient-basic-linux.x64-21.4.0.0.0dbru.zip; \ + rm instantclient-basic-linux.x64-21.4.0.0.0dbru.zip; \ + cd "${ORACLE_CLIENT_LIB_DIR}"; \ + rm -f *jdbc* *occi* *mysql* *README *jar uidrvci genezi adrci; \ + test -e libclntsh.so || ln -sf libclntsh.so.* libclntsh.so; \ + test -f libclntsh.so; \ + echo "${ORACLE_CLIENT_LIB_DIR}" > /etc/ld.so.conf.d/oracle-instantclient.conf; \ + ldconfig; \ + chmod 755 "${ORACLE_CLIENT_LIB_DIR}"; \ + rm -rf /var/lib/apt/lists/* # Create directories with proper permissions RUN mkdir -p /opt/app-root && \ diff --git a/jobs/colin-extract-refresh/checks/check_colin.py b/jobs/colin-extract-refresh/checks/check_colin.py index 60c22aaac1..a5ad4697b6 100644 --- a/jobs/colin-extract-refresh/checks/check_colin.py +++ b/jobs/colin-extract-refresh/checks/check_colin.py @@ -1,10 +1,12 @@ +import os import sys import oracledb from sqlalchemy import create_engine, text from config import get_named_config def _colin_oracle_init() -> None: - oracledb.init_oracle_client(lib_dir="/opt/oracle/instantclient_21_4") + lib_dir = os.environ.get("ORACLE_CLIENT_LIB_DIR", "") + oracledb.init_oracle_client(lib_dir=lib_dir) print('👷 Enable thick mode:', not oracledb.is_thin_mode()) print('👷 Instant Client version:', oracledb.clientversion()) From 320bd7b92d49f6045ecdf45632833939ccb71dac Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Wed, 3 Jun 2026 12:14:19 -0700 Subject: [PATCH 05/20] update platform compatibility --- jobs/colin-extract-refresh/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jobs/colin-extract-refresh/Makefile b/jobs/colin-extract-refresh/Makefile index 22425aabe8..a5a17449a0 100644 --- a/jobs/colin-extract-refresh/Makefile +++ b/jobs/colin-extract-refresh/Makefile @@ -5,7 +5,7 @@ CURRENT_ABS_DIR:=$(patsubst %/,%,$(dir $(MKFILE_PATH))) DOCKER_NAME:=colin-extract-refresh TAG_NAME ?= dev - +DOCKER_PLATFORM ?= --platform linux/amd64 ################################################################################# # COMMANDS -- Setup # @@ -22,12 +22,12 @@ run: ## Run the project in local . .venv/bin/activate && python test_connectivity.py build: - docker build -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) \ + docker build ${DOCKER_PLATFORM} -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) \ --build-arg VCS_REF=$$(git -C $(CURRENT_ABS_DIR) rev-parse --short HEAD 2>/dev/null || echo missing) \ --build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") build-nc: - docker build --no-cache -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) + docker build ${DOCKER_PLATFORM} --no-cache -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) run-docker: build docker run --rm --env-file $(CURRENT_ABS_DIR)/.env $(DOCKER_NAME):$(TAG_NAME) From 3b80512fd392d1489e8ed578c802278b8c811731 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Wed, 3 Jun 2026 13:24:24 -0700 Subject: [PATCH 06/20] updated --- jobs/colin-extract-refresh/Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 059d604555..7d4ed21c84 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -49,9 +49,6 @@ WORKDIR /opt/app-root COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -# Copy application files -COPY . . - USER 1001 EXPOSE 8080 From 4bef1965fcd05b0b54f246012aede5b6819b00a7 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Thu, 4 Jun 2026 08:04:25 -0700 Subject: [PATCH 07/20] updated changes --- jobs/colin-extract-refresh/Dockerfile | 2 ++ jobs/colin-extract-refresh/Makefile | 2 +- jobs/colin-extract-refresh/checks/check_business.py | 2 +- jobs/colin-extract-refresh/checks/check_colin.py | 2 +- .../openshift/templates/cronjob.yaml | 10 +++++++++- jobs/colin-extract-refresh/test_connectivity.py | 2 +- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 7d4ed21c84..0210c9b41d 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -53,4 +53,6 @@ USER 1001 EXPOSE 8080 +COPY . . + CMD [ "python", "/opt/app-root/test_connectivity.py" ] diff --git a/jobs/colin-extract-refresh/Makefile b/jobs/colin-extract-refresh/Makefile index a5a17449a0..9b0e254066 100644 --- a/jobs/colin-extract-refresh/Makefile +++ b/jobs/colin-extract-refresh/Makefile @@ -30,7 +30,7 @@ build-nc: docker build ${DOCKER_PLATFORM} --no-cache -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) run-docker: build - docker run --rm --env-file $(CURRENT_ABS_DIR)/.env $(DOCKER_NAME):$(TAG_NAME) + docker run $(DOCKER_NAME):$(TAG_NAME) ################################################################################# # Self Documenting Commands # diff --git a/jobs/colin-extract-refresh/checks/check_business.py b/jobs/colin-extract-refresh/checks/check_business.py index 04345e0800..664c7875ad 100644 --- a/jobs/colin-extract-refresh/checks/check_business.py +++ b/jobs/colin-extract-refresh/checks/check_business.py @@ -9,7 +9,7 @@ def run_check() -> int: raise RuntimeError( "Missing business env vars" ) - print(f"[business-api] connecting to {cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR}") + print(f"connecting to business db.....") engine = create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR) with engine.connect() as conn: row = conn.execute(text("SELECT * FROM corporation LIMIT 1")).mappings().first() diff --git a/jobs/colin-extract-refresh/checks/check_colin.py b/jobs/colin-extract-refresh/checks/check_colin.py index a5ad4697b6..ad2b884f36 100644 --- a/jobs/colin-extract-refresh/checks/check_colin.py +++ b/jobs/colin-extract-refresh/checks/check_colin.py @@ -17,7 +17,7 @@ def run_check() -> int: raise RuntimeError( "Missing colin env vars" ) - print(f"[business-api] connecting to {cfg.SQLALCHEMY_DATABASE_URI_COLIN_ORACLE}") + print(f"connecting to colin db.....") _colin_oracle_init() engine = create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_ORACLE) with engine.connect() as conn: diff --git a/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml index c716ae715e..b47cefc4cb 100644 --- a/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml +++ b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml @@ -53,7 +53,15 @@ objects: memory: "${MEMORY_LIMIT}" restartPolicy: Never terminationGracePeriodSeconds: 30 - + + envFrom: + env: + - name: TEST_KEY + valueFrom: + secretKeyRef: + name: ${NAME}-${TAG}-secret + key: TEST_KEY + optional: true parameters: - name: NAME diff --git a/jobs/colin-extract-refresh/test_connectivity.py b/jobs/colin-extract-refresh/test_connectivity.py index 84079f9aa2..02921b8e3c 100644 --- a/jobs/colin-extract-refresh/test_connectivity.py +++ b/jobs/colin-extract-refresh/test_connectivity.py @@ -5,7 +5,7 @@ def main() -> int: print("== running test_connectivity.py ==") - # run_business_check() + run_business_check() run_colin_check() print("== done test_connectivity.py ==") return 0 From b5bd31a485ea18e864d8b6f829dacf4b591b8242 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Thu, 4 Jun 2026 15:15:37 -0700 Subject: [PATCH 08/20] updated structure --- jobs/colin-extract-refresh/.dockerignore | 19 +++++++++++++++++++ jobs/colin-extract-refresh/Makefile | 4 ++-- .../openshift/templates/cronjob.yaml | 12 +++++------- .../{ => src}/checks/__init__.py | 0 .../{ => src}/checks/check_business.py | 2 +- .../{ => src}/checks/check_colin.py | 2 +- .../colin-extract-refresh/{ => src}/config.py | 0 .../{ => src}/test_connectivity.py | 0 8 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 jobs/colin-extract-refresh/.dockerignore rename jobs/colin-extract-refresh/{ => src}/checks/__init__.py (100%) rename jobs/colin-extract-refresh/{ => src}/checks/check_business.py (95%) rename jobs/colin-extract-refresh/{ => src}/checks/check_colin.py (96%) rename jobs/colin-extract-refresh/{ => src}/config.py (100%) rename jobs/colin-extract-refresh/{ => src}/test_connectivity.py (100%) diff --git a/jobs/colin-extract-refresh/.dockerignore b/jobs/colin-extract-refresh/.dockerignore new file mode 100644 index 0000000000..7015f69fc3 --- /dev/null +++ b/jobs/colin-extract-refresh/.dockerignore @@ -0,0 +1,19 @@ +.env +.env.* +.envrc +.env.local + +.venv +venv +__pycache__ +.pytest_cache +.ruff_cache +*.pytest_cache +.git +.gitignore +Makefile +openshift +README.md +*.md +Dockerfile +.dockerignore \ No newline at end of file diff --git a/jobs/colin-extract-refresh/Makefile b/jobs/colin-extract-refresh/Makefile index 9b0e254066..7faa579aa3 100644 --- a/jobs/colin-extract-refresh/Makefile +++ b/jobs/colin-extract-refresh/Makefile @@ -19,7 +19,7 @@ install: ## Install python virtual environment pip install -Ur requirements.txt run: ## Run the project in local - . .venv/bin/activate && python test_connectivity.py + . .venv/bin/activate && python src/test_connectivity.py build: docker build ${DOCKER_PLATFORM} -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) \ @@ -29,7 +29,7 @@ build: build-nc: docker build ${DOCKER_PLATFORM} --no-cache -t $(DOCKER_NAME):$(TAG_NAME) $(CURRENT_ABS_DIR) -run-docker: build +run-docker: build-nc docker run $(DOCKER_NAME):$(TAG_NAME) ################################################################################# diff --git a/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml index b47cefc4cb..f702c6182b 100644 --- a/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml +++ b/jobs/colin-extract-refresh/openshift/templates/cronjob.yaml @@ -55,13 +55,11 @@ objects: terminationGracePeriodSeconds: 30 envFrom: - env: - - name: TEST_KEY - valueFrom: - secretKeyRef: - name: ${NAME}-${TAG}-secret - key: TEST_KEY - optional: true + secretKeyRef: + name: ${NAME} + key: TEST_KEY + optional: true + parameters: - name: NAME diff --git a/jobs/colin-extract-refresh/checks/__init__.py b/jobs/colin-extract-refresh/src/checks/__init__.py similarity index 100% rename from jobs/colin-extract-refresh/checks/__init__.py rename to jobs/colin-extract-refresh/src/checks/__init__.py diff --git a/jobs/colin-extract-refresh/checks/check_business.py b/jobs/colin-extract-refresh/src/checks/check_business.py similarity index 95% rename from jobs/colin-extract-refresh/checks/check_business.py rename to jobs/colin-extract-refresh/src/checks/check_business.py index 664c7875ad..e30b81bb37 100644 --- a/jobs/colin-extract-refresh/checks/check_business.py +++ b/jobs/colin-extract-refresh/src/checks/check_business.py @@ -9,7 +9,7 @@ def run_check() -> int: raise RuntimeError( "Missing business env vars" ) - print(f"connecting to business db.....") + print("== running check_business.py ==") engine = create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR) with engine.connect() as conn: row = conn.execute(text("SELECT * FROM corporation LIMIT 1")).mappings().first() diff --git a/jobs/colin-extract-refresh/checks/check_colin.py b/jobs/colin-extract-refresh/src/checks/check_colin.py similarity index 96% rename from jobs/colin-extract-refresh/checks/check_colin.py rename to jobs/colin-extract-refresh/src/checks/check_colin.py index ad2b884f36..8c092e89b6 100644 --- a/jobs/colin-extract-refresh/checks/check_colin.py +++ b/jobs/colin-extract-refresh/src/checks/check_colin.py @@ -17,7 +17,7 @@ def run_check() -> int: raise RuntimeError( "Missing colin env vars" ) - print(f"connecting to colin db.....") + print("== running check_colin.py ==") _colin_oracle_init() engine = create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_ORACLE) with engine.connect() as conn: diff --git a/jobs/colin-extract-refresh/config.py b/jobs/colin-extract-refresh/src/config.py similarity index 100% rename from jobs/colin-extract-refresh/config.py rename to jobs/colin-extract-refresh/src/config.py diff --git a/jobs/colin-extract-refresh/test_connectivity.py b/jobs/colin-extract-refresh/src/test_connectivity.py similarity index 100% rename from jobs/colin-extract-refresh/test_connectivity.py rename to jobs/colin-extract-refresh/src/test_connectivity.py From b0e69d91c4a0062f44ac4921539d2810d9e9212e Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Fri, 5 Jun 2026 13:34:28 -0700 Subject: [PATCH 09/20] updated sql connector connection --- jobs/colin-extract-refresh/Dockerfile | 2 +- jobs/colin-extract-refresh/Makefile | 2 +- jobs/colin-extract-refresh/requirements.txt | 5 ++- .../src/checks/check_business.py | 17 ++++--- jobs/colin-extract-refresh/src/config.py | 45 +++++++++++++++---- 5 files changed, 52 insertions(+), 19 deletions(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 0210c9b41d..2e24a62408 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.12-slim ARG VCS_REF="missing" ARG BUILD_DATE="missing" diff --git a/jobs/colin-extract-refresh/Makefile b/jobs/colin-extract-refresh/Makefile index 7faa579aa3..fd41bbcdd9 100644 --- a/jobs/colin-extract-refresh/Makefile +++ b/jobs/colin-extract-refresh/Makefile @@ -13,7 +13,7 @@ DOCKER_PLATFORM ?= --platform linux/amd64 setup: install ## Setup the project install: ## Install python virtual environment - test -f .venv/bin/activate || python3.11 -m venv $(CURRENT_ABS_DIR)/.venv ;\ + test -f .venv/bin/activate || python3.12 -m venv $(CURRENT_ABS_DIR)/.venv ;\ . .venv/bin/activate ;\ pip install --upgrade pip ;\ pip install -Ur requirements.txt diff --git a/jobs/colin-extract-refresh/requirements.txt b/jobs/colin-extract-refresh/requirements.txt index 399c01c0d2..bb3d8536b2 100644 --- a/jobs/colin-extract-refresh/requirements.txt +++ b/jobs/colin-extract-refresh/requirements.txt @@ -1,4 +1,7 @@ SQLAlchemy==2.0.36 psycopg2-binary==2.9.9 oracledb==3.1.1 -python-dotenv==1.1.1 \ No newline at end of file +python-dotenv==1.1.1 +pg8000==1.31.4 +git+https://github.com/bcgov/sbc-connect-common.git@main#subdirectory=python/cloud-sql-connector + diff --git a/jobs/colin-extract-refresh/src/checks/check_business.py b/jobs/colin-extract-refresh/src/checks/check_business.py index e30b81bb37..05fb843ac9 100644 --- a/jobs/colin-extract-refresh/src/checks/check_business.py +++ b/jobs/colin-extract-refresh/src/checks/check_business.py @@ -1,18 +1,21 @@ import sys from sqlalchemy import create_engine, text -from config import get_named_config +from config import get_colin_mig_engine, get_named_config def run_check() -> int: cfg = get_named_config() - if not all([cfg.DB_USER_COLIN_MIGR, cfg.DB_PASSWORD_COLIN_MIGR, cfg.DB_NAME_COLIN_MIGR, cfg.DB_HOST_COLIN_MIGR, cfg.DB_PORT_COLIN_MIGR]): - raise RuntimeError( - "Missing business env vars" - ) + if cfg.CLOUDSQL_INSTANCE_CONNECTION_NAME: + if not all([cfg.CLOUDSQL_INSTANCE_CONNECTION_NAME, cfg.DB_NAME_COLIN_MIGR, cfg.DB_USER_COLIN_MIGR]): + raise RuntimeError( + "Missing business env vars" + ) print("== running check_business.py ==") - engine = create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR) + if cfg.CLOUDSQL_INSTANCE_CONNECTION_NAME: + print(f"connecting via cloud sql connector") + engine = get_colin_mig_engine(cfg) with engine.connect() as conn: - row = conn.execute(text("SELECT * FROM corporation LIMIT 1")).mappings().first() + row = conn.execute(text("SELECT * FROM businesses LIMIT 1")).mappings().first() if row is None: print("no rows in business mig db") else: diff --git a/jobs/colin-extract-refresh/src/config.py b/jobs/colin-extract-refresh/src/config.py index 7b68092720..3bcde0ec7c 100644 --- a/jobs/colin-extract-refresh/src/config.py +++ b/jobs/colin-extract-refresh/src/config.py @@ -23,7 +23,7 @@ import sys from dotenv import find_dotenv, load_dotenv - +from sqlalchemy import create_engine # this will load all the envars from a .env file located in the project root (api) load_dotenv(find_dotenv()) @@ -84,14 +84,22 @@ class _Config(): # pylint: disable=too-few-public-methods DB_NAME_COLIN_MIGR = os.getenv('DATABASE_NAME_COLIN_MIGR', '') DB_HOST_COLIN_MIGR = os.getenv('DATABASE_HOST_COLIN_MIGR', '') DB_PORT_COLIN_MIGR = os.getenv('DATABASE_PORT_COLIN_MIGR', '5432') - SQLALCHEMY_DATABASE_URI_COLIN_MIGR = 'postgresql://{user}:{password}@{host}:{port}/{name}'.format( - user=DB_USER_COLIN_MIGR, - password=DB_PASSWORD_COLIN_MIGR, - host=DB_HOST_COLIN_MIGR, - port=int(DB_PORT_COLIN_MIGR), - name=DB_NAME_COLIN_MIGR, - ) - SQLALCHEMY_TRACK_MODIFICATIONS = os.getenv('SQLALCHEMY_TRACK_MODIFICATIONS', False) + CLOUDSQL_INSTANCE_CONNECTION_NAME = os.getenv('CLOUDSQL_INSTANCE_CONNECTION_NAME', '') + DATABASE_IP_TYPE = os.getenv('DATABASE_IP_TYPE', 'private').lower() + if CLOUDSQL_INSTANCE_CONNECTION_NAME: + SQLALCHEMY_DATABASE_URI_COLIN_MIGR = "postgresql+pg8000://" + + elif DB_HOST_COLIN_MIGR: + SQLALCHEMY_DATABASE_URI_COLIN_MIGR = 'postgresql://{user}:{password}@{host}:{port}/{name}'.format( + user=DB_USER_COLIN_MIGR, + password=DB_PASSWORD_COLIN_MIGR, + host=DB_HOST_COLIN_MIGR, + port=int(DB_PORT_COLIN_MIGR), + name=DB_NAME_COLIN_MIGR, + ) + else: + SQLALCHEMY_DATABASE_URI_COLIN_MIGR = '' + SQLALCHEMY_TRACK_MODIFICATIONS = os.getenv('SQLALCHEMY_TRACK_MODIFICATIONS', False) DATABASE_POOL_PRE_PING = os.getenv('DATABASE_POOL_PRE_PING', 'True') == 'True' @@ -144,3 +152,22 @@ class ProdConfig(_Config): # pylint: disable=too-few-public-methods TESTING = False DEBUG = False + + +def get_colin_mig_conn(cfg: _Config): + from cloud_sql_connector import DBConfig, getconn + config = DBConfig( + instance_name=cfg.CLOUDSQL_INSTANCE_CONNECTION_NAME, + database=cfg.DB_NAME_COLIN_MIGR, + user=cfg.DB_USER_COLIN_MIGR, + ip_type=cfg.DATABASE_IP_TYPE, + schema="public" + ) + return getconn(config) + +def get_colin_mig_engine(cfg: _Config | None = None): + cfg = cfg or get_named_config() + if cfg.CLOUDSQL_INSTANCE_CONNECTION_NAME and cfg.DB_NAME_COLIN_MIGR and cfg.DB_USER_COLIN_MIGR: + return create_engine("postgresql+pg8000://", creator=get_colin_mig_conn) + else: + return create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR) From 4b51b5a94150a7495b9a7b6367231ac21932172b Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Fri, 5 Jun 2026 13:37:41 -0700 Subject: [PATCH 10/20] updated config --- jobs/colin-extract-refresh/src/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jobs/colin-extract-refresh/src/config.py b/jobs/colin-extract-refresh/src/config.py index 3bcde0ec7c..e2f854dffa 100644 --- a/jobs/colin-extract-refresh/src/config.py +++ b/jobs/colin-extract-refresh/src/config.py @@ -168,6 +168,6 @@ def get_colin_mig_conn(cfg: _Config): def get_colin_mig_engine(cfg: _Config | None = None): cfg = cfg or get_named_config() if cfg.CLOUDSQL_INSTANCE_CONNECTION_NAME and cfg.DB_NAME_COLIN_MIGR and cfg.DB_USER_COLIN_MIGR: - return create_engine("postgresql+pg8000://", creator=get_colin_mig_conn) + return create_engine("postgresql+pg8000://", creator=get_colin_mig_conn(cfg)) else: - return create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR) + return create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR, **cfg.SQLALCHEMY_ENGINE_OPTIONS) From 2e1489dee25b0102bfc09056fd2f9200fe74a4ea Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 8 Jun 2026 08:00:34 -0700 Subject: [PATCH 11/20] updated req --- jobs/colin-extract-refresh/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/colin-extract-refresh/requirements.txt b/jobs/colin-extract-refresh/requirements.txt index bb3d8536b2..d8dc4d73b4 100644 --- a/jobs/colin-extract-refresh/requirements.txt +++ b/jobs/colin-extract-refresh/requirements.txt @@ -3,5 +3,5 @@ psycopg2-binary==2.9.9 oracledb==3.1.1 python-dotenv==1.1.1 pg8000==1.31.4 -git+https://github.com/bcgov/sbc-connect-common.git@main#subdirectory=python/cloud-sql-connector +cloud-sql-connector @ git+https://github.com/bcgov/sbc-connect-common.git@main#subdirectory=python/cloud-sql-connector \ No newline at end of file From e783d51cfd7d7a7e526c0ea4a5844d4a63ff7bf2 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 8 Jun 2026 08:48:22 -0700 Subject: [PATCH 12/20] updated connection --- jobs/colin-extract-refresh/src/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/colin-extract-refresh/src/config.py b/jobs/colin-extract-refresh/src/config.py index e2f854dffa..8072acd992 100644 --- a/jobs/colin-extract-refresh/src/config.py +++ b/jobs/colin-extract-refresh/src/config.py @@ -168,6 +168,6 @@ def get_colin_mig_conn(cfg: _Config): def get_colin_mig_engine(cfg: _Config | None = None): cfg = cfg or get_named_config() if cfg.CLOUDSQL_INSTANCE_CONNECTION_NAME and cfg.DB_NAME_COLIN_MIGR and cfg.DB_USER_COLIN_MIGR: - return create_engine("postgresql+pg8000://", creator=get_colin_mig_conn(cfg)) + return create_engine("postgresql+pg8000://", creator=lambda: get_colin_mig_conn(cfg)) else: return create_engine(cfg.SQLALCHEMY_DATABASE_URI_COLIN_MIGR, **cfg.SQLALCHEMY_ENGINE_OPTIONS) From de089930fb4da12a1c773b5db3da7d560c563018 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 8 Jun 2026 09:51:56 -0700 Subject: [PATCH 13/20] adding dbschemacli --- jobs/colin-extract-refresh/Dockerfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 2e24a62408..232b55995d 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -40,14 +40,30 @@ RUN set -eux; \ chmod 755 "${ORACLE_CLIENT_LIB_DIR}"; \ rm -rf /var/lib/apt/lists/* +ENV DBSCHEMA_HOME=/opt/DbSchema +ENV DBSCHEMA_VERSION=10_2_1 + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends default-jre-headless curl;\ + curl -fsSL "https://www.dbschema.com/download/dbschema_linux_10_2_1.tar.gz" -O /tmp/dbschema.tar.gz;\ + tar -xzf /tmp/dbschema.tar.gz -C /opt; \ + rm /tmp/dbschema.tar.gz; \ + curl -fsSL "https://repo1.maven.org/maven2/org/testfx/openjfx-monocle/17.0.10/openjfx-monocle-17.0.10.jar" -o "${DBSCHEMA_HOME}/lib/monocle.jar"; \ + ln -sf "${DBSCHEMA_HOME}/dbschemacli" /usr/local/bin/dbschemacli; \ + test -x "${DBSCHEMA_HOME}/dbschemacli"; \ + rm -rf /var/lib/apt/list/* + + + # Create directories with proper permissions RUN mkdir -p /opt/app-root && \ chmod 755 /opt/app-root WORKDIR /opt/app-root - COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +ENV PATH="${DBSCHEMA_HOME}:${PATH}" USER 1001 From f2dbd7b32e68154967f8346612ed06409c790642 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 8 Jun 2026 10:11:00 -0700 Subject: [PATCH 14/20] updated requiremeents --- jobs/colin-extract-refresh/Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 232b55995d..c76f02ac8c 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -46,13 +46,14 @@ ENV DBSCHEMA_VERSION=10_2_1 RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends default-jre-headless curl;\ - curl -fsSL "https://www.dbschema.com/download/dbschema_linux_10_2_1.tar.gz" -O /tmp/dbschema.tar.gz;\ + curl -fsSL "https://www.dbschema.com/download/dbschema_linux_10_2_1.tar.gz" -o /tmp/dbschema.tar.gz;\ tar -xzf /tmp/dbschema.tar.gz -C /opt; \ rm /tmp/dbschema.tar.gz; \ + mkdir -p "${DBSCHEMA_HOME}/lib"; \ curl -fsSL "https://repo1.maven.org/maven2/org/testfx/openjfx-monocle/17.0.10/openjfx-monocle-17.0.10.jar" -o "${DBSCHEMA_HOME}/lib/monocle.jar"; \ - ln -sf "${DBSCHEMA_HOME}/dbschemacli" /usr/local/bin/dbschemacli; \ - test -x "${DBSCHEMA_HOME}/dbschemacli"; \ - rm -rf /var/lib/apt/list/* + ln -sf "${DBSCHEMA_HOME}/DbSchemaCLI" /usr/local/bin/dbschemacli; \ + test -x "${DBSCHEMA_HOME}/DbSchemaCLI"; \ + rm -rf /var/lib/apt/lists/* @@ -62,7 +63,11 @@ RUN mkdir -p /opt/app-root && \ WORKDIR /opt/app-root COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +RUN apt-get update; \ + apt-get install -y --no-install-recommends git;\ + pip install --no-cache-dir -r requirements.txt;\ + rm -rf /var/lib/apt/lists/* + ENV PATH="${DBSCHEMA_HOME}:${PATH}" USER 1001 @@ -71,4 +76,4 @@ EXPOSE 8080 COPY . . -CMD [ "python", "/opt/app-root/test_connectivity.py" ] +CMD [ "python", "src/test_connectivity.py" ] From 842242da14b1deaf058855ebe4ea25180fc717e8 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 8 Jun 2026 12:39:33 -0700 Subject: [PATCH 15/20] add dummy file to insert timestamp and dbschema cli config build file --- .../scripts/transfer_cprd_corps_insert.sql | 12 ++++++++++++ jobs/colin-extract-refresh/src/dbschemacli_init.py | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 jobs/colin-extract-refresh/scripts/transfer_cprd_corps_insert.sql create mode 100644 jobs/colin-extract-refresh/src/dbschemacli_init.py diff --git a/jobs/colin-extract-refresh/scripts/transfer_cprd_corps_insert.sql b/jobs/colin-extract-refresh/scripts/transfer_cprd_corps_insert.sql new file mode 100644 index 0000000000..a81d9189d3 --- /dev/null +++ b/jobs/colin-extract-refresh/scripts/transfer_cprd_corps_insert.sql @@ -0,0 +1,12 @@ +vset cli.settings.ignore_errors=false +vset cli.settings.transfer_threads=4 +vset format.date=YYYY-MM-dd'T'hh:mm:ss'Z' +vset format.timestamp=YYYY-MM-dd'T'hh:mm:ss'Z' + +connect cdev_pg_test; + +learn schema colin_extract_temp; + +-- cutoff timestamp +insert into colin_extract_temp.colin_extract_version (extracted_at) +values (current_timestamp); diff --git a/jobs/colin-extract-refresh/src/dbschemacli_init.py b/jobs/colin-extract-refresh/src/dbschemacli_init.py new file mode 100644 index 0000000000..fff6b33e84 --- /dev/null +++ b/jobs/colin-extract-refresh/src/dbschemacli_init.py @@ -0,0 +1,12 @@ +from pathlib import Path +from config import _Config + +def write_dbschema_init(cfg: _Config) -> Path: + init_dir = Path.home() / '.DbSchema' / 'cli' + init_dir.mkdir(parents=True, exist_ok=True) + init_path = init_dir / 'init.sql' + db_user = cfg.DB_USER_COLIN_MIGR + + lines = [ + 'register driver PostgreSql org.postgresql.Driver jdbc:postgresql://:/ "port=5432"' + ] From 374270e6b71942822627dc3fcff50324da2477c5 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 8 Jun 2026 14:56:33 -0700 Subject: [PATCH 16/20] setting gc token first --- .../src/generate_gc_token.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 jobs/colin-extract-refresh/src/generate_gc_token.py diff --git a/jobs/colin-extract-refresh/src/generate_gc_token.py b/jobs/colin-extract-refresh/src/generate_gc_token.py new file mode 100644 index 0000000000..48ee566429 --- /dev/null +++ b/jobs/colin-extract-refresh/src/generate_gc_token.py @@ -0,0 +1,21 @@ + +import subprocess +import os + +def connect_to_db(): + print("Generating fresh GCP IAM token...") + try: + token = subprocess.check_output( + ["gcloud", "sql", "generate-login-token"], + text=True + ).strip() + except subprocess.CalledProcessError as e: + print("Error: Make sure you are authenticated with 'gcloud auth login'") + return + + os.environ["GCP_IAM_TOKEN"] = token + + print("Connecting to test_dev via DbSchemaCLI...") + +if __name__ == "__main__": + connect_to_db() From 0f07db5cd148cdd370c624cc68b7d0cccae71793 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 15 Jun 2026 12:16:52 -0700 Subject: [PATCH 17/20] updated logging --- jobs/colin-extract-refresh/src/checks/check_business.py | 4 ++-- jobs/colin-extract-refresh/src/checks/check_colin.py | 6 +++--- jobs/colin-extract-refresh/src/test_connectivity.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jobs/colin-extract-refresh/src/checks/check_business.py b/jobs/colin-extract-refresh/src/checks/check_business.py index 05fb843ac9..4b6c5d604a 100644 --- a/jobs/colin-extract-refresh/src/checks/check_business.py +++ b/jobs/colin-extract-refresh/src/checks/check_business.py @@ -19,7 +19,7 @@ def run_check() -> int: if row is None: print("no rows in business mig db") else: - print(f"sample row: {dict(row)}") + print(f"row found........") return 0 @@ -27,5 +27,5 @@ def run_check() -> int: try: raise SystemExit(run_check()) except Exception as exc: - print(f"business db check failed: {exc}", file=sys.stderr) + print(f"business db check failed......") raise diff --git a/jobs/colin-extract-refresh/src/checks/check_colin.py b/jobs/colin-extract-refresh/src/checks/check_colin.py index 8c092e89b6..e2da3fbb50 100644 --- a/jobs/colin-extract-refresh/src/checks/check_colin.py +++ b/jobs/colin-extract-refresh/src/checks/check_colin.py @@ -23,9 +23,9 @@ def run_check() -> int: with engine.connect() as conn: row = conn.execute(text("SELECT * FROM corporation FETCH FIRST 1 ROWS ONLY")).mappings().first() if row is None: - print("no rows in COLIN db") + print("no rows in COLIN db.") else: - print(f"COLIN sample row: {dict(row)}") + print(f"COLIN sample row found.") return 0 @@ -33,5 +33,5 @@ def run_check() -> int: try: raise SystemExit(run_check()) except Exception as exc: - print(f"business db check failed: {exc}", file=sys.stderr) + print(f"business db check failed.") raise diff --git a/jobs/colin-extract-refresh/src/test_connectivity.py b/jobs/colin-extract-refresh/src/test_connectivity.py index 02921b8e3c..d7d356a1d9 100644 --- a/jobs/colin-extract-refresh/src/test_connectivity.py +++ b/jobs/colin-extract-refresh/src/test_connectivity.py @@ -15,4 +15,4 @@ def main() -> int: try: raise SystemExit(main()) except Exception as exc: - print(f"[test-connectivity] failed: {exc}", file=sys.stderr) \ No newline at end of file + print(f"[test-connectivity] failed") \ No newline at end of file From 75dc918852ec94df977b8d32295951e47210360d Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 15 Jun 2026 12:27:06 -0700 Subject: [PATCH 18/20] updated --- jobs/colin-extract-refresh/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index c76f02ac8c..6e86d13603 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -74,6 +74,6 @@ USER 1001 EXPOSE 8080 -COPY . . +COPY . ./src CMD [ "python", "src/test_connectivity.py" ] From 2046d25dd4e4dc2b8b241e71b42a6c6c0271eadd Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 15 Jun 2026 12:30:56 -0700 Subject: [PATCH 19/20] updated --- jobs/colin-extract-refresh/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 6e86d13603..7f00c1730d 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -74,6 +74,6 @@ USER 1001 EXPOSE 8080 -COPY . ./src +COPY src . CMD [ "python", "src/test_connectivity.py" ] From 89c46452469e50d6e6b1d0aa95c64ec303f82a4d Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Tue, 16 Jun 2026 11:18:05 -0700 Subject: [PATCH 20/20] updated file --- jobs/colin-extract-refresh/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jobs/colin-extract-refresh/Dockerfile b/jobs/colin-extract-refresh/Dockerfile index 7f00c1730d..8105b2e9cd 100644 --- a/jobs/colin-extract-refresh/Dockerfile +++ b/jobs/colin-extract-refresh/Dockerfile @@ -41,12 +41,12 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV DBSCHEMA_HOME=/opt/DbSchema -ENV DBSCHEMA_VERSION=10_2_1 +ENV DBSCHEMA_VERSION=9_7_1 RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends default-jre-headless curl;\ - curl -fsSL "https://www.dbschema.com/download/dbschema_linux_10_2_1.tar.gz" -o /tmp/dbschema.tar.gz;\ + curl -fsSL "https://www.dbschema.com/download/dbschema_linux_9_7_1.tar.gz" -o /tmp/dbschema.tar.gz;\ tar -xzf /tmp/dbschema.tar.gz -C /opt; \ rm /tmp/dbschema.tar.gz; \ mkdir -p "${DBSCHEMA_HOME}/lib"; \