Giter Club home page Giter Club logo

polytope-server's Introduction

polytope-server

โš ๏ธ This project is BETA and will be experimental for the forseable future. Interfaces and functionality are likely to change, and the project itself may be scrapped. DO NOT use this software in any project/software that is operational.

Polytope provides a REST API for access to hypercube data, stored in various data sources (FDBs, MARS, etc.). Polytope is comprised of a number of microservices:

  • frontend: REST API running Falcon/Flask
  • worker: responsible for fetching data and pushing it to a staging area for download
  • broker: responsible for scheduling pending requests
  • garbage-collector: responsible for cleaning up old requests and freeing up space in the staging area

Through common abstraction layers, these components speak to various other services:

  • request_store: database to track requests (MongoDB)
  • queue: queue to dispatch requests to workers (RabbitMQ)
  • staging: object-store to serve and receive data (S3, BasicHTTPServer)
  • authentication: for authenticating users to Polytope (ECMWF API, Basic MongoDB, API Key MongoDB)
  • authorization: for managing authorization to different collections (ECMWF LDAP, MongoDB)
  • identity: for registering users with Polytope (MongoDB)
  • api-keys: for generating Polytope API keys (MongoDB)
  • caching: caching of web requests to various services (MongoDB, Redis, Memcached)

Quick Start

cd polytope-deployment
export SKAFFOLD_IMAGE_REGISTRY=localhost:32000
skaffold dev

Testing

Unit tests:

python -m pytest tests/unit

Generic integration tests (a deployment is required):

python -m pytest tests/integration --config </path/to/config1.yaml> --config </path/to/config2.yaml>

polytope-server's People

Contributors

jameshawkes avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polytope-server's Issues

Improve user messaging of handling of zero-data retrievals

Is your feature request related to a problem? Please describe.

2024-01-24 06:48:43 - INFO - Sending request...
{'request': 'class: rd\n'
"date: '20240118'\n"
'expver: i7yv\n'
'levtype: sfc\n'
'param: '
'8.128/9.128/32.128/33.128/34.128/39.128/40.128/41.128/42.128/44.128/45.128/58.128/129.128/139.128/141.128/144.128/146.128/147.128/151.128/164.128/165.128/166.128/167.128/168.128/169.128/170.128/175.128/176.128/177.128/178.128/179.128/182.128/183.128/189.128/205.128/228.128/235.128/236.128/238.128/243.128/251.228/260015/260121\n'
"step: '0'\n"
'stream: oper\n'
"time: '0000'\n"
'type: fc\n',
'verb': 'retrieve'}
2024-01-24 06:48:43 - INFO - Request accepted. Please poll [redacted] for status
2024-01-24 06:48:43 - INFO - Checking request status (161280ca-08e1-429e-838f-977bdf0f0055)...
2024-01-24 06:48:43 - INFO - The current status of the request is 'queued'
2024-01-24 06:48:44 - INFO - The current status of the request is 'processing'
2024-01-24 06:48:45 - INFO - The current status of the request is 'processed'
2024-01-24 06:48:45 - INFO - Starting data download (application/x-grib)...
2024-01-24 06:48:45 - INFO - Saving data into x.grib...
2024-01-24 06:48:45 - INFO - Data downloaded successfully
2024-01-24 06:48:45 - INFO - Download rate 0.0B/s
2024-01-24 06:48:45 - INFO - Data saved successfully into x.grib

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Organisation

No response

Worker exits main loop on mongodb connection issue

What happened?

When the mongodb service is unable to respond to a request from the worker, the exception raised causes the worker to stop polling the request queue. I suspect in some cases the exception is caught somewhere outside of the main loop because the process does not stop so kubernetes does not restart the worker.

What are the steps to reproduce the bug?

Use a mongodb service that is somewhat unreliable.

Version

develop

Platform (OS and architecture)

Debian 12 x86_64

Relevant log output

No response

Accompanying data

No response

Organisation

MeteoSwiss

Pending requests remain in active state indefinitely

What happened?

Requests remain in queued or processing state, no additional requests are processed for the current user.

What are the steps to reproduce the bug?

If the worker crashes while processing and is unable to update the request state to failed. Alternatively, if the request is never retrieved by a worker due to an issue during the dequeuing. The broker does not submit any new requests for the user as long as the threshold of active requests was reached.

Version

develop

Platform (OS and architecture)

Debian 12 x86_64

Relevant log output

No response

Accompanying data

No response

Organisation

MeteoSwiss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.