Closed Bug 1452166 Opened 8 years ago Closed 8 years ago

Create HTTP Edge node that responds with 400 on invalid payloads

Categories

(Data Platform and Tools :: General, enhancement, P1)

enhancement
Points:
2

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: frank, Assigned: amiyaguchi)

References

Details

Attachments

(1 file)

Currently we respond with some pieces about improper messages on the production edge server, but if the JSON Validation (or something else) fails the client doesn't know. This server wouldn't necessarily be hooked in to the rest of the pipeline (though, a CEP attached to it would be nice). It would run messages through validation, and let the client know if things were not validated.
This seems like it's within the purview of the validation service :amiyaguchi is working on in bug 1454062. Anthony, does this seem like something that would fit that project, possibly in v2?
Flags: needinfo?(amiyaguchi)
This definitely fits in the flavor of the validation service. One nice thing about the framework I'm using (flask) is that functionality can be modularized into packages called blueprints.[1] A flask blueprint for validating a single ping on-demand can be stood up separately and then integrated into the larger schema validation API. However, this may not be the right choice if the number of requests per second is above roughly 10k req/sec.[2] [1] http://flask.pocoo.org/docs/0.12/blueprints/ [2] https://medium.com/@tschundeee/express-vs-flask-vs-go-acc0879c2122
Flags: needinfo?(amiyaguchi)
Assignee: nobody → amiyaguchi
Points: --- → 2
Priority: -- → P2
The main task of this service would be to map the incoming document and version to the schema in the mozilla-pipeline-schema. This logic will also need to be implemented in the v2 release of the validation CI service, so implementing and deploying this would cover a lot of ground.
Priority: P2 → P1
Blocks: 1458734
A work in progress exists at [1]. I've manually tested processed landfill pings from several doctypes with the correct response using schemas from the mozilla-pipeline-schemas HEAD. I will include scripts for syncing data and integration tests for deployment. uWSGI with nginx is potential deployment option. [1] https://github.com/acmiyaguchi/edge-validator
Dependency for testing data.
Depends on: 1458736
Attached file v1 release #1
I've set up an endpoint that should 200 or 400. It implements the proposed generic ingestion spec (except for the optional docid that doesn't make sense in this context).[1] The schemas repo is a submodule within the project, so the submodule can be updated using git commands to update the schemas in the endpoint. :frank I've tagged you as a reviewer, let me know if this works. [1] https://docs.google.com/document/d/1PqiF1rF2fCk_kQuGSwGwildDf4Crg9MJTY44E6N5DSk/edit#heading=h.74qlucdvwdg0
Attachment #8975694 - Flags: review?(fbertsch)
Attachment #8975694 - Flags: review?(fbertsch) → review+
Anthony, next steps here would be: 1. Have somebody try this locally with the docker setup you have and a locally-built Fx instance 2. Deploy this to incoming-test.telemetry.mozilla.org (or alternate) Does that sound right to you?
Flags: needinfo?(amiyaguchi)
Depends on: 1462047
Those sounds like good next steps. I've filed a bug with ops for (2) in bug 1462048, which should hopefully be a straightforward process.
Flags: needinfo?(amiyaguchi)
This is ready-to-use locally. See the follow-up bugs for deployment.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Blocks: 1465242
Component: Pipeline Ingestion → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: