-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3461 Test FaaS (AWS Lambda) Behavior Per Driver #1310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.evergreen/config.yml
Outdated
@@ -3264,6 +3308,12 @@ buildvariants: | |||
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README | |||
- testazurekms-fail-task | |||
|
|||
- name: rhel8-test-lambda | |||
display_name: AWS Lambda handler tests | |||
run_on: rhel87-large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to use rhel87-large? Or can we use rhel87-small instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[2023/07/19 14:46:54.303] Lambda function ARN: arn:aws:lambda:us-east-1:579766882180:function:dbx-python-lambda-e1244092-MongoDBFunction-3wLFo93jPKfd
[2023/07/19 14:46:54.303] ++ aws lambda invoke --function-name arn:aws:lambda:us-east-1:579766882180:function:dbx-python-lambda-e1244092-MongoDBFunction-3wLFo93jPKfd --log-type Tail lambda-invoke-standard.json
[2023/07/19 14:47:09.209] {
[2023/07/19 14:47:09.209] "StatusCode": 200,
[2023/07/19 14:47:09.209] "FunctionError": "Unhandled",
[2023/07/19 14:47:09.209] "LogResult": "...",
[2023/07/19 14:47:09.209] "ExecutedVersion": "$LATEST"
[2023/07/19 14:47:09.209] }
[2023/07/19 14:47:09.306] {"errorMessage": "The \"dnspython\" module must be installed to use mongodb+srv:// URIs. To fix this error install pymongo again:\n /var/lang/bin/python3.9 -m pip install pymongo>=4.3", "errorType": "ConfigurationError", "requestId": "", "stackTrace": [" File \"/var/lang/lib/python3.9/importlib/__init__.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n", " File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n", " File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n", " File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n", " File \"<frozen importlib._bootstrap>\", line 680, in _load_unlocked\n", " File \"<frozen importlib._bootstrap_external>\", line 850, in exec_module\n", " File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n", " File \"/var/task/app.py\", line 99, in <module>\n client = MongoClient(os.environ[\"MONGODB_URI\"], event_listeners=listeners)\n", " File \"/var/task/pymongo/mongo_client.py\", line 748, in __init__\n res = uri_parser.parse_uri(\n", " File \"/var/task/pymongo/uri_parser.py\", line 470, in parse_uri\n raise ConfigurationError(\n"]}
Could we make it so that this kind of error causes the EVG task to fail?
As for why this is happening, the dnspython package (and any other python dependencies) actually needs to be vendored into the lambda app package: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-dependencies
Adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I think we should wait until your driver-tools fix is merged.
.evergreen/config.yml
Outdated
@@ -98,7 +98,7 @@ functions: | |||
# If this was a patch build, doing a fresh clone would not actually test the patch | |||
cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS | |||
else | |||
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS | |||
git clone -b DRIVERS-2384 https://github.com/blink1073/drivers-evergreen-tools.git $DRIVERS_TOOLS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this branch to make it so the task fails when a function fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and some clean up as well. I agree we should wait for that PR to be merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed the tests are still failing:
[2023/07/25 16:49:46.758] ++ cat lambda_output.txt
[2023/07/25 16:49:46.759] {"errorMessage": "", "errorType": "AssertionError", "requestId": "", "stackTrace": [" File \"/var/lang/lib/python3.9/importlib/__init__.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n", " File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n", " File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n", " File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n", " File \"<frozen importlib._bootstrap>\", line 680, in _load_unlocked\n", " File \"<frozen importlib._bootstrap_external>\", line 850, in exec_module\n", " File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n", " File \"/var/task/app.py\", line 26, in <module>\n assert has_bson_c()\n"]}{
[2023/07/25 16:49:46.759] "StatusCode": 200,
[2023/07/25 16:49:46.759] "FunctionError": "Unhandled",
Yes, I'm still working on installing the local version of pymongo vs the one from pypi. |
Moved to draft pending mongodb-labs/drivers-evergreen-tools#331 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.