diff --git a/pkg/ytconfig/canondata/TestGetExecNodeConfig/with-job-resources/test.canondata b/pkg/ytconfig/canondata/TestGetExecNodeConfig/with-job-resources/test.canondata index d609e885..5ee61f75 100644 --- a/pkg/ytconfig/canondata/TestGetExecNodeConfig/with-job-resources/test.canondata +++ b/pkg/ytconfig/canondata/TestGetExecNodeConfig/with-job-resources/test.canondata @@ -176,6 +176,36 @@ }; ]; "flush_period"=3000; + "log_manager_template"={ + writers={ + debug={ + type=file; + "file_name"="job-proxy.debug.log.zstd"; + format="plain_text"; + "compression_method"=zstd; + "enable_compression"=%true; + "enable_system_messages"=%true; + "rotation_policy"={ + "rotation_period"=900000; + "max_total_size_to_keep"=3145728; + }; + }; + }; + rules=[ + { + "exclude_categories"=[ + Bus; + Concurrency; + ]; + "min_level"=debug; + writers=[ + debug; + ]; + family="plain_text"; + }; + ]; + "flush_period"=3000; + }; }; }; "job_proxy_authentication_manager"={ diff --git a/pkg/ytconfig/canondata/TestGetExecNodeConfig/without-job-resources/test.canondata b/pkg/ytconfig/canondata/TestGetExecNodeConfig/without-job-resources/test.canondata index a401e465..e4b88e38 100644 --- a/pkg/ytconfig/canondata/TestGetExecNodeConfig/without-job-resources/test.canondata +++ b/pkg/ytconfig/canondata/TestGetExecNodeConfig/without-job-resources/test.canondata @@ -176,6 +176,36 @@ }; ]; "flush_period"=3000; + "log_manager_template"={ + writers={ + debug={ + type=file; + "file_name"="job-proxy.debug.log.zstd"; + format="plain_text"; + "compression_method"=zstd; + "enable_compression"=%true; + "enable_system_messages"=%true; + "rotation_policy"={ + "rotation_period"=900000; + "max_total_size_to_keep"=3145728; + }; + }; + }; + rules=[ + { + "exclude_categories"=[ + Bus; + Concurrency; + ]; + "min_level"=debug; + writers=[ + debug; + ]; + family="plain_text"; + }; + ]; + "flush_period"=3000; + }; }; }; "job_proxy_authentication_manager"={ diff --git a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-with-job-resources/test.canondata b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-with-job-resources/test.canondata index 2afb3cee..7d675506 100644 --- a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-with-job-resources/test.canondata +++ b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-with-job-resources/test.canondata @@ -190,6 +190,36 @@ }; ]; "flush_period"=3000; + "log_manager_template"={ + writers={ + debug={ + type=file; + "file_name"="job-proxy.debug.log.zstd"; + format="plain_text"; + "compression_method"=zstd; + "enable_compression"=%true; + "enable_system_messages"=%true; + "rotation_policy"={ + "rotation_period"=900000; + "max_total_size_to_keep"=3145728; + }; + }; + }; + rules=[ + { + "exclude_categories"=[ + Bus; + Concurrency; + ]; + "min_level"=debug; + writers=[ + debug; + ]; + family="plain_text"; + }; + ]; + "flush_period"=3000; + }; }; "forward_all_environment_variables"=%true; }; diff --git a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-without-job-resources/test.canondata b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-without-job-resources/test.canondata index 9a568de6..dc6b425b 100644 --- a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-without-job-resources/test.canondata +++ b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/isolated-containers-without-job-resources/test.canondata @@ -190,6 +190,36 @@ }; ]; "flush_period"=3000; + "log_manager_template"={ + writers={ + debug={ + type=file; + "file_name"="job-proxy.debug.log.zstd"; + format="plain_text"; + "compression_method"=zstd; + "enable_compression"=%true; + "enable_system_messages"=%true; + "rotation_policy"={ + "rotation_period"=900000; + "max_total_size_to_keep"=3145728; + }; + }; + }; + rules=[ + { + "exclude_categories"=[ + Bus; + Concurrency; + ]; + "min_level"=debug; + writers=[ + debug; + ]; + family="plain_text"; + }; + ]; + "flush_period"=3000; + }; }; "forward_all_environment_variables"=%true; }; diff --git a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-with-job-resources/test.canondata b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-with-job-resources/test.canondata index 2afb3cee..7d675506 100644 --- a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-with-job-resources/test.canondata +++ b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-with-job-resources/test.canondata @@ -190,6 +190,36 @@ }; ]; "flush_period"=3000; + "log_manager_template"={ + writers={ + debug={ + type=file; + "file_name"="job-proxy.debug.log.zstd"; + format="plain_text"; + "compression_method"=zstd; + "enable_compression"=%true; + "enable_system_messages"=%true; + "rotation_policy"={ + "rotation_period"=900000; + "max_total_size_to_keep"=3145728; + }; + }; + }; + rules=[ + { + "exclude_categories"=[ + Bus; + Concurrency; + ]; + "min_level"=debug; + writers=[ + debug; + ]; + family="plain_text"; + }; + ]; + "flush_period"=3000; + }; }; "forward_all_environment_variables"=%true; }; diff --git a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-without-job-resources/test.canondata b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-without-job-resources/test.canondata index 9a568de6..dc6b425b 100644 --- a/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-without-job-resources/test.canondata +++ b/pkg/ytconfig/canondata/TestGetExecNodeConfigWithCri/single-container-without-job-resources/test.canondata @@ -190,6 +190,36 @@ }; ]; "flush_period"=3000; + "log_manager_template"={ + writers={ + debug={ + type=file; + "file_name"="job-proxy.debug.log.zstd"; + format="plain_text"; + "compression_method"=zstd; + "enable_compression"=%true; + "enable_system_messages"=%true; + "rotation_policy"={ + "rotation_period"=900000; + "max_total_size_to_keep"=3145728; + }; + }; + }; + rules=[ + { + "exclude_categories"=[ + Bus; + Concurrency; + ]; + "min_level"=debug; + writers=[ + debug; + ]; + family="plain_text"; + }; + ]; + "flush_period"=3000; + }; }; "forward_all_environment_variables"=%true; }; diff --git a/pkg/ytconfig/canondata/TestGetExecNodeWithoutYtsaurusConfig/test.canondata b/pkg/ytconfig/canondata/TestGetExecNodeWithoutYtsaurusConfig/test.canondata index 66103e48..6f59d341 100644 --- a/pkg/ytconfig/canondata/TestGetExecNodeWithoutYtsaurusConfig/test.canondata +++ b/pkg/ytconfig/canondata/TestGetExecNodeWithoutYtsaurusConfig/test.canondata @@ -185,6 +185,36 @@ }; ]; "flush_period"=3000; + "log_manager_template"={ + writers={ + debug={ + type=file; + "file_name"="job-proxy.debug.log.zstd"; + format="plain_text"; + "compression_method"=zstd; + "enable_compression"=%true; + "enable_system_messages"=%true; + "rotation_policy"={ + "rotation_period"=900000; + "max_total_size_to_keep"=3145728; + }; + }; + }; + rules=[ + { + "exclude_categories"=[ + Bus; + Concurrency; + ]; + "min_level"=debug; + writers=[ + debug; + ]; + family="plain_text"; + }; + ]; + "flush_period"=3000; + }; }; }; "job_proxy_authentication_manager"={ diff --git a/pkg/ytconfig/canondata/TestGetStrawberryControllerConfig/test.canondata b/pkg/ytconfig/canondata/TestGetStrawberryControllerConfig/test.canondata index 39c39c09..0e301a4e 100644 --- a/pkg/ytconfig/canondata/TestGetStrawberryControllerConfig/test.canondata +++ b/pkg/ytconfig/canondata/TestGetStrawberryControllerConfig/test.canondata @@ -27,4 +27,4 @@ "http_controller_mappings"={ "*"=chyt; }; -} +} \ No newline at end of file diff --git a/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithCustomFamilies/test.canondata b/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithCustomFamilies/test.canondata index 69a7b955..27a25641 100644 --- a/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithCustomFamilies/test.canondata +++ b/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithCustomFamilies/test.canondata @@ -26,4 +26,4 @@ "superservice1.some.domain"=superservice1; "superservice3.some.domain"=superservice3; }; -} +} \ No newline at end of file diff --git a/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithExtendedHTTPMapping/test.canondata b/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithExtendedHTTPMapping/test.canondata index 9395cf4e..e986b9b0 100644 --- a/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithExtendedHTTPMapping/test.canondata +++ b/pkg/ytconfig/canondata/TestGetStrawberryControllerConfigWithExtendedHTTPMapping/test.canondata @@ -28,4 +28,4 @@ "*"=chyt; "jupyt.some.domain"=jupyt; }; -} +} \ No newline at end of file diff --git a/pkg/ytconfig/logging.go b/pkg/ytconfig/logging.go index 1f0c0743..5e64fb39 100644 --- a/pkg/ytconfig/logging.go +++ b/pkg/ytconfig/logging.go @@ -90,6 +90,16 @@ type Logging struct { FlushPeriod int `yson:"flush_period"` } +type JobProxyLogging struct { + // COMPAT(ignat) + // 23.2 — job_proxy_logging + // 24.1 — job_proxy/job_proxy_logging + // 24.2 — job_proxy/job_proxy_logging/log_manager_template + // Legacy fields can be removed with end of respective server version support. + Logging + LogManagerTemplate Logging `yson:"log_manager_template"` +} + type loggingBuilder struct { loggingDirectory string componentName string diff --git a/pkg/ytconfig/node.go b/pkg/ytconfig/node.go index 1ff9fdd1..6da589c1 100644 --- a/pkg/ytconfig/node.go +++ b/pkg/ytconfig/node.go @@ -153,9 +153,9 @@ type JobResourceManager struct { } type JobProxy struct { - JobProxyAuthenticationManager Auth `yson:"job_proxy_authentication_manager"` - JobProxyLogging Logging `yson:"job_proxy_logging"` - ForwardAllEnvironmentVariables *bool `yson:"forward_all_environment_variables,omitempty"` + JobProxyAuthenticationManager Auth `yson:"job_proxy_authentication_manager"` + JobProxyLogging JobProxyLogging `yson:"job_proxy_logging"` + ForwardAllEnvironmentVariables *bool `yson:"forward_all_environment_variables,omitempty"` } type ExecNode struct { @@ -561,7 +561,11 @@ func getExecNodeServerCarcass(spec *ytv1.ExecNodesSpec, commonSpec *ytv1.CommonS } } jobProxyLoggingBuilder.logging.FlushPeriod = 3000 - c.ExecNode.JobProxy.JobProxyLogging = jobProxyLoggingBuilder.logging + jobProxyLogging := jobProxyLoggingBuilder.logging + c.ExecNode.JobProxy.JobProxyLogging = JobProxyLogging{ + Logging: jobProxyLogging, + LogManagerTemplate: jobProxyLogging, + } c.ExecNode.JobProxy.JobProxyAuthenticationManager.RequireAuthentication = true c.ExecNode.JobProxy.JobProxyAuthenticationManager.CypressTokenAuthenticator.Secure = true @@ -569,7 +573,7 @@ func getExecNodeServerCarcass(spec *ytv1.ExecNodesSpec, commonSpec *ytv1.CommonS // TODO(khlebnikov): Drop legacy fields depending on ytsaurus version. c.ExecNode.JobController.ResourceLimitsLegacy = &c.JobResourceManager.ResourceLimits c.ExecNode.JobController.GpuManagerLegacy = &c.ExecNode.GpuManager - c.ExecNode.JobProxyLoggingLegacy = &c.ExecNode.JobProxy.JobProxyLogging + c.ExecNode.JobProxyLoggingLegacy = &jobProxyLogging c.ExecNode.JobProxyAuthenticationManagerLegacy = &c.ExecNode.JobProxy.JobProxyAuthenticationManager c.ExecNode.DoNotSetUserIdLegacy = c.ExecNode.SlotManager.DoNotSetUserId c.ExecNode.ForwardAllEnvironmentVariablesLegacy = c.ExecNode.JobProxy.ForwardAllEnvironmentVariables