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

Gorm tests #593

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
115 changes: 32 additions & 83 deletions config-examples/odyssey-dev.conf
Original file line number Diff line number Diff line change
@@ -1,98 +1,54 @@
pid_file "/tmp/odyssey.pid"
daemonize yes

unix_socket_dir "/tmp"
unix_socket_mode "0644"

log_format "%p %t %l [%i %s] (%c) %m\n"

log_to_stdout no

log_syslog no
log_syslog_ident "odyssey"
log_syslog_facility "daemon"

log_debug no
log_config yes
log_session yes
log_query no
log_stats yes
stats_interval 60
log_general_stats_prom yes
log_route_stats_prom no
promhttp_server_port 7777

workers "auto"
resolvers 1

readahead 8192

cache_coroutine 0

coroutine_stack_size 16

nodelay yes

keepalive 15
keepalive_keep_interval 75
keepalive_probes 9

keepalive_usr_timeout 0

listen {
host "*"
port 6432
backlog 128
compression yes
tls "disable"
}


storage "postgres_server" {
type "remote"
host "[localhost]:5432,localhost"
port 5550

host "localhost"
port 5432
}

database default {
user default {
authentication "md5"

password "md588cb17a149f659b9a78ec4a33cbb3c7f"
authentication "none"

storage "postgres_server"
pool "transaction"
pool_size 0
# storage_db "db"
# storage_user "user"
# storage_password "password"

# auth_query "SELECT usename, passwd FROM pg_shadow WHERE usename=$1"
# auth_query_db "postgres"
# auth_query_user "reshke"
# storage_password "reshke"
pool "session"

pool_timeout 0
client_fwd_error yes
}
}

pool_ttl 1201
unix_socket_dir "/tmp"
unix_socket_mode "0644"

pool_discard no
log_file "./logs.txt"

pool_cancel yes
log_format "%p %t %l [%i %s] (%c) %m\n"
log_debug yes
log_config yes
log_session yes
log_query yes
log_stats yes
daemonize yes

pool_rollback yes
# seconds
pool_client_idle_timeout 20
# seconds
pool_idle_in_transaction_timeout 20
locks_dir "/tmp/odyssey"
graceful_die_on_errors yes
enable_online_restart no
bindwith_reuseport yes

client_fwd_error yes
application_name_add_host yes
server_lifetime 1901
log_debug no
stats_interval 60

quantiles "0.99,0.95,0.5"
client_max 107
}
pid_file "/tmp/odyssey.pid"

listen {
host "*"
port 6432
}


storage "local" {
type "local"
}
Expand All @@ -105,10 +61,3 @@ database "console" {
storage "local"
}
}


locks_dir "/tmp/odyssey"

graceful_die_on_errors yes
enable_online_restart no
bindwith_reuseport yes
14 changes: 14 additions & 0 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
context: .
environment:
CMAKE_BUILD_TYPE: "${CMAKE_BUILD_TYPE:-Debug}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
od_net:
ipv4_address: 192.168.233.15
Expand All @@ -21,6 +23,18 @@ services:
networks:
od_net:
ipv4_address: 192.168.233.16

# gorm-test:
# build:
# context: https://github.com/pg-sharding/gorm-spqr.git#main
# environment:
# DB_HOST: "odyssey"
# DB_PORT: "6432"
# DB_USER: "spqr-console"
# DB_NAME: "spqr-console"
# networks:
# od_net:
# ipv4_address: 192.168.233.17

networks:
od_net:
Expand Down
15 changes: 14 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev \
vim \
postgresql-common \
postgresql-server-dev-14
postgresql-server-dev-14 \
git

RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
sudo sh get-docker.sh && \
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
sudo chmod +x /usr/local/bin/docker-compose

COPY ./docker/pg/pg_hba-test.conf /etc/postgresql/14/main/pg_hba.conf

COPY ./docker-compose-test.yml /docker-compose-test.yml

RUN touch ./logs.txt

RUN mkdir test_dir
COPY . /test_dir
RUN cd /test_dir && make run_test_prep && cp /test_dir/docker/bin/* /usr/bin/
Expand All @@ -75,6 +85,9 @@ COPY ./docker/ldap /ldap
COPY ./docker/lagpolling /lagpolling
COPY ./docker/shell-test /shell-test
COPY ./docker/tsa /tsa
COPY ./docker/gorm /gorm

COPY . /odyssey_gorm_test

COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh

Expand Down
Loading
Loading