From a8e45cc52affc252658e1d090ff2a82664c45dca Mon Sep 17 00:00:00 2001 From: xiaoxiawang Date: Fri, 7 Nov 2025 16:28:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=A0=E5=85=A5rg=5Fname=EF=BC=8C?= =?UTF-8?q?=E5=90=8E=E7=BB=ADpython-api=E5=B1=82=E5=8F=AF=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libruntime/invoke_spec.cpp | 1 + test/libruntime/invoke_spec_test.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/libruntime/invoke_spec.cpp b/src/libruntime/invoke_spec.cpp index b407c20..fe2dddd 100644 --- a/src/libruntime/invoke_spec.cpp +++ b/src/libruntime/invoke_spec.cpp @@ -138,6 +138,7 @@ void InvokeSpec::BuildRequestPbScheduleOptions(InvokeOptions &opts, const Librun } if (ResourceGroupEnabled(opts.resourceGroupOpts)) { schedulingOps->set_rgroupname(opts.resourceGroupOpts.resourceGroupName); + this->opts.envVars["RG_NAME"] = opts.resourceGroupOpts.resourceGroupName; } static std::unordered_map affinityMap = { {"PreferredAffinity", core_service::AffinityType::PreferredAffinity}, diff --git a/test/libruntime/invoke_spec_test.cpp b/test/libruntime/invoke_spec_test.cpp index 2b73afa..821ad77 100644 --- a/test/libruntime/invoke_spec_test.cpp +++ b/test/libruntime/invoke_spec_test.cpp @@ -236,9 +236,13 @@ TEST_F(InvokeSpecTest, BuildInstanceCreateRequestTest) spec->opts.createOptions["crateOption"] = "createOption"; spec->functionMeta.name = "name"; spec->functionMeta.functionId = "functionId"; + ResourceGroupOptions resourceGroupOpts; + resourceGroupOpts.resourceGroupName = "testResourceGroup"; + spec.opts.resourceGroupOpts = resourceGroupOpts; LibruntimeConfig config; spec->BuildInstanceCreateRequest(config); ASSERT_EQ(spec->requestCreate.mutable_schedulingops()->mutable_resources()->size() != 0, true); + ASSERT_EQ(spec->opts.envVars["RG_NAME"], "testResourceGroup"); } } // namespace test } // namespace YR \ No newline at end of file -- Gitee From 451f921ef59be6fcd016bb42bd691ee939839a5f Mon Sep 17 00:00:00 2001 From: xiaoxiawang Date: Fri, 7 Nov 2025 16:51:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=A0=E5=85=A5rg=5Fname=EF=BC=8C?= =?UTF-8?q?=E5=90=8E=E7=BB=ADpython-api=E5=B1=82=E5=8F=AF=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/libruntime/invoke_spec_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libruntime/invoke_spec_test.cpp b/test/libruntime/invoke_spec_test.cpp index 821ad77..6b3dae7 100644 --- a/test/libruntime/invoke_spec_test.cpp +++ b/test/libruntime/invoke_spec_test.cpp @@ -238,7 +238,7 @@ TEST_F(InvokeSpecTest, BuildInstanceCreateRequestTest) spec->functionMeta.functionId = "functionId"; ResourceGroupOptions resourceGroupOpts; resourceGroupOpts.resourceGroupName = "testResourceGroup"; - spec.opts.resourceGroupOpts = resourceGroupOpts; + spec->opts.resourceGroupOpts = resourceGroupOpts; LibruntimeConfig config; spec->BuildInstanceCreateRequest(config); ASSERT_EQ(spec->requestCreate.mutable_schedulingops()->mutable_resources()->size() != 0, true); -- Gitee