Skip to content

Commit 92bb181

Browse files
author
Roja Reddy Sareddy
committed
Fix role issue in mtrl integ tests
1 parent b8b4518 commit 92bb181

4 files changed

Lines changed: 4 additions & 30 deletions

File tree

‎sagemaker-train/tests/integ/train/test_mtrl_evaluator.py‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def _get_test_config():
4747
"s3_output_path": f"s3://sagemaker-{_REGION}-{account_id}/model-evaluation/output-artifacts/",
4848
"mlflow_resource_arn": f"arn:aws:sagemaker:{_REGION}:{account_id}:mlflow-app/app-TTAUWUNMUHH6",
4949
"model_package_group": f"arn:aws:sagemaker:{_REGION}:{account_id}:model-package-group/openai-reasoning-gpt-oss-20b-mtrl-mpg",
50-
"role": f"arn:aws:iam::{account_id}:role/Admin",
5150
"region": _REGION,
5251
"account_id": account_id,
5352
}
@@ -172,7 +171,6 @@ def test_bedrock_agent_config_fields(self, mtrl_trainer, test_config):
172171
dataset=test_config["dataset"],
173172
s3_output_path=f'{test_config["s3_output_path"]}integ-fields-bedrock/',
174173
mlflow_resource_arn=test_config["mlflow_resource_arn"],
175-
role=test_config["role"],
176174
region=test_config["region"],
177175
agent_config=test_config["agent_arn"],
178176
agent_qualifier="PROD",
@@ -182,8 +180,7 @@ def test_bedrock_agent_config_fields(self, mtrl_trainer, test_config):
182180
evaluator._resolve_agent_arn()
183181

184182
ctx = evaluator._build_template_context(
185-
aws_context={"region": test_config["region"], "account_id": test_config["account_id"],
186-
"role_arn": test_config["role"]},
183+
aws_context={"region": test_config["region"], "account_id": test_config["account_id"]},
187184
artifacts={},
188185
model_package_group_arn=test_config["model_package_group"],
189186
)
@@ -208,7 +205,6 @@ def test_lambda_agent_config_fields(self, mtrl_trainer, test_config):
208205
dataset=test_config["dataset"],
209206
s3_output_path=f'{test_config["s3_output_path"]}integ-fields-lambda/',
210207
mlflow_resource_arn=test_config["mlflow_resource_arn"],
211-
role=test_config["role"],
212208
region=test_config["region"],
213209
agent_config=lambda_arn,
214210
)
@@ -217,8 +213,7 @@ def test_lambda_agent_config_fields(self, mtrl_trainer, test_config):
217213
evaluator._resolve_agent_arn()
218214

219215
ctx = evaluator._build_template_context(
220-
aws_context={"region": test_config["region"], "account_id": test_config["account_id"],
221-
"role_arn": test_config["role"]},
216+
aws_context={"region": test_config["region"], "account_id": test_config["account_id"]},
222217
artifacts={},
223218
model_package_group_arn=test_config["model_package_group"],
224219
)
@@ -239,7 +234,6 @@ def test_model_package_config_fields(self, mtrl_trainer, test_config):
239234
dataset=test_config["dataset"],
240235
s3_output_path=f'{test_config["s3_output_path"]}integ-fields-mpc/',
241236
mlflow_resource_arn=test_config["mlflow_resource_arn"],
242-
role=test_config["role"],
243237
region=test_config["region"],
244238
agent_config=test_config["agent_arn"],
245239
)
@@ -248,8 +242,7 @@ def test_model_package_config_fields(self, mtrl_trainer, test_config):
248242
evaluator._resolve_agent_arn()
249243

250244
ctx = evaluator._build_template_context(
251-
aws_context={"region": test_config["region"], "account_id": test_config["account_id"],
252-
"role_arn": test_config["role"]},
245+
aws_context={"region": test_config["region"], "account_id": test_config["account_id"]},
253246
artifacts={},
254247
model_package_group_arn=test_config["model_package_group"],
255248
)
@@ -280,7 +273,6 @@ def test_evaluator_construction_with_trainer(self, mtrl_trainer, test_config):
280273
dataset=test_config["dataset"],
281274
s3_output_path=f'{test_config["s3_output_path"]}integ-construct/',
282275
mlflow_resource_arn=test_config["mlflow_resource_arn"],
283-
role=test_config["role"],
284276
region=test_config["region"],
285277
agent_config=test_config["agent_arn"],
286278
)
@@ -298,7 +290,6 @@ def test_evaluator_construction_with_base_model(self, test_config):
298290
s3_output_path=f'{test_config["s3_output_path"]}integ-base/',
299291
agent_config=test_config["agent_arn"],
300292
mlflow_resource_arn=test_config["mlflow_resource_arn"],
301-
role=test_config["role"],
302293
region=test_config["region"],
303294
)
304295

‎sagemaker-train/tests/integ/train/test_mtrl_evaluator_3p_agent.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,6 @@ def _get_3p_test_config():
161161
"MTRL_3P_MLFLOW_ARN",
162162
f"arn:aws:sagemaker:{_REGION}:{account_id}:mlflow-app/app-TTAUWUNMUHH6",
163163
),
164-
"role": os.environ.get(
165-
"MTRL_3P_ROLE",
166-
f"arn:aws:iam::{account_id}:role/Admin",
167-
),
168164
"region": os.environ.get("MTRL_3P_REGION", _REGION),
169165
"account_id": account_id,
170166
}
@@ -258,7 +254,6 @@ def test_evaluate_with_lambda_agent_wait_for_completion(self, lambda_agent_arn,
258254
agent_config=lambda_agent_arn,
259255
s3_output_path=f'{test_config["s3_output_path"]}lambda-e2e/',
260256
mlflow_resource_arn=test_config["mlflow_resource_arn"],
261-
role=test_config["role"],
262257
region=test_config["region"],
263258
accept_eula=True,
264259
)
@@ -304,7 +299,6 @@ def test_evaluate_base_model_with_agent_lambda_object(self, lambda_agent_arn, te
304299
agent_config=agent,
305300
s3_output_path=f'{test_config["s3_output_path"]}lambda-object/',
306301
mlflow_resource_arn=test_config["mlflow_resource_arn"],
307-
role=test_config["role"],
308302
region=test_config["region"],
309303
accept_eula=True,
310304
)
@@ -332,7 +326,6 @@ def test_evaluate_with_attached_trainer(self, lambda_agent_arn, test_config):
332326
agent_config=lambda_agent_arn,
333327
s3_output_path=f'{test_config["s3_output_path"]}attached-trainer/',
334328
mlflow_resource_arn=test_config["mlflow_resource_arn"],
335-
role=test_config["role"],
336329
region=test_config["region"],
337330
accept_eula=True,
338331
)

‎sagemaker-train/tests/integ/train/test_mtrl_trainer_integration.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def _get_account_id():
4444
boto_session = boto3.Session(region_name=_REGION)
4545
return boto_session.client("sts").get_caller_identity()["Account"]
4646

47+
4748
# ============================================================
4849
# Per-account resource configuration
4950
# ============================================================
@@ -60,7 +61,6 @@ def _get_account_id():
6061
"s3_output_path": "s3://sagemaker-us-west-2-729646638167/mtrl-integ/eval-output/",
6162
"mlflow_resource_arn": "arn:aws:sagemaker:us-west-2:729646638167:mlflow-app/app-TTAUWUNMUHH6",
6263
"model_package_group": "arn:aws:sagemaker:us-west-2:729646638167:model-package-group/openai-reasoning-gpt-oss-20b-mtrl-mpg",
63-
"role": "arn:aws:iam::729646638167:role/Admin",
6464
},
6565
# PREPROD — Staging account (391266019386)
6666
"391266019386": {
@@ -72,7 +72,6 @@ def _get_account_id():
7272
"s3_output_path": "s3://sagemaker-us-west-2-391266019386/mtrl-integ/eval-output/",
7373
"mlflow_resource_arn": "arn:aws:sagemaker:us-west-2:391266019386:mlflow-app/app-P3FRQFRQTNGI",
7474
"model_package_group": "arn:aws:sagemaker:us-west-2:391266019386:model-package-group/mtrl-integ-gpt-oss-agentcore",
75-
"role": "arn:aws:iam::391266019386:role/Admin",
7675
},
7776
# BETA — Dev/test account (742774200982)
7877
"742774200982": {
@@ -84,7 +83,6 @@ def _get_account_id():
8483
"s3_output_path": "s3://sagemaker-us-west-2-742774200982/mtrl-integ/eval-output/",
8584
"mlflow_resource_arn": "arn:aws:sagemaker:us-west-2:742774200982:mlflow-app/app-6ZU5TXXH2GUX",
8685
"model_package_group": "arn:aws:sagemaker:us-west-2:742774200982:model-package-group/openai-reasoning-gpt-oss-20b-mtrl-mpg",
87-
"role": "arn:aws:iam::742774200982:role/Admin",
8886
},
8987
}
9088

@@ -133,7 +131,6 @@ def attached_trainer(config):
133131
output_model_package_group=config["model_package_group"],
134132
mlflow_app_arn=config["mlflow_resource_arn"],
135133
s3_output_path=config["s3_output_path"],
136-
role=config["role"],
137134
accept_eula=True,
138135
)
139136
trainer._latest_job = job
@@ -165,7 +162,6 @@ def test_evaluate_finetuned_model(self, attached_trainer, config):
165162
dataset=config["dataset"],
166163
s3_output_path=f'{config["s3_output_path"]}finetuned/',
167164
mlflow_resource_arn=config["mlflow_resource_arn"],
168-
role=config["role"],
169165
region=_REGION,
170166
)
171167

@@ -195,7 +191,6 @@ def test_evaluate_base_model(self, config):
195191
agent_config=config["agent_core_arn"],
196192
s3_output_path=f'{config["s3_output_path"]}basemodel/',
197193
mlflow_resource_arn=config["mlflow_resource_arn"],
198-
role=config["role"],
199194
region=_REGION,
200195
)
201196

@@ -225,7 +220,6 @@ def test_evaluate_comparison(self, attached_trainer, config):
225220
dataset=config["dataset"],
226221
s3_output_path=f'{config["s3_output_path"]}comparison/',
227222
mlflow_resource_arn=config["mlflow_resource_arn"],
228-
role=config["role"],
229223
region=_REGION,
230224
evaluate_base_model=True,
231225
)

‎sagemaker-train/tests/integ/train/test_multi_turn_rl_trainer_integration.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def test_resources():
5656
"""Resolve account-specific resource ARNs lazily."""
5757
account_id = _get_account_id()
5858
return {
59-
"role_arn": f"arn:aws:iam::{account_id}:role/Admin",
6059
"mlflow_arn": f"arn:aws:sagemaker:{_REGION}:{account_id}:mlflow-app/app-TTAUWUNMUHH6",
6160
"s3_input_path": f"s3://sagemaker-rft-{account_id}/prompts/gsm8k_small/prompts.parquet",
6261
"s3_output_path": f"s3://sagemaker-{_REGION}-{account_id}/model-evaluation/mtrl-trainer-integ/",
@@ -77,7 +76,6 @@ def test_train_and_wait(self, sagemaker_session, test_resources):
7776
training_dataset=test_resources["s3_input_path"],
7877
mlflow_app_arn=test_resources["mlflow_arn"],
7978
s3_output_path=test_resources["s3_output_path"],
80-
role=test_resources["role_arn"],
8179
accept_eula=True,
8280
sagemaker_session=sagemaker_session,
8381
)
@@ -101,7 +99,6 @@ def test_train_and_stop(self, sagemaker_session, test_resources):
10199
agent_env=AGENT_RUNTIME_ID,
102100
training_dataset=test_resources["s3_input_path"],
103101
mlflow_app_arn=test_resources["mlflow_arn"],
104-
role=test_resources["role_arn"],
105102
accept_eula=True,
106103
sagemaker_session=sagemaker_session,
107104
)
@@ -132,7 +129,6 @@ def test_train_with_lambda_arn(self, sagemaker_session, test_resources):
132129
mlflow_app_arn=test_resources["mlflow_arn"],
133130
s3_output_path=test_resources["s3_output_path"],
134131
accept_eula=True,
135-
role=test_resources["role_arn"],
136132
sagemaker_session=sagemaker_session,
137133
)
138134
trainer.hyperparameters.global_batch_size = 32

0 commit comments

Comments
 (0)