diff --git a/api/v1/ytsaurus_types.go b/api/v1/ytsaurus_types.go index 5333844c..3ae39c6b 100644 --- a/api/v1/ytsaurus_types.go +++ b/api/v1/ytsaurus_types.go @@ -538,6 +538,11 @@ type StrawberryControllerSpec struct { type YQLAgentSpec struct { InstanceSpec `json:",inline"` + + // Sets mrjob dynamic library paths in yql agent config. + //+kubebuilder:default:=false + //+optional + ConfigureMrJobSystemLibs bool `json:"configureMrJobSystemLibs"` } type QueueAgentSpec struct { diff --git a/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml b/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml index 9b353fec..01312df7 100644 --- a/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml +++ b/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml @@ -35297,6 +35297,10 @@ spec: type: array type: object type: object + configureMrJobSystemLibs: + default: false + description: Sets mrjob dynamic library paths in yql agent config. + type: boolean enableAntiAffinity: description: 'Deprecated: use Affinity.PodAntiAffinity instead.' type: boolean diff --git a/docs/api.md b/docs/api.md index 951184a1..8a425699 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2152,6 +2152,7 @@ _Appears in:_ | `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | | | `terminationGracePeriodSeconds` _integer_ | Optional duration in seconds the pod needs to terminate gracefully. | | | | `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | | +| `configureMrJobSystemLibs` _boolean_ | Sets mrjob dynamic library paths in yql agent config. | false | | #### Ytsaurus diff --git a/pkg/ytconfig/yql_agent.go b/pkg/ytconfig/yql_agent.go index 10321366..fc512946 100644 --- a/pkg/ytconfig/yql_agent.go +++ b/pkg/ytconfig/yql_agent.go @@ -11,10 +11,15 @@ type ClusterMapping struct { Default bool `yson:"default"` } +type MrJobSystemLibsWithMd5 struct { + File string `yson:"file"` +} + type GatewayConfig struct { - MRJobBinary string `yson:"mr_job_bin"` - UDFDirectory string `yson:"mr_job_udfs_dir"` - ClusterMapping []ClusterMapping `yson:"cluster_mapping"` + MRJobBinary string `yson:"mr_job_bin"` + UDFDirectory string `yson:"mr_job_udfs_dir"` + ClusterMapping []ClusterMapping `yson:"cluster_mapping"` + MrJobSystemLibsWithMd5 []MrJobSystemLibsWithMd5 `yson:"mr_job_system_libs_with_md5,omitempty"` } type YQLAgent struct { @@ -50,6 +55,16 @@ func getYQLAgentServerCarcass(spec *ytv1.YQLAgentSpec) (YQLAgentServer, error) { c.User = "yql_agent" c.YQLAgent.GatewayConfig.UDFDirectory = "/usr/lib/yql" + if spec.ConfigureMrJobSystemLibs { + c.YQLAgent.GatewayConfig.MrJobSystemLibsWithMd5 = []MrJobSystemLibsWithMd5{ + MrJobSystemLibsWithMd5{ + File: "/usr/lib/yql/libiconv.so", + }, + MrJobSystemLibsWithMd5{ + File: "/usr/lib/yql/liblibidn-dynamic.so", + }, + } + } c.YQLAgent.GatewayConfig.MRJobBinary = "/usr/bin/mrjob" c.YQLAgent.YqlPluginSharedLibrary = "/usr/lib/yql/libyqlplugin.so" diff --git a/ytop-chart/templates/crds/ytsaurus.cluster.ytsaurus.tech.yaml b/ytop-chart/templates/crds/ytsaurus.cluster.ytsaurus.tech.yaml index 435ba563..6ca0cfaf 100644 --- a/ytop-chart/templates/crds/ytsaurus.cluster.ytsaurus.tech.yaml +++ b/ytop-chart/templates/crds/ytsaurus.cluster.ytsaurus.tech.yaml @@ -35308,6 +35308,10 @@ spec: type: array type: object type: object + configureMrJobSystemLibs: + default: false + description: Sets mrjob dynamic library paths in yql agent config. + type: boolean enableAntiAffinity: description: 'Deprecated: use Affinity.PodAntiAffinity instead.' type: boolean