Project

General

Profile

« Previous | Next » 

Revision f96702c4

Added by Ian Ballou about 2 months ago

Fixes #37218 - improve SQLite DB query performance & introduce PostgreSQL support

  • Fixes #37218 - podman login against the container registry returns 500 intermittently
  • Refs #37218 - fix tests for single database connection refactor
  • Refs #37218 - make transactions serialized to avoid concurrent writes & deletes
  • Refs #37218 - make postgres connections possible
  • Refs #37218 - refactor database dependency injection
  • Refs #37218 - add sqlite to postgres migration
  • Refs #37218 - refactor main class to not require database injection

Co-authored-by: Ewoud Kohl van Wijngaarden <>

View differences:

lib/smart_proxy_container_gateway/container_gateway.rb
default_settings :pulp_endpoint => "https://#{`hostname`.strip}",
:katello_registry_path => '/v2/',
:database_backend => 'sqlite',
:sqlite_db_path => '/var/lib/foreman-proxy/smart_proxy_container_gateway.db',
:sqlite_timeout => 30_000
......
validate :pulp_endpoint, url: true
rackup_path File.join(__dir__, 'container_gateway_http_config.ru')
load_dependency_injection_wirings do |container_instance, settings|
container_instance.singleton_dependency :database_impl, (lambda do
Proxy::ContainerGateway::Database.new(
database_backend: settings[:database_backend], sqlite_db_path: settings[:sqlite_db_path],
sqlite_timeout: settings[:sqlite_timeout], postgresql_connection_string: settings[:postgresql_connection_string]
)
end)
container_instance.singleton_dependency :container_gateway_main_impl, (lambda do
Proxy::ContainerGateway::ContainerGatewayMain.new(
database: container_instance.get_dependency(:database_impl),
**settings.slice(:pulp_endpoint, :pulp_client_ssl_ca, :pulp_client_ssl_cert, :pulp_client_ssl_key)
)
end)
end
end
end
end

Also available in: Unified diff