Skip to content

Commit

Permalink
Feature/cams parallel cache2 (#233)
Browse files Browse the repository at this point in the history
* dev/cams

* Steps towards a first rate limiting solution

* Adapt hardcoded mapping

* Small bug fix (for testing code)

* Call the secondary adaptors (via a cdsapi request)

* Send all params to secondary adaptors

* Call retrieve_* from CAMSEuropeAirQualityForecastsAdaptorFor*Data

* Add mock create_result_file in retrieve_xxx

* Log how many req_groups

* Create random file names in retrieve_xxx (check if these are not already generated)

* Create random file names in new_retrieve_subrequest (check if these are not already generated)

* Log how many req_groups[0]['retrieved_files']

* Add process_grib_files

* MockResultFile to str

* MochResultFile to string (at the right time, for now)

* Covertions (netCDF, zip)

* Revert likely previously commented create_result_file

* Debug info

* Debug format

* Debug format

* Add create_temp_file to context

* Rate limiting: OK

* See URLs for local fields

* Test with hardcoded object store URL

* Rewrite temporary_location for object store

* Upload (for temporary files for now)

* Upload test (for both permanent and temporary)

* Fix model in the hardcoded mapping

* Read context.request['mapping'] from the config

* Debug

* Remove hardcoded mapping and use the one in the configuration

* Use an adaptor specific mapping function to apply the direct mapping from the configuration

* Debug

* Send the mapping from the adaptor to new_cams_regional_fc (as it is consummed by a config.pop in a superclass)

* Deal with no result cases under new_retrieve_subrequest

* Return None from CAMSEuropeAirQualityForecastsAdaptorFor*Data:retrieve if no data retrieved

* Intersect constraints

* Add _in_adaptor_no_cache to the list of recognised keys

* Pop _in_adaptor_no_cache after the cache is avoided (to not propagate it to sub-requests)

* Remove _in_adaptor_no_cache from the recognised keys list (likely not needed anymore)

* Debug

* Pop _in_adaptor_no_cache from the requests resulted after intersection

* All components working (polishing to do)

* Switch to using the standard apply_mapping (facilitated by mapping.remap and mapping.rename being populated as expected)

* Add tabulate as a dependency

* Load CDSAPI client credentials from environment

* Remove unused imports, move imports to methods

* Move tabulate from the list of mandatory dependencies to the complete version

* Assume that the dataset specific bucket exists

* Support netcdf_zip in cams_regional_fc (done by Luke)

* Solve small bug in reassign_missing_to_archive

* Bug fix in cams_regional_fc

* Roocs adaptor: set timeout to a generous 30 seconds

* Roocs adaptor: set timeout back to 3 seconds

* Roocs adaptor: read the URL download timeout from the dataset configuration

* Log request IDs of sub-requests done via the CDSAPI

* Cds 265 url area selector too small selection (#194)

* handle too small area selection

* fix (#197)

* mapped_requests

* Remove temporary function

* URL adaptor

* adaptors refactor

* Request type

* Request type

* mapped_requests

* mapped_requests

* debug

* recall normalise_request

* pre mapping mods

* handle formats

* handle embargo exceptions

* handle download_formats

* preserve _pre_retrieve so that adaptors can be updated gradually

* intersect_constraints_bool

* remove cyclical calling of intersect_constraints

* cads-obs to use normalise_requests

* cads-obs to use normalise_requests

* some tidying

* TODO update

* set_download_format, with nice error

* set_download_format, with nice error

* download format, remove bug and add assertion check

* CamsSolarRad adaptor to use normalise_request

* type checking

* QA + typing

* URL adaptor/tools: add support for "fail_on_timeout_for_any_part"

* Short revert

* Revert

* schema is now called at start of normalise request to ensure that we duplicate all the testing and modifications

* Small typo fix (cads_adaptors.tools.download_tools)

* CAMS solar radiation adaptor: adjust to request["format"] now being a list

* Revert mapped request to scalar values (a specific requirement for this adaptor, at least for now)

* Linting

* Download sub-request result in a loop (for the cases when it fails to download completely the first time)

* URL tools: set default for fail_on_timeout_for_any_part to True

* clean update

* typo

* Multi-threaded caching in CAMS regional adaptor

* Multi-threaded caching in CAMS regional adaptor

* Multi-threaded caching in CAMS regional adaptor

* Auto-linting of cams_regional_fc/cacher.py

* Auto-linting of cams_regional_fc/mem_safe_queue.py

* Harmonise cads_adaptors/__init__.py, cads_adaptors/adaptors/__init__.py with main

* Delete cams_regional_fc/remote_copier.py

* Bug fix in cams_regional_fc/cacher.py

* Small qa

---------

Co-authored-by: Luke Jones <luke.jones@ecmwf.int>
Co-authored-by: Eddy Comyn-Platt <53045993+EddyCMWF@users.noreply.github.com>
Co-authored-by: EddyCMWF <Edward.Comyn-Platt@ecmwf.int>
  • Loading branch information
4 people authored Oct 25, 2024
1 parent 9d41d2c commit a22e978
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 421 deletions.
Loading

0 comments on commit a22e978

Please sign in to comment.