idmtools_platform_local.infrastructure.postgres module#

idmtools postgres service. Used for experiment data.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools_platform_local.infrastructure.postgres.PostgresContainer(container_name: str = 'idmtools_postgres', image: str = 'postgres:11.4', client: DockerClient | None = None, config_prefix: str = 'postgres_', network: str | None = None, host_data_directory: str | None = None, port: int = 5432, mem_limit: str = '128m', mem_reservation: str = '32m', run_as: str | None = None, password: str = 'idmtools', data_volume_name: str = 'idmtools_local_postgres')[source]#

Bases: BaseServiceContainer

Defines the postgres container for the local platform.

host_data_directory: str = None#
port: int = 5432#
mem_limit: str = '128m'#
mem_reservation: str = '32m'#
run_as: str = None#
image: str = 'postgres:11.4'#
container_name: str = 'idmtools_postgres'#
password: str = 'idmtools'#
data_volume_name: str = 'idmtools_local_postgres'#
config_prefix: str = 'postgres_'#
get_configuration() Dict[source]#

Returns the docker config for the postgres container.

Returns:

(dict) Dictionary representing the docker config for the postgres container

create(spinner=None) Container[source]#

Create our postgres container.

Here we create the postgres data volume before creating the container.

create_postgres_volume() NoReturn[source]#

Creates our postgres volume.

Returns:

None

__init__(container_name: str = 'idmtools_postgres', image: str = 'postgres:11.4', client: DockerClient | None = None, config_prefix: str = 'postgres_', network: str | None = None, host_data_directory: str | None = None, port: int = 5432, mem_limit: str = '128m', mem_reservation: str = '32m', run_as: str | None = None, password: str = 'idmtools', data_volume_name: str = 'idmtools_local_postgres') None#