Challenge Overview
Challenge Overview
-
Update the request device report processing code to ensure all validations for each device is performed concurrently
Project background
Proteus platform targeted to achieve resource efficiency, focus on Lean process, standards and policies by assisting in automating device on-boarding and device acceptance process
More specifically, Platform designed to have integration with NMT tools in order to perform device registration and validation for given devices
Technology Stack
-
Backend
-
Python 2.7
-
Flask
-
MySql
-
Celery + Flower + Redis
-
-
Frontend
-
React.js
-
Individual Requirements
The code has 3 repositories:
-
https://gitlab.com/tc-proteus/frontend - the front end ReactJS code
-
https://gitlab.com/tc-proteus/backend - the backend Python Flask REST APIs and Celery tasks
-
https://gitlab.com/tc-proteus/mockups - the dependent BCG and VAPI mockup services as well as the docker setup files. Follow the instruction in docker sub-directory to run the backend and dependent services
On the “Request Device Report” page, the user is able to enter multiple devices to request report.
After you submit, several APIs are called:
-
POST http://localhost:5000/dbase/job - to create the job record
-
POST http://localhost:5000/report_job_create - to create the job tasks based upon the user-selection data in the job
-
POST http://localhost:5000/orchestration/start-orchestration/:jobId - to execute the job’s tasks
To make the operation concurrent, here are the expected changes:
The data POST to the http://localhost:5000/dbase/job API should be changed to below:
Then the report_job_create API is able to create tasks for each device separately.
And in current code, only a single action is defined for the “DA Validation” workflow in the actions db table: device_report, which is a celery task. And you can find its code in the task_device_report method of the proteus/blueprints/validation/validation_tasks.py file.
Instead of having a single action, you should define separate action and celery task for each validation api call, so that all validation for each device can run in parallel.
Please remove the TOPCODER_DEV mockup from the current code. Note that all these validations depend upon some external apis that we don’t have access.
And for this job, all the devices should be listed when it’s expanded. Its status should also be updated correctly
And if user clicks the Open button, the validation results for each device should be displayed correctly:
Note that the purpose is to make the operation concurrent, so if anything above is wrong or you have any better solution, please bring it up publicly or privately.
Final Submission Guidelines
Submission Deliverable
-
Patch files
-
Detailed Deployment and Verification Guide