Commit 38aaf749 authored by Huihui, Jonathan's avatar Huihui, Jonathan
Browse files

Merge branch 'develop' into 'main'

Merge develop into main

See merge request eagle-i/common_package!1
parents 98128899 9f050608
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+6 −0
Original line number Diff line number Diff line
# swap files
*.sw[op]
# python build files
build/
__pycache__/
*.egg-info/

Dockerfile

0 → 100644
+14 −0
Original line number Diff line number Diff line
FROM python:3.9-slim

RUN apt-get -yqq update && apt-get -yqq upgrade && \
      apt-get -yqq install vim 

COPY src/ tmp/src


RUN set -eux && pip install --upgrade pip && \
      cd /tmp/src/ && pip install -e . 

COPY ./test/test.py /test/test.py

CMD ['sh', 'tail', '-f', '/dev/null']

NOTES

0 → 100644
+3 −0
Original line number Diff line number Diff line
Connection mixins (override default open behavior and open any kind of database object this way; -- thinking sqlalchemy and psycopg2 for starters)
Pandas mixin (allow for importation of query/schema.table to a pandas dataframe -- not always wanted so having it as a chainable mixin would be nice
CommonException class to catch custom exceptions of the common package -- maybe write to a package /tmp/error.log file?
+27 −0
Original line number Diff line number Diff line
version: '3.7'

services:
  package:
    build: .
    volumes:
      - ./src/:/tmp/src
    environment:
      - DATABASE_HOST=postgres
      - DATABASE_TIMEOUT=60
      - LOGLEVEL=debug
    command: ["sh", "-c", "python3 /test/test.py"]
    depends_on:
      - postgres

  postgres:
    image: postgres
    environment: 
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_DB=postgres
    volumes:
      - ./sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql
      - ./sql/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql

# find what tables already exist in an empty database or initialize a table
# then use that for testing purposes

docker-compose.yaml

0 → 100644
+27 −0
Original line number Diff line number Diff line
version: '3.7'

services:
  package:
    build: .
    volumes:
      - ./src/:/tmp/src
    environment:
      - DATABASE_HOST=postgres
      - DATABASE_TIMEOUT=60
    command:
      - 'tail'
      - '-f'
      - '/dev/null'

  postgres:
    image: postgres:14.0
    environment: 
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_DB=postgres
    volumes:
      - ./sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql
      - ./sql/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql

# find what tables already exist in an empty database or initialize a table
# then use that for testing purposes
Loading