-
Notifications
You must be signed in to change notification settings - Fork 27
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
Log Pelican config on server startup #1970
base: main
Are you sure you want to change the base?
Log Pelican config on server startup #1970
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what we're trying to solve here, but the new output this produces adds a lot of clutter:
INFO[2025-02-04T22:04:16Z] Pelican Configuration Dump pelican_config="map[Cache:map[BlocksToPrefetch:0 Concurrency:0 DataLocation: DataLocations:[/run/pelican/cache/data] DefaultCacheTimeout:9.5e+09 EnableLotman:false EnableOIDC:false EnablePrefetch:true EnableVoms:false ExportLocation:/ FilesBaseSize: FilesMaxSize: FilesNominalSize: HighWaterMark:95 LocalRoot: LowWatermark:90 MetaLocations:[/run/pelican/cache/meta] NamespaceLocation:/run/pelican/cache/namespace PermittedNamespaces:<nil> Port:8442 RunLocation:/run/pelican/xrootd/cache SelfTest:true SelfTestInterval:1.5e+10 SentinelLocation: StorageLocation:/run/pelican/cache Url:https://391758784b47:8442 XRootDPrefix:] Client:map[AssumeDirectorServerHeader:false DirectorRetries:0 DisableHttpProxy:false DisableProxyFallback:false IsPlugin:false MaximumDownloadSpeed:0 MinimumDownloadSpeed:0 SlowTransferRampupTime:1e+11 SlowTransferWindow:3e+10 StoppedTransferTimeout:1e+11 WorkerCount:5] ConfigDir:/etc/pelican ConfigLocations:<nil> Debug:false Director:map[AdvertisementTTL:9e+11 AssumePresenceAtSingleOrigin:true CachePresenceCapacity:2000 CachePresenceTTL:6e+10 CacheResponseHostnames:<nil> CacheSortMethod:distance CachesPullFromCaches:false CheckCachePresence:true CheckOriginPresence:true DbLocation:/var/lib/pelican/director.sqlite DefaultResponse:cache EnableBroker:true EnableOIDC:false EnableStat:false FilteredServers:<nil> GeoIPLocation:/var/cache/pelican/maxmind/GeoLite2-City.mmdb MaxMindKeyFile:/workspaces/pelican/maxmindkeyfile MaxStatResponse:1 MinStatResponse:1 OriginCacheHealthTestInterval:1.5e+10 OriginResponseHostnames:<nil> RegistryQueryInterval:0 StatConcurrencyLimit:100 StatTimeout:2e+09 SupportContactEmail: SupportContactUrl: X509ClientAuthenticationPrefixes:<nil>] DisableHttpProxy:false DisableProxyFallback:false Federation:map[BrokerUrl: DirectorUrl:https://391758784b47:8445 DiscoveryUrl:https://391758784b47:8445 JwkUrl: RegistryUrl:https://391758784b47:8446 TopologyDowntimeUrl: TopologyNamespaceUrl: TopologyReloadInterval:0 TopologyUrl:] GeoIPOverrides:<nil> Issuer:map[AuthenticationSource:OIDC AuthorizationTemplates:<nil> GroupFile: GroupRequirements:<nil> GroupSource: IssuerClaimValue: OIDCAuthenticationRequirements:<nil> OIDCAuthenticationUserClaim:sub OIDCGroupClaim:groups QDLLocation:/opt/qdl ScitokensServerLocation:/opt/scitokens-server TomcatLocation:/opt/tomcat UserStripDomain:false] IssuerKey:/etc/pelican/issuer.jwk IssuerKeysDirectory:/etc/pelican/issuer-keys LocalCache:map[DataLocation:/run/pelican/localcache/cache HighWaterMarkPercentage:95 LowWaterMarkPercentage:85 RunLocation:/run/pelican/localcache Size: Socket:/run/pelican/localcache/cache.sock] Logging:map[Cache:map[Http:debug Ofs:error Pfc:debug Pss:error Scitokens:fatal Xrd:error Xrootd:debug] DisableProgressBars:false Level:debug LogLocation: Origin:map[Cms:trace Http:debug Ofs:error Oss:error Scitokens:trace Xrd:trace Xrootd:trace]] Lotman:map[DbLocation:/workspaces/pelican DefaultLotDeletionLifetime:1.45152e+16 DefaultLotExpirationLifetime:7.2576e+15 EnableAPI:false EnabledPolicy:fairshare LibLocation: PolicyDefinitions:[map[discoverprefixes:true divideunallocated:true mergelocalwithdiscovered:false policyname:fairshare purgeorder:[del exp opp ded]]]] MinimumDownloadSpeed:0 Monitoring:map[AggregatePrefixes:[/*] DataLocation:/var/lib/pelican/monitoring/data DataRetention:1.296e+15 LabelLimit:64 LabelNameLengthLimit:128 LabelValueLengthLimit:2048 MetricAuthorization:true PortHigher:9999 PortLower:9930 PromQLAuthorization:true SampleLimit:200 TokenExpiresIn:3.6e+12 TokenRefreshInterval:3e+11] OIDC:map[AuthorizationEndpoint:https://cilogon.org/authorize ClientID: ClientIDFile:/workspaces/pelican/oidc-client-id ClientRedirectHostname: ClientSecretFile:/workspaces/pelican/oidc-client-secret DeviceAuthEndpoint:https://cilogon.org/oauth2/device_authorization Issuer:https://cilogon.org TokenEndpoint:https://cilogon.org/oauth2/token UserInfoEndpoint:https://cilogon.org/oauth2/userinfo] Origin:map[DbLocation:/var/lib/pelican/origin.sqlite DirectorTest:true EnableBroker:false EnableCmsd:false EnableDirListing:false EnableDirectReads:true EnableFallbackRead:false EnableIssuer:false EnableListings:true EnableMacaroons:false EnableOIDC:false EnablePublicReads:false EnableReads:true EnableUI:true EnableVoms:true EnableWrite:false EnableWrites:true ExportVolume: ExportVolumes:[] Exports:[map[capabilities:[PublicReads Listings DirectReads] federationprefix:/aws-opendata/us-east-1 s3bucket:noaa-wod-pds]] FederationPrefix: GlobusClientIDFile: GlobusClientSecretFile: GlobusCollectionID: GlobusCollectionName: GlobusConfigLocation:/run/pelican/xrootd/origin/globus HttpAuthTokenFile: HttpServiceUrl: Mode: Multiuser:false NamespacePrefix: Port:8443 RunLocation:/run/pelican/xrootd/origin S3AccessKeyfile: S3Bucket: S3Region:us-east-1 S3SecretKeyfile: S3ServiceName: S3ServiceUrl:https://s3.us-east-1.amazonaws.com S3UrlStyle:virtual ScitokensDefaultUser: ScitokensMapSubject:false ScitokensNameMapFile: ScitokensRestrictedPaths:<nil> ScitokensUsernameClaim: SelfTest:false SelfTestInterval:1.5e+10 StoragePrefix: StorageType:s3 Url:https://391758784b47:8443 XRootDPrefix: XRootServiceUrl:] Plugin:map[Token:] Registry:map[AdminUsers:<nil> CustomRegistrationFields:<nil> DbLocation:/workspaces/pelican/pelican.sqlite Institutions:<nil> InstitutionsUrl:https://topology-institutions.osg-htc.org/api/institution_ids InstitutionsUrlReloadMinutes:9e+11 RequireCacheApproval:false RequireKeyChaining:true RequireOriginApproval:false] Server:map[EnablePprof:false EnableUI:true ExternalWebUrl:https://391758784b47:8444 HealthMonitoringPublic:false Hostname:391758784b47 IssuerHostname: IssuerJwks: IssuerPort:0 IssuerUrl: Modules:[] RegistrationRetryInterval:1e+10 SessionSecretFile:/etc/pelican/session-secret StartupTimeout:1e+10 TLSCACertificateDirectory: TLSCACertificateFile:/etc/pelican/certificates/tlsca.pem TLSCAKey:/etc/pelican/certificates/tlsca.key TLSCertificate: TLSCertificateChain:/etc/pelican/certificates/tls.crt TLSKey:/etc/pelican/certificates/tls.key UIActivationCodeFile:/etc/pelican/server-web-activation-code UIAdminUsers:<nil> UILoginRateLimit:1 UIPasswordFile:/etc/pelican/server-web-passwd WebConfigFile:/etc/pelican/web-config.yaml WebHost:0.0.0.0 WebPort:8444] Shoveler:map[AMQPExchange:shoveled-xrd AMQPTokenLocation:/etc/pelican/shoveler-token Enable:false IPMapping:<nil> MessageQueueProtocol:amqp OutputDestinations:<nil> PortHigher:9999 PortLower:9930 QueueDirectory:/var/spool/pelican/shoveler/queue StompCert: StompCertKey: StompPassword: StompUsername: Topic: URL: VerifyHeader:false] StagePlugin:map[Hook:false MountPrefix: OriginPrefix: ShadowOriginPrefix:] TLSSkipVerify:true Transport:map[DialerKeepAlive:3e+10 DialerTimeout:1e+10 ExpectContinueTimeout:1e+09 IdleConnTimeout:9e+10 MaxIdleConns:30 ResponseHeaderTimeout:1e+10 TLSHandshakeTimeout:1.5e+10] Xrootd:map[AuthRefreshInterval:3e+11 Authfile:/etc/pelican/xrootd/authfile ConfigFile: DetailedMonitoringHost: DetailedMonitoringPort:9930 LocalMonitoringHost: MacaroonsKeyFile:/etc/pelican/macaroons-secret ManagerHost: ManagerPort:1213 MaxStartupWait:1e+10 Mount: Port:0 RobotsTxtFile:/etc/pelican/robots.txt RunLocation: ScitokensConfig:/etc/pelican/xrootd/scitokens.cfg Sitename:391758784b47 SummaryMonitoringHost: SummaryMonitoringPort:9931]]"
================ Pelican Configuration ================
{
"Cache": {
"BlocksToPrefetch": 0,
"Concurrency": 0,
"DataLocation": "",
"DataLocations": [
"/run/pelican/cache/data"
],
"DefaultCacheTimeout": 9500000000,
"EnableLotman": false,
"EnableOIDC": false,
"EnablePrefetch": true,
"EnableVoms": false,
"ExportLocation": "/",
"FilesBaseSize": "",
"FilesMaxSize": "",
"FilesNominalSize": "",
"HighWaterMark": "95",
"LocalRoot": "",
"LowWatermark": "90",
"MetaLocations": [
"/run/pelican/cache/meta"
],
"NamespaceLocation": "/run/pelican/cache/namespace",
"PermittedNamespaces": null,
"Port": 8442,
"RunLocation": "/run/pelican/xrootd/cache",
"SelfTest": true,
"SelfTestInterval": 15000000000,
"SentinelLocation": "",
"StorageLocation": "/run/pelican/cache",
"Url": "https://391758784b47:8442",
"XRootDPrefix": ""
},
"Client": {
"AssumeDirectorServerHeader": false,
"DirectorRetries": 0,
"DisableHttpProxy": false,
"DisableProxyFallback": false,
"IsPlugin": false,
"MaximumDownloadSpeed": 0,
"MinimumDownloadSpeed": 0,
"SlowTransferRampupTime": 100000000000,
"SlowTransferWindow": 30000000000,
"StoppedTransferTimeout": 100000000000,
"WorkerCount": 5
},
"ConfigDir": "/etc/pelican",
"ConfigLocations": null,
"Debug": false,
"Director": {
"AdvertisementTTL": 900000000000,
"AssumePresenceAtSingleOrigin": true,
"CachePresenceCapacity": 2000,
"CachePresenceTTL": 60000000000,
"CacheResponseHostnames": null,
"CacheSortMethod": "distance",
"CachesPullFromCaches": false,
"CheckCachePresence": true,
"CheckOriginPresence": true,
"DbLocation": "/var/lib/pelican/director.sqlite",
"DefaultResponse": "cache",
"EnableBroker": true,
"EnableOIDC": false,
"EnableStat": false,
"FilteredServers": null,
"GeoIPLocation": "/var/cache/pelican/maxmind/GeoLite2-City.mmdb",
"MaxMindKeyFile": "/workspaces/pelican/maxmindkeyfile",
"MaxStatResponse": 1,
"MinStatResponse": 1,
"OriginCacheHealthTestInterval": 15000000000,
"OriginResponseHostnames": null,
"RegistryQueryInterval": 0,
"StatConcurrencyLimit": 100,
"StatTimeout": 2000000000,
"SupportContactEmail": "",
"SupportContactUrl": "",
"X509ClientAuthenticationPrefixes": null
},
"DisableHttpProxy": false,
"DisableProxyFallback": false,
"Federation": {
"BrokerUrl": "",
"DirectorUrl": "https://391758784b47:8445",
"DiscoveryUrl": "https://391758784b47:8445",
"JwkUrl": "",
"RegistryUrl": "https://391758784b47:8446",
"TopologyDowntimeUrl": "",
"TopologyNamespaceUrl": "",
"TopologyReloadInterval": 0,
"TopologyUrl": ""
},
"GeoIPOverrides": null,
"Issuer": {
"AuthenticationSource": "OIDC",
"AuthorizationTemplates": null,
"GroupFile": "",
"GroupRequirements": null,
"GroupSource": "",
"IssuerClaimValue": "",
"OIDCAuthenticationRequirements": null,
"OIDCAuthenticationUserClaim": "sub",
"OIDCGroupClaim": "groups",
"QDLLocation": "/opt/qdl",
"ScitokensServerLocation": "/opt/scitokens-server",
"TomcatLocation": "/opt/tomcat",
"UserStripDomain": false
},
"IssuerKey": "/etc/pelican/issuer.jwk",
"IssuerKeysDirectory": "/etc/pelican/issuer-keys",
"LocalCache": {
"DataLocation": "/run/pelican/localcache/cache",
"HighWaterMarkPercentage": 95,
"LowWaterMarkPercentage": 85,
"RunLocation": "/run/pelican/localcache",
"Size": "",
"Socket": "/run/pelican/localcache/cache.sock"
},
"Logging": {
"Cache": {
"Http": "debug",
"Ofs": "error",
"Pfc": "debug",
"Pss": "error",
"Scitokens": "fatal",
"Xrd": "error",
"Xrootd": "debug"
},
"DisableProgressBars": false,
"Level": "debug",
"LogLocation": "",
"Origin": {
"Cms": "trace",
"Http": "debug",
"Ofs": "error",
"Oss": "error",
"Scitokens": "trace",
"Xrd": "trace",
"Xrootd": "trace"
}
},
"Lotman": {
"DbLocation": "/workspaces/pelican",
"DefaultLotDeletionLifetime": 14515200000000000,
"DefaultLotExpirationLifetime": 7257600000000000,
"EnableAPI": false,
"EnabledPolicy": "fairshare",
"LibLocation": "",
"PolicyDefinitions": [
{
"discoverprefixes": true,
"divideunallocated": true,
"mergelocalwithdiscovered": false,
"policyname": "fairshare",
"purgeorder": [
"del",
"exp",
"opp",
"ded"
]
}
]
},
"MinimumDownloadSpeed": 0,
"Monitoring": {
"AggregatePrefixes": [
"/*"
],
"DataLocation": "/var/lib/pelican/monitoring/data",
"DataRetention": 1296000000000000,
"LabelLimit": 64,
"LabelNameLengthLimit": 128,
"LabelValueLengthLimit": 2048,
"MetricAuthorization": true,
"PortHigher": 9999,
"PortLower": 9930,
"PromQLAuthorization": true,
"SampleLimit": 200,
"TokenExpiresIn": 3600000000000,
"TokenRefreshInterval": 300000000000
},
"OIDC": {
"AuthorizationEndpoint": "https://cilogon.org/authorize",
"ClientID": "",
"ClientIDFile": "/workspaces/pelican/oidc-client-id",
"ClientRedirectHostname": "",
"ClientSecretFile": "/workspaces/pelican/oidc-client-secret",
"DeviceAuthEndpoint": "https://cilogon.org/oauth2/device_authorization",
"Issuer": "https://cilogon.org",
"TokenEndpoint": "https://cilogon.org/oauth2/token",
"UserInfoEndpoint": "https://cilogon.org/oauth2/userinfo"
},
"Origin": {
"DbLocation": "/var/lib/pelican/origin.sqlite",
"DirectorTest": true,
"EnableBroker": false,
"EnableCmsd": false,
"EnableDirListing": false,
"EnableDirectReads": true,
"EnableFallbackRead": false,
"EnableIssuer": false,
"EnableListings": true,
"EnableMacaroons": false,
"EnableOIDC": false,
"EnablePublicReads": false,
"EnableReads": true,
"EnableUI": true,
"EnableVoms": true,
"EnableWrite": false,
"EnableWrites": true,
"ExportVolume": "",
"ExportVolumes": [],
"Exports": [
{
"capabilities": [
"PublicReads",
"Listings",
"DirectReads"
],
"federationprefix": "/aws-opendata/us-east-1",
"s3bucket": "noaa-wod-pds"
}
],
"FederationPrefix": "",
"GlobusClientIDFile": "",
"GlobusClientSecretFile": "",
"GlobusCollectionID": "",
"GlobusCollectionName": "",
"GlobusConfigLocation": "/run/pelican/xrootd/origin/globus",
"HttpAuthTokenFile": "",
"HttpServiceUrl": "",
"Mode": "",
"Multiuser": false,
"NamespacePrefix": "",
"Port": 8443,
"RunLocation": "/run/pelican/xrootd/origin",
"S3AccessKeyfile": "",
"S3Bucket": "",
"S3Region": "us-east-1",
"S3SecretKeyfile": "",
"S3ServiceName": "",
"S3ServiceUrl": "https://s3.us-east-1.amazonaws.com",
"S3UrlStyle": "virtual",
"ScitokensDefaultUser": "",
"ScitokensMapSubject": false,
"ScitokensNameMapFile": "",
"ScitokensRestrictedPaths": null,
"ScitokensUsernameClaim": "",
"SelfTest": false,
"SelfTestInterval": 15000000000,
"StoragePrefix": "",
"StorageType": "s3",
"Url": "https://391758784b47:8443",
"XRootDPrefix": "",
"XRootServiceUrl": ""
},
"Plugin": {
"Token": ""
},
"Registry": {
"AdminUsers": null,
"CustomRegistrationFields": null,
"DbLocation": "/workspaces/pelican/pelican.sqlite",
"Institutions": null,
"InstitutionsUrl": "https://topology-institutions.osg-htc.org/api/institution_ids",
"InstitutionsUrlReloadMinutes": 900000000000,
"RequireCacheApproval": false,
"RequireKeyChaining": true,
"RequireOriginApproval": false
},
"Server": {
"EnablePprof": false,
"EnableUI": true,
"ExternalWebUrl": "https://391758784b47:8444",
"HealthMonitoringPublic": false,
"Hostname": "391758784b47",
"IssuerHostname": "",
"IssuerJwks": "",
"IssuerPort": 0,
"IssuerUrl": "",
"Modules": [],
"RegistrationRetryInterval": 10000000000,
"SessionSecretFile": "/etc/pelican/session-secret",
"StartupTimeout": 10000000000,
"TLSCACertificateDirectory": "",
"TLSCACertificateFile": "/etc/pelican/certificates/tlsca.pem",
"TLSCAKey": "/etc/pelican/certificates/tlsca.key",
"TLSCertificate": "",
"TLSCertificateChain": "/etc/pelican/certificates/tls.crt",
"TLSKey": "/etc/pelican/certificates/tls.key",
"UIActivationCodeFile": "/etc/pelican/server-web-activation-code",
"UIAdminUsers": null,
"UILoginRateLimit": 1,
"UIPasswordFile": "/etc/pelican/server-web-passwd",
"WebConfigFile": "/etc/pelican/web-config.yaml",
"WebHost": "0.0.0.0",
"WebPort": 8444
},
"Shoveler": {
"AMQPExchange": "shoveled-xrd",
"AMQPTokenLocation": "/etc/pelican/shoveler-token",
"Enable": false,
"IPMapping": null,
"MessageQueueProtocol": "amqp",
"OutputDestinations": null,
"PortHigher": 9999,
"PortLower": 9930,
"QueueDirectory": "/var/spool/pelican/shoveler/queue",
"StompCert": "",
"StompCertKey": "",
"StompPassword": "",
"StompUsername": "",
"Topic": "",
"URL": "",
"VerifyHeader": false
},
"StagePlugin": {
"Hook": false,
"MountPrefix": "",
"OriginPrefix": "",
"ShadowOriginPrefix": ""
},
"TLSSkipVerify": true,
"Transport": {
"DialerKeepAlive": 30000000000,
"DialerTimeout": 10000000000,
"ExpectContinueTimeout": 1000000000,
"IdleConnTimeout": 90000000000,
"MaxIdleConns": 30,
"ResponseHeaderTimeout": 10000000000,
"TLSHandshakeTimeout": 15000000000
},
"Xrootd": {
"AuthRefreshInterval": 300000000000,
"Authfile": "/etc/pelican/xrootd/authfile",
"ConfigFile": "",
"DetailedMonitoringHost": "",
"DetailedMonitoringPort": 9930,
"LocalMonitoringHost": "",
"MacaroonsKeyFile": "/etc/pelican/macaroons-secret",
"ManagerHost": "",
"ManagerPort": 1213,
"MaxStartupWait": 10000000000,
"Mount": "",
"Port": 0,
"RobotsTxtFile": "/etc/pelican/robots.txt",
"RunLocation": "",
"ScitokensConfig": "/etc/pelican/xrootd/scitokens.cfg",
"Sitename": "391758784b47",
"SummaryMonitoringHost": "",
"SummaryMonitoringPort": 9931
}
}
============= End of Pelican Configuration ============
Why do we need to log the entire config as an unformatted map?
With this new commit, the config will be printed in the usual JSON format in the log file rather than Logrus's structured log format, improving readability. |
Did we always bypass the logging subsystem here? Having code separately manage logfiles runs the chance of code drift... |
Yes, before this PR, the config dump on server startup was only printed to stderr and not written to the log file. In my initial approach to this issue, I also did not like the idea of managing the log file separately in the code, so I used Logrus to write a structured log for the config dump. However, Justin pointed out that the structured log was not very readable, so I had to manually add the config dump JSON to the log file. |
fb82ca0
to
08eab62
Compare
Previously, we were only dumping the config to stderr on server startup. With this change, we also add a structured log for the full Pelican configuration.