Add relative imports, small bugfixes

This commit is contained in:
Thales Lima
2024-07-17 23:27:36 +02:00
committed by tvinagre
parent c075fdb668
commit 5e6c7d4647
21 changed files with 651 additions and 111 deletions

View File

@@ -1,12 +1,14 @@
version: '3.1'
services:
db:
image: ghcr.io/dbsystel/postgresql-partman:15-5
build:
dockerfile: postgres.Dockerfile
restart: "always"
environment:
POSTGRESQL_PASSWORD: mypassword
POSTGRESQL_DATABASE: tycho_indexer_0
POSTGRESQL_USERNAME: postgres
POSTGRESQL_SHARED_PRELOAD_LIBRARIES: pg_cron
ports:
- "5431:5432"
volumes:

View File

@@ -0,0 +1,16 @@
# This Dockerfile creates a custom postgres image used for CI and local deployment.
# This is required because we use some postgres extensions that aren't in the generic Postgres image such as pg_partman or pg_cron.
# As an image with pg_partman already exist, we start from this one an add pg_cron and possibly other extensions on top of that.
FROM ghcr.io/dbsystel/postgresql-partman:15-5
ARG PGCRON_VERSION="1.6.2"
USER root
RUN cd /tmp \
&& wget "https://github.com/citusdata/pg_cron/archive/refs/tags/v${PGCRON_VERSION}.tar.gz" \
&& tar zxf v${PGCRON_VERSION}.tar.gz \
&& cd pg_cron-${PGCRON_VERSION} \
&& make \
&& make install \
&& cd .. && rm -r pg_cron-${PGCRON_VERSION} v${PGCRON_VERSION}.tar.gz
RUN echo "cron.database_name = 'tycho_indexer_0'" >> /opt/bitnami/postgresql/conf/postgresql.conf
USER 1001

View File

@@ -7,7 +7,9 @@ import os
import psycopg2
from psycopg2 import sql
binary_path = "./testing/tycho-indexer"
from pathlib import Path
binary_path = Path(__file__).parent / "tycho-indexer"
class TychoRunner:
@@ -48,7 +50,7 @@ class TychoRunner:
bufsize=1,
env=env,
)
with process.stdout:
for line in iter(process.stdout.readline, ""):
if line and self.with_binary_logs: