Skip to content

Commit 8896eb4

Browse files
fix(BA-2179): Unify logging configuration in all services (#5614)
Co-authored-by: octodog <[email protected]>
1 parent 3c3fefe commit 8896eb4

File tree

47 files changed

+936
-1019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+936
-1019
lines changed

changes/5614.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix regression of agent's per-package log-level configurations

configs/agent/sample.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,24 @@
151151
## sample-rate = 10
152152

153153
[logging]
154-
# Log level.
154+
# The version used by logging.dictConfig().
155+
version = 1
156+
# The main log level to filter messages from all loggers.
155157
level = "INFO"
156158
# Array of log drivers to print.
157159
drivers = [ "console",]
160+
# Disable the existing loggers when applying the config.
161+
disable-existing-loggers = false
158162
## file = "{ FileConfig }"
159163
## logstash = "{ LogstashConfig }"
160164
## graylog = "{ GraylogConfig }"
161165

166+
# The mapping of log handler configurations.
167+
[logging.handlers]
168+
169+
# The mapping of per-namespace logger configurations.
170+
[logging.loggers]
171+
162172
[logging.console]
163173
# Opt to print colorized log.
164174
## colored = true

configs/manager/sample.toml

Lines changed: 40 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
# Type of the database system to use.
1111
# Currently, only PostgreSQL is supported as the main database backend.
1212
type = "postgresql"
13+
# Network address and port of the database server.
14+
# Default is the standard PostgreSQL port on localhost.
15+
addr = { host = "127.0.0.1", port = 5432 }
1316
# Database name to use.
1417
# This database must exist and be accessible by the configured user.
1518
# Length must be between 2 and 64 characters due to database naming constraints.
@@ -43,16 +46,6 @@
4346
# If connections cannot be acquired within this time, an exception is raised.
4447
lock-conn-timeout = 0
4548

46-
[db.addr]
47-
# Host address of the service.
48-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
49-
# all interfaces.
50-
host = "127.0.0.1"
51-
# Port number of the service.
52-
# Must be between 1 and 65535.
53-
# Ports below 1024 require root/admin privileges.
54-
port = 8080
55-
5649
[etcd]
5750
# Namespace prefix for etcd keys used by Backend.AI.
5851
# Allows multiple Backend.AI clusters to share the same etcd cluster.
@@ -94,6 +87,20 @@
9487
# If not specified, defaults to the GID of the server.py file.
9588
# Important for proper file permissions when creating files/sockets.
9689
## group = "501"
90+
# Network address and port where the manager service will listen.
91+
# Default is all interfaces (0.0.0.0) on port 8080.
92+
# For private deployments, consider using 127.0.0.1 instead.
93+
service-addr = { host = "0.0.0.0", port = 8080 }
94+
# Address and port to announce to other components.
95+
# This is used for service discovery and should be accessible by other
96+
# components.
97+
announce-addr = { host = "127.0.0.1", port = 5432 }
98+
# Address and port to announce for internal API requests.
99+
# This is used for service discovery and should be accessible by other
100+
# components.
101+
announce-internal-addr = { host = "host.docker.internal", port = 18080 }
102+
# Set the internal hostname/port to accept internal API requests.
103+
internal-addr = { host = "0.0.0.0", port = 18080 }
97104
# Path to the keypair file used for RPC authentication.
98105
# This file contains key pairs used for secure communication between manager
99106
# components.
@@ -205,46 +212,11 @@
205212
# If specified, metrics will be available at this port.
206213
# Leave as None to disable public metrics exposure.
207214
## public-metrics-port = 8080 # min=1 max=65535
208-
209-
[manager.service-addr]
210-
# Host address of the service.
211-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
212-
# all interfaces.
213-
host = "127.0.0.1"
214-
# Port number of the service.
215-
# Must be between 1 and 65535.
216-
# Ports below 1024 require root/admin privileges.
217-
port = 8080
218-
219-
[manager.announce-addr]
220-
# Host address of the service.
221-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
222-
# all interfaces.
223-
host = "127.0.0.1"
224-
# Port number of the service.
225-
# Must be between 1 and 65535.
226-
# Ports below 1024 require root/admin privileges.
227-
port = 8080
228-
229-
[manager.announce-internal-addr]
230-
# Host address of the service.
231-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
232-
# all interfaces.
233-
host = "127.0.0.1"
234-
# Port number of the service.
235-
# Must be between 1 and 65535.
236-
# Ports below 1024 require root/admin privileges.
237-
port = 8080
238-
239-
[manager.internal-addr]
240-
# Host address of the service.
241-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
242-
# all interfaces.
243-
host = "127.0.0.1"
244-
# Port number of the service.
245-
# Must be between 1 and 65535.
246-
# Ports below 1024 require root/admin privileges.
247-
port = 8080
215+
# Whether to use the Sokovan orchestrator for session scheduling.
216+
# When enabled, uses the new Sokovan orchestrator for improved scheduling
217+
# performance.
218+
# When disabled, falls back to the legacy scheduling system.
219+
use-sokovan = true
248220

249221
# Configuration for PostgreSQL advisory locks.
250222
# This is used when distributed_lock is set to pg_advisory.
@@ -270,14 +242,24 @@
270242
ssl-verify = true
271243

272244
[logging]
273-
# Log level.
245+
# The version used by logging.dictConfig().
246+
version = 1
247+
# The main log level to filter messages from all loggers.
274248
level = "INFO"
275249
# Array of log drivers to print.
276250
drivers = [ "console",]
251+
# Disable the existing loggers when applying the config.
252+
disable-existing-loggers = false
277253
## file = "{ FileConfig }"
278254
## logstash = "{ LogstashConfig }"
279255
## graylog = "{ GraylogConfig }"
280256

257+
# The mapping of log handler configurations.
258+
[logging.handlers]
259+
260+
# The mapping of per-namespace logger configurations.
261+
[logging.loggers]
262+
281263
[logging.console]
282264
# Opt to print colorized log.
283265
## colored = true
@@ -393,6 +375,11 @@
393375
# Controls how long operations wait before timing out.
394376
# If None, uses the default timeout configured in the Redis client.
395377
## request_timeout =
378+
# Whether to use TLS for Redis connections.
379+
use_tls = false
380+
# Whether to skip TLS certificate verification.
381+
# Set to True for self-signed certificates or development environments.
382+
tls_skip_verify = false
396383
# Optional override configurations for specific Redis contexts.
397384
# Allows different Redis settings for different services within Backend.AI.
398385
# Each key represents a context name, and the value is a complete Redis
@@ -507,21 +494,13 @@
507494
## TERMINATING = "..."
508495

509496
[metric]
497+
# Address for the metric collection service.
498+
addr = { host = "127.0.0.1", port = 9090 }
510499
# Time window for metric collection.
511500
# Controls how often metrics are collected and reported.
512501
# Format is a duration string like "1h" for 1 hour.
513502
timewindow = "1m"
514503

515-
[metric.addr]
516-
# Host address of the service.
517-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
518-
# all interfaces.
519-
host = "127.0.0.1"
520-
# Port number of the service.
521-
# Must be between 1 and 65535.
522-
# Ports below 1024 require root/admin privileges.
523-
port = 8080
524-
525504
[volumes]
526505
# Default volume host for new virtual folders.
527506
# Format is "proxy_name:volume_name".

configs/storage-proxy/sample.toml

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66
#
77
# Generated automatically from the StorageProxyUnifiedConfig schema.
88

9-
# Configuration for external registries.
10-
# Defines how to connect and interact with external model registries.
9+
# List of object storage configurations.
10+
# Each configuration defines how to connect to and use an object storage
11+
# service.
12+
storages = []
13+
# List of artifact registry configurations.
14+
# Each configuration defines how to connect to and use an artifact registry
15+
# service.
1116
registries = []
1217

1318
[storage-proxy]
@@ -83,14 +88,24 @@ registries = []
8388
## sample-rate = 10
8489

8590
[logging]
86-
# Log level.
91+
# The version used by logging.dictConfig().
92+
version = 1
93+
# The main log level to filter messages from all loggers.
8794
level = "INFO"
8895
# Array of log drivers to print.
8996
drivers = [ "console",]
97+
# Disable the existing loggers when applying the config.
98+
disable-existing-loggers = false
9099
## file = "{ FileConfig }"
91100
## logstash = "{ LogstashConfig }"
92101
## graylog = "{ GraylogConfig }"
93102

103+
# The mapping of log handler configurations.
104+
[logging.handlers]
105+
106+
# The mapping of per-namespace logger configurations.
107+
[logging.loggers]
108+
94109
[logging.console]
95110
# Opt to print colorized log.
96111
## colored = true
@@ -102,6 +117,9 @@ registries = []
102117

103118
[api]
104119
[api.client]
120+
# Network address and port where the client API service will listen.
121+
# This is the address accessible by clients for file operations.
122+
service-addr = { host = "127.0.0.1", port = 6021 }
105123
# Whether to enable SSL/TLS for client API connections.
106124
# Required for secure communication with clients.
107125
ssl-enabled = true
@@ -112,17 +130,19 @@ registries = []
112130
# Required if ssl_enabled is True.
113131
## ssl-privkey = "/etc/ssl/private/storage-proxy.key"
114132

115-
[api.client.service-addr]
116-
# Host address of the service.
117-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
118-
# all interfaces.
119-
host = "127.0.0.1"
120-
# Port number of the service.
121-
# Must be between 1 and 65535.
122-
# Ports below 1024 require root/admin privileges.
123-
port = 8080
124-
125133
[api.manager]
134+
# Network address and port where the manager API service will listen.
135+
# This is the address accessible by managers for control operations.
136+
service-addr = { host = "127.0.0.1", port = 6022 }
137+
# Address and port to announce to managers for service discovery.
138+
# Should be accessible by other manager components.
139+
announce-addr = { host = "127.0.0.1", port = 6022 }
140+
# Address and port to announce for internal manager API requests.
141+
# Used for service discovery within container environments.
142+
announce-internal-addr = { host = "host.docker.internal", port = 6023 }
143+
# Internal address where manager API listens for internal requests.
144+
# Used for internal communication between services.
145+
internal-addr = { host = "127.0.0.1", port = 16023 }
126146
# Whether to enable SSL/TLS for manager API connections.
127147
# Required for secure communication with managers.
128148
ssl-enabled = true
@@ -136,46 +156,6 @@ registries = []
136156
# Must be shared between manager and storage-proxy instances.
137157
secret = "manager-secret-key"
138158

139-
[api.manager.service-addr]
140-
# Host address of the service.
141-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
142-
# all interfaces.
143-
host = "127.0.0.1"
144-
# Port number of the service.
145-
# Must be between 1 and 65535.
146-
# Ports below 1024 require root/admin privileges.
147-
port = 8080
148-
149-
[api.manager.announce-addr]
150-
# Host address of the service.
151-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
152-
# all interfaces.
153-
host = "127.0.0.1"
154-
# Port number of the service.
155-
# Must be between 1 and 65535.
156-
# Ports below 1024 require root/admin privileges.
157-
port = 8080
158-
159-
[api.manager.announce-internal-addr]
160-
# Host address of the service.
161-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
162-
# all interfaces.
163-
host = "127.0.0.1"
164-
# Port number of the service.
165-
# Must be between 1 and 65535.
166-
# Ports below 1024 require root/admin privileges.
167-
port = 8080
168-
169-
[api.manager.internal-addr]
170-
# Host address of the service.
171-
# Can be a hostname, IP address, or special addresses like 0.0.0.0 to bind to
172-
# all interfaces.
173-
host = "127.0.0.1"
174-
# Port number of the service.
175-
# Must be between 1 and 65535.
176-
# Ports below 1024 require root/admin privileges.
177-
port = 8080
178-
179159
# Volume configuration.
180160
# Defines available storage backends and their settings.
181161
[volume]

configs/webserver/sample.toml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@
210210
# Controls how long operations wait before timing out.
211211
# If None, uses the default timeout configured in the Redis client.
212212
## request_timeout =
213+
# Whether to use TLS for Redis connections.
214+
use_tls = false
215+
# Whether to skip TLS certificate verification.
216+
# Set to True for self-signed certificates or development environments.
217+
tls_skip_verify = false
213218
# Optional override configurations for specific Redis contexts.
214219
# Allows different Redis settings for different services within Backend.AI.
215220
# Each key represents a context name, and the value is a complete Redis
@@ -254,15 +259,31 @@
254259
# OpenTelemetry endpoint.
255260
endpoint = "http://127.0.0.1:4317"
256261

262+
[apollo_router]
263+
# Whether to enable Apollo Router.
264+
enabled = false
265+
# Apollo Router endpoint.
266+
endpoint = "http://127.0.0.1:4000"
267+
257268
[logging]
258-
# Log level.
269+
# The version used by logging.dictConfig().
270+
version = 1
271+
# The main log level to filter messages from all loggers.
259272
level = "INFO"
260273
# Array of log drivers to print.
261274
drivers = [ "console",]
275+
# Disable the existing loggers when applying the config.
276+
disable-existing-loggers = false
262277
## file = "{ FileConfig }"
263278
## logstash = "{ LogstashConfig }"
264279
## graylog = "{ GraylogConfig }"
265280

281+
# The mapping of log handler configurations.
282+
[logging.handlers]
283+
284+
# The mapping of per-namespace logger configurations.
285+
[logging.loggers]
286+
266287
[logging.console]
267288
# Opt to print colorized log.
268289
## colored = true
@@ -272,10 +293,6 @@
272293
# Override default log level for specific scope of package
273294
[logging.pkg_ns]
274295

275-
[apollo-router]
276-
# endpoint of apollo router
277-
endpoint = "http://127.0.0.1:4000,http://api.example.com:4000"
278-
279296
[debug]
280297
# Whether to enable debug mode.
281298
enabled = false

configs/wsproxy/halfstack.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)