-
Notifications
You must be signed in to change notification settings - Fork 16
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
Unit test Ceph cache and fix timezone awareness #2723
Changes from 6 commits
98034e8
a13f693
f96453b
5bccc94
bffc989
58089d7
4c942a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
{ | ||
"metadata": { | ||
"analyzer": "thoth-adviser", | ||
"analyzer_version": "0.50.0", | ||
"arguments": { | ||
"advise": { | ||
"beam_width": 25000, | ||
"constraints": "input/constraints.txt", | ||
"count": 1, | ||
"dev": false, | ||
"labels": "input/labels.json", | ||
"library_usage": "input/library_usage.json", | ||
"limit": 1, | ||
"limit_latest_versions": -1, | ||
"no_pretty": false, | ||
"output": "/mnt/workdir/adviser-220131050913-b7c4ef0fc532ac45", | ||
"pipeline": null, | ||
"plot": null, | ||
"predictor": "AUTO", | ||
"predictor_config": {}, | ||
"prescription": [ | ||
"/opt/app-root/src/prescriptions.pickle" | ||
], | ||
"recommendation_type": "latest", | ||
"requirements": "input/Pipfile", | ||
"requirements_format": "pipenv", | ||
"requirements_locked": "input/Pipfile.lock", | ||
"runtime_environment": "input/runtime_environment.json", | ||
"seed": 42, | ||
"user_stack_scoring": true | ||
}, | ||
"thoth-adviser": { | ||
"metadata": { | ||
"kebechet_metadata": null, | ||
"origin": "https://github.com/thoth-station/ps-cv", | ||
"re_run_adviser_id": null, | ||
"source_type": null, | ||
"thoth.adviser": { | ||
"justification": null, | ||
"stack_info": null | ||
} | ||
}, | ||
"verbose": false | ||
} | ||
}, | ||
"datetime": "2022-01-31T05:15:49.969966", | ||
"distribution": { | ||
"codename": "Ootpa", | ||
"id": "rhel", | ||
"like": "fedora", | ||
"version": "8.3", | ||
"version_parts": { | ||
"build_number": "", | ||
"major": "8", | ||
"minor": "3" | ||
} | ||
}, | ||
"document_id": "adviser-220131050913-b7c4ef0fc532ac45", | ||
"duration": 376, | ||
"hostname": "adviser-220131050913-b7c4ef0fc532ac45-1876565397", | ||
"os_release": { | ||
"id": "rhel", | ||
"name": "Red Hat Enterprise Linux", | ||
"platform_id": "platform:el8", | ||
"redhat_bugzilla_product": "Red Hat Enterprise Linux 8", | ||
"redhat_bugzilla_product_version": "8.3", | ||
"redhat_support_product": "Red Hat Enterprise Linux", | ||
"redhat_support_product_version": "8.3", | ||
"version": "8.3 (Ootpa)", | ||
"version_id": "8.3" | ||
}, | ||
"python": { | ||
"api_version": 1013, | ||
"implementation_name": "cpython", | ||
"major": 3, | ||
"micro": 3, | ||
"minor": 8, | ||
"releaselevel": "final", | ||
"serial": 0 | ||
}, | ||
"thoth_deployment_name": "ocp4-stage", | ||
"timestamp": 1643606149 | ||
}, | ||
"result": { | ||
"error": true, | ||
"error_msg": "Resolver was killed as allocated memory has been exceeded (OOM) - https://thoth-station.ninja/j/oom", | ||
"parameters": { | ||
"beam_width": 25000, | ||
"constraints": "input/constraints.txt", | ||
"count": 1, | ||
"dev": false, | ||
"labels": {}, | ||
"library_usage": null, | ||
"limit": 1, | ||
"limit_latest_versions": -1, | ||
"no_pretty": false, | ||
"output": "/mnt/workdir/adviser-220131050913-b7c4ef0fc532ac45", | ||
"pipeline": null, | ||
"plot": null, | ||
"predictor": "AUTO", | ||
"predictor_config": "{}", | ||
"prescription": [ | ||
"/opt/app-root/src/prescriptions.pickle" | ||
], | ||
"project": { | ||
"constraints": [], | ||
"requirements": { | ||
"dev-packages": {}, | ||
"packages": { | ||
"jupyter-tensorboard": "*", | ||
"keras": "*", | ||
"opencv-python": "*", | ||
"pillow": "*", | ||
"tensorboard": "*", | ||
"tensorflow": ">=2.0.0" | ||
}, | ||
"requires": { | ||
"python_version": "3.8" | ||
}, | ||
"source": [ | ||
{ | ||
"name": "pypi", | ||
"url": "https://pypi.org/simple", | ||
"verify_ssl": true | ||
} | ||
] | ||
}, | ||
"requirements_locked": null, | ||
"runtime_environment": { | ||
"base_image": null, | ||
"cuda_version": null, | ||
"cudnn_version": null, | ||
"hardware": { | ||
"cpu_family": null, | ||
"cpu_model": null, | ||
"gpu_model": null | ||
}, | ||
"labels": null, | ||
"mkl_version": null, | ||
"name": "ps-cv-tensorflow", | ||
"openblas_version": null, | ||
"openmpi_version": null, | ||
"operating_system": { | ||
"name": "ubi", | ||
"version": "8" | ||
}, | ||
"platform": "linux-x86_64", | ||
"python_version": "3.8", | ||
"recommendation_type": null | ||
} | ||
}, | ||
"recommendation_type": "latest", | ||
"requirements": "input/Pipfile", | ||
"requirements_format": "pipenv", | ||
"requirements_locked": "input/Pipfile.lock", | ||
"runtime_environment": "input/runtime_environment.json", | ||
"seed": 42, | ||
"user_stack_scoring": true | ||
}, | ||
"report": null | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -46,11 +46,11 @@ def retrieve_document_ttl(self, document_id: str) -> float: | |||||||||
|
||||||||||
# Uses UTC time to be environment agnostic (no timezone) | ||||||||||
time_lived = ( | ||||||||||
datetime.now() | ||||||||||
datetime.now(timezone.utc) | ||||||||||
- self.ceph.retrieve_document_attr(object_key=document_id, attr="LastModified").replace(tzinfo=timezone.utc) | ||||||||||
).total_seconds() | ||||||||||
|
||||||||||
if time_lived <= 14400.0: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(this makes it clearer that 14400 seconds == 4 hours) |
||||||||||
return time_lived | ||||||||||
return 14400.0 - time_lived | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or if we don't want to return a timedelta
Suggested change
|
||||||||||
|
||||||||||
return 0.0 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we return a timedelta object instead of a raw number of seconds ? If not, I think we should at least use it internally to the function. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Only if we switch to a timedelta return. |
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.