[ai-ml-testing] Pass assumed credentials to the test function

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: ai-ml-testing
    • None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      We need to pass the assumed credentials to the test execution function in addition to the fetch secrets function to allow us to use the ECR pull-through cache on Evergreen.

      https://spruce.mongodb.com/task/ai_ml_pipeline_testing_test_langchain_python_rhel_test_langchain_python_local_682287fc230aaa0007ea7b75_25_05_12_23_45_00/logs?execution=3

      [2025/05/13 15:16:56.174] Traceback (most recent call last):
      [2025/05/13 15:16:56.174]   File "/data/mci/2b30b8b8d81c7d6f6258e2288dec386b/src/drivers-evergreen-tools/.evergreen/docker/login.py", line 17, in <module>
      [2025/05/13 15:16:56.174]     resp = sts_client.assume_role(
      [2025/05/13 15:16:56.174]         RoleArn=os.environ["AWS_ROLE_ARN"],
      [2025/05/13 15:16:56.174]         RoleSessionName=f"{account}-test",
      [2025/05/13 15:16:56.174]         ExternalId=os.environ["AWS_EXTERNAL_ID"],
      [2025/05/13 15:16:56.174]     )
      [2025/05/13 15:16:56.174]   File "/data/mci/2b30b8b8d81c7d6f6258e2288dec386b/src/drivers-evergreen-tools/.evergreen/docker/dockervenv/lib/python3.13/site-packages/botocore/client.py", line 569, in _api_call
      [2025/05/13 15:16:56.174]     return self._make_api_call(operation_name, kwargs)
      [2025/05/13 15:16:56.174]            ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
      [2025/05/13 15:16:56.174]   File "/data/mci/2b30b8b8d81c7d6f6258e2288dec386b/src/drivers-evergreen-tools/.evergreen/docker/dockervenv/lib/python3.13/site-packages/botocore/client.py", line 1023, in _make_api_call
      [2025/05/13 15:16:56.174]     raise error_class(parsed_response, operation_name)
      [2025/05/13 15:16:56.174] botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:sts::557821124784:assumed-role/evergreen_task_hosts_instance_role_production/i-0a316c08371a6934a is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::901841024863:role/ecr-role-evergreen-ro
      [2025/05/13 15:16:56.174] ERROR    Command '['bash', 'setup.sh']' returned non-zero exit status 1.
      [2025/05/13 15:16:56.190] Command 'subprocess.exec' in function 'setup local atlas' (step 2 of 3) failed: process encountered problem: exit code 1.
      

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: