From b3a68ae86c1da088a7bdcaea18f6eb557d4dd8ca Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Thu, 9 Feb 2023 22:05:20 -0500 Subject: [PATCH 1/7] execution backend --- .../aws_helpers/dynamo_db_utils/base_db.py | 2 +- .../dynamo_db_utils/execution_db.py | 25 ++ backend/driver.py | 12 +- .../playground-frontend/package-lock.json | 294 ++++++++++++++++++ frontend/playground-frontend/package.json | 2 + .../src/backend_outputs/model.pt | Bin 2975 -> 3027 bytes .../my_deep_learning_model.onnx | Bin 920 -> 1328 bytes .../src/components/Dashboard/Dashboard.js | 117 ++++--- .../helper_functions/TalkWithBackend.js | 1 + package-lock.json | 142 +++++++++ package.json | 1 + 11 files changed, 543 insertions(+), 53 deletions(-) diff --git a/backend/aws_helpers/dynamo_db_utils/base_db.py b/backend/aws_helpers/dynamo_db_utils/base_db.py index 456fd5d96..3484551f0 100644 --- a/backend/aws_helpers/dynamo_db_utils/base_db.py +++ b/backend/aws_helpers/dynamo_db_utils/base_db.py @@ -221,7 +221,7 @@ def get_record(self, partition_id: Any) -> BaseData: item = self.__number_decoder(item) self.__param_checker("approve", **item) return self.DataClass(**item) - + def update_record(self, partition_id: Any, **kwargs) -> Literal['Success']: """Function to update a record with the partition_key values as attribute 'partition_id' from the associated DynamoDB table. It takes in changes in attributes as keyword arguments""" diff --git a/backend/aws_helpers/dynamo_db_utils/execution_db.py b/backend/aws_helpers/dynamo_db_utils/execution_db.py index cc51d4fc8..0f7f71c00 100644 --- a/backend/aws_helpers/dynamo_db_utils/execution_db.py +++ b/backend/aws_helpers/dynamo_db_utils/execution_db.py @@ -5,6 +5,7 @@ from backend.aws_helpers.dynamo_db_utils.base_db import BaseData, BaseDDBUtil, enumclass, changevar from backend.common.constants import EXECUTION_TABLE_NAME, AWS_REGION +from boto3.dynamodb.conditions import Key from typing import Union @dataclass @@ -51,6 +52,30 @@ def getOrCreateUserExecutionsData_(entryData: dict) -> str: dynamoTable.create_record(newRecord) return json.dumps(newRecord.__dict__) +def getAllUserExecutionsData(user_id: str) -> str: + """ + Retrieves an entry from the `execution-table` DynamoDB table given an `execution_id`. Example output: {"execution_id": "blah", "user_id": "blah", "name": "blah", "timestamp": "blah", "data_source": "TABULAR", "status": "QUEUED", "progress": 1} + + @param execution_id: The execution_id of the entry to be retrieved + @return: A JSON string of the entry retrieved from the table + """ + dynamoTable = ExecutionDDBUtil(EXECUTION_TABLE_NAME, AWS_REGION) + response = dynamoTable.table.query(IndexName='user_id', KeyConditionExpression=Key('user_id').eq(user_id)) + items = response["Items"] + record = [] + for item in items: + data_source, name, progress, status, timestamp, execution_id = item["data_source"], item["name"], item["progress"], item["status"], item["timestamp"], item["execution_id"] + record.append({"data_source": data_source, "name": name, "progress": float(progress), "status": status, "timestamp": timestamp, "execution_id": execution_id}) + + + while 'LastEvaluatedKey' in response: + key = response['LastEvaluatedKey'] + response = dynamoTable.table.query(KeyConditionExpression=Key('user_id').eq(user_id), ExclusiveStartKey=key) + for item in items: + data_source, name, progress, status, timestamp, execution_id = item["data_source"], item["name"], item["progress"], item["status"], item["timestamp"], item["execution_id"] + record.append({"data_source": data_source, "name": name, "progress": float(progress), "status": status, "timestamp": timestamp, "execution_id": execution_id}) + return json.dumps(record) + def updateUserExecutionsData_(requestData: dict) -> str: """ Updates an entry from the `execution-table` DynamoDB table given an `execution_id`. diff --git a/backend/driver.py b/backend/driver.py index ae2163f33..7cf1d3d2c 100644 --- a/backend/driver.py +++ b/backend/driver.py @@ -15,7 +15,7 @@ from backend.common.utils import * from backend.firebase_helpers.firebase import init_firebase from backend.aws_helpers.dynamo_db_utils.learnmod_db import UserProgressDDBUtil, UserProgressData -from backend.aws_helpers.dynamo_db_utils.execution_db import ExecutionDDBUtil, ExecutionData, getOrCreateUserExecutionsData_, updateUserExecutionsData_ +from backend.aws_helpers.dynamo_db_utils.execution_db import ExecutionDDBUtil, ExecutionData, getOrCreateUserExecutionsData_, updateUserExecutionsData_, getAllUserExecutionsData from backend.common.constants import EXECUTION_TABLE_NAME, AWS_REGION, USERPROGRESS_TABLE_NAME, POINTS_PER_QUESTION from backend.dl.detection import detection_img_drive @@ -269,6 +269,16 @@ def send_columns(): print(traceback.format_exc()) return send_traceback_error() +@app.route("/api/executiontable", methods=["POST"]) +def executions_table(): + try: + request_data = json.loads(request.data) + user_id = request_data['user_id'] + record = getAllUserExecutionsData(user_id) + return send_success({"record": record}) + except Exception: + print(traceback.format_exc()) + return send_traceback_error() @app.route("/api/upload", methods=["POST"]) def upload(): diff --git a/frontend/playground-frontend/package-lock.json b/frontend/playground-frontend/package-lock.json index af78d6f62..08be7449c 100644 --- a/frontend/playground-frontend/package-lock.json +++ b/frontend/playground-frontend/package-lock.json @@ -20,6 +20,8 @@ "bootstrap": "^5.2.1", "crypto-js": "^4.1.1", "firebase": "^9.9.3", + "gestalt": "^93.0.1", + "gestalt-datepicker": "^93.0.1", "http-proxy-middleware": "^2.0.6", "local-storage-fallback": "^4.1.2", "plotly.js": "^2.12.1", @@ -2983,6 +2985,19 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, + "node_modules/@hypnosphi/create-react-context": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@hypnosphi/create-react-context/-/create-react-context-0.3.1.tgz", + "integrity": "sha512-V1klUed202XahrWJLLOT3EXNeCpFHCcJntdFGI15ntCwau+jfT386w7OFTMaCqOgXUH1fa0w/I1oZs+i/Rfr0A==", + "dependencies": { + "gud": "^1.0.0", + "warning": "^4.0.3" + }, + "peerDependencies": { + "prop-types": "^15.0.0", + "react": ">=0.14.0" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -7948,6 +7963,18 @@ "node": ">=10" } }, + "node_modules/date-fns": { + "version": "2.29.3", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz", + "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==", + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -7974,6 +8001,22 @@ "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==" }, + "node_modules/deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dependencies": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -10236,6 +10279,74 @@ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==" }, + "node_modules/gestalt": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt/-/gestalt-93.0.1.tgz", + "integrity": "sha512-TgMLVOMEz5hjERrqHO+y7ZGLWca5oasuBg48GuwfzkgqS6gm8682pVKx6vPizHBghBiyc1AORWnIFoaDTSmQsg==", + "dependencies": { + "classnames": "^2.2.6", + "gestalt-design-tokens": ">0.0.0" + }, + "peerDependencies": { + "react": "^16.13.1 || ^17.0 || ^18.0", + "react-dom": "^16.13.1 || ^17.0 || ^18.0" + } + }, + "node_modules/gestalt-datepicker": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt-datepicker/-/gestalt-datepicker-93.0.1.tgz", + "integrity": "sha512-i651WHR6vZ86w64ZX50/cdtLp9hNbY8H1Kw1e2vSRWRdX7YGRGLDz3XgyS+Ixl0HXjWJnQQ2zAOtc8eHK5kzIA==", + "dependencies": { + "classnames": "^2.2.6", + "react-datepicker": "2.16.0" + }, + "peerDependencies": { + "gestalt": ">0.0.0", + "react": "^16.13.1 || ^17.0 || ^18.0", + "react-dom": "^16.13.1 || ^17.0 || ^18.0" + } + }, + "node_modules/gestalt-datepicker/node_modules/react-datepicker": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-2.16.0.tgz", + "integrity": "sha512-TvcmSY27rn0JKvuJuIXNNS+niGQNdgtuG/CsBttVYhPOA9KmSw7c2PvQBPVEvzkyV+QPNJ8jN/KVJNj9uvopqA==", + "dependencies": { + "classnames": "^2.2.6", + "date-fns": "^2.0.1", + "prop-types": "^15.7.2", + "react-onclickoutside": "^6.9.0", + "react-popper": "^1.3.4" + }, + "peerDependencies": { + "react": "^16.9.0", + "react-dom": "^16.9.0" + } + }, + "node_modules/gestalt-datepicker/node_modules/react-datepicker/node_modules/react-popper": { + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-1.3.11.tgz", + "integrity": "sha512-VSA/bS+pSndSF2fiasHK/PTEEAyOpX60+H5EPAjoArr8JGm+oihu4UbrqcEBpQibJxBVCpYyjAX7abJ+7DoYVg==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "@hypnosphi/create-react-context": "^0.3.1", + "deep-equal": "^1.1.1", + "popper.js": "^1.14.4", + "prop-types": "^15.6.1", + "typed-styles": "^0.0.7", + "warning": "^4.0.2" + }, + "peerDependencies": { + "react": "0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/gestalt-design-tokens": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt-design-tokens/-/gestalt-design-tokens-93.0.1.tgz", + "integrity": "sha512-MxF58+C2Gy8oL9ufZ8gwnC7LGTVeZuVzKbU5lZ4VOri0XtRyH69S+kb4oNTGFyA8MzXv4UREXAChbnEnh58cuw==", + "peerDependencies": { + "gestalt": ">0.0.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -10637,6 +10748,11 @@ "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz", "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==" }, + "node_modules/gud": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", + "integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==" + }, "node_modules/gzip-size": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", @@ -11165,6 +11281,21 @@ "node": ">= 10" } }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -14557,6 +14688,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -15178,6 +15324,16 @@ "resolved": "https://registry.npmjs.org/polybooljs/-/polybooljs-1.2.0.tgz", "integrity": "sha512-mKjR5nolISvF+q2BtC1fi/llpxBPTQ3wLWN8+ldzdw2Hocpc8C72ZqnamCM4Z6z+68GVVjkeM01WJegQmZ8MEQ==" }, + "node_modules/popper.js": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", + "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==", + "deprecated": "You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", @@ -17161,6 +17317,19 @@ "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, + "node_modules/react-onclickoutside": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.12.2.tgz", + "integrity": "sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==", + "funding": { + "type": "individual", + "url": "https://github.com/Pomax/react-onclickoutside/blob/master/FUNDING.md" + }, + "peerDependencies": { + "react": "^15.5.x || ^16.x || ^17.x || ^18.x", + "react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x" + } + }, "node_modules/react-plotly.js": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/react-plotly.js/-/react-plotly.js-2.5.1.tgz", @@ -19507,6 +19676,11 @@ "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", "integrity": "sha512-kkgkuqR/jKdKO5oh/I2SMu2dGbLXoJq0zkdgbxaqYK+hr9S9edwVVGf+tMUFTx2gH9TN2+Zu9JZ/Njonb3cjhA==" }, + "node_modules/typed-styles": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz", + "integrity": "sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q==" + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -22995,6 +23169,15 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, + "@hypnosphi/create-react-context": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@hypnosphi/create-react-context/-/create-react-context-0.3.1.tgz", + "integrity": "sha512-V1klUed202XahrWJLLOT3EXNeCpFHCcJntdFGI15ntCwau+jfT386w7OFTMaCqOgXUH1fa0w/I1oZs+i/Rfr0A==", + "requires": { + "gud": "^1.0.0", + "warning": "^4.0.3" + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -26686,6 +26869,11 @@ "whatwg-url": "^8.0.0" } }, + "date-fns": { + "version": "2.29.3", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz", + "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==" + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -26704,6 +26892,19 @@ "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==" }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -28401,6 +28602,60 @@ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==" }, + "gestalt": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt/-/gestalt-93.0.1.tgz", + "integrity": "sha512-TgMLVOMEz5hjERrqHO+y7ZGLWca5oasuBg48GuwfzkgqS6gm8682pVKx6vPizHBghBiyc1AORWnIFoaDTSmQsg==", + "requires": { + "classnames": "^2.2.6", + "gestalt-design-tokens": ">0.0.0" + } + }, + "gestalt-datepicker": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt-datepicker/-/gestalt-datepicker-93.0.1.tgz", + "integrity": "sha512-i651WHR6vZ86w64ZX50/cdtLp9hNbY8H1Kw1e2vSRWRdX7YGRGLDz3XgyS+Ixl0HXjWJnQQ2zAOtc8eHK5kzIA==", + "requires": { + "classnames": "^2.2.6", + "react-datepicker": "2.16.0" + }, + "dependencies": { + "react-datepicker": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-2.16.0.tgz", + "integrity": "sha512-TvcmSY27rn0JKvuJuIXNNS+niGQNdgtuG/CsBttVYhPOA9KmSw7c2PvQBPVEvzkyV+QPNJ8jN/KVJNj9uvopqA==", + "requires": { + "classnames": "^2.2.6", + "date-fns": "^2.0.1", + "prop-types": "^15.7.2", + "react-onclickoutside": "^6.9.0", + "react-popper": "^1.3.4" + }, + "dependencies": { + "react-popper": { + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-1.3.11.tgz", + "integrity": "sha512-VSA/bS+pSndSF2fiasHK/PTEEAyOpX60+H5EPAjoArr8JGm+oihu4UbrqcEBpQibJxBVCpYyjAX7abJ+7DoYVg==", + "requires": { + "@babel/runtime": "^7.1.2", + "@hypnosphi/create-react-context": "^0.3.1", + "deep-equal": "^1.1.1", + "popper.js": "^1.14.4", + "prop-types": "^15.6.1", + "typed-styles": "^0.0.7", + "warning": "^4.0.2" + } + } + } + } + } + }, + "gestalt-design-tokens": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt-design-tokens/-/gestalt-design-tokens-93.0.1.tgz", + "integrity": "sha512-MxF58+C2Gy8oL9ufZ8gwnC7LGTVeZuVzKbU5lZ4VOri0XtRyH69S+kb4oNTGFyA8MzXv4UREXAChbnEnh58cuw==", + "requires": {} + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -28754,6 +29009,11 @@ "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz", "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==" }, + "gud": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", + "integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==" + }, "gzip-size": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", @@ -29135,6 +29395,15 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==" }, + "is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -31619,6 +31888,15 @@ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" }, + "object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -32091,6 +32369,11 @@ "resolved": "https://registry.npmjs.org/polybooljs/-/polybooljs-1.2.0.tgz", "integrity": "sha512-mKjR5nolISvF+q2BtC1fi/llpxBPTQ3wLWN8+ldzdw2Hocpc8C72ZqnamCM4Z6z+68GVVjkeM01WJegQmZ8MEQ==" }, + "popper.js": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", + "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==" + }, "postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", @@ -33348,6 +33631,12 @@ "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, + "react-onclickoutside": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.12.2.tgz", + "integrity": "sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==", + "requires": {} + }, "react-plotly.js": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/react-plotly.js/-/react-plotly.js-2.5.1.tgz", @@ -35161,6 +35450,11 @@ "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", "integrity": "sha512-kkgkuqR/jKdKO5oh/I2SMu2dGbLXoJq0zkdgbxaqYK+hr9S9edwVVGf+tMUFTx2gH9TN2+Zu9JZ/Njonb3cjhA==" }, + "typed-styles": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz", + "integrity": "sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q==" + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", diff --git a/frontend/playground-frontend/package.json b/frontend/playground-frontend/package.json index b9874f3e7..c392dea0d 100644 --- a/frontend/playground-frontend/package.json +++ b/frontend/playground-frontend/package.json @@ -15,6 +15,8 @@ "bootstrap": "^5.2.1", "crypto-js": "^4.1.1", "firebase": "^9.9.3", + "gestalt": "^93.0.1", + "gestalt-datepicker": "^93.0.1", "http-proxy-middleware": "^2.0.6", "local-storage-fallback": "^4.1.2", "plotly.js": "^2.12.1", diff --git a/frontend/playground-frontend/src/backend_outputs/model.pt b/frontend/playground-frontend/src/backend_outputs/model.pt index 68103da41438e31cfeca03b1d50b603e25642735..306c4737cdf720db237dd3e8a0379aa32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XK7kokc0Cmx z`@U`3XeW^HXWt$cg?$NPyY|)f3GdU==U~P#4AoO!JjcCK_j1-9vpK^%W3SdOMh+IR z1JL8xYXM`r*9JRYhZlA~nC{ti=^xprWYn#Ljfa(tWPqukLLqakO#BoVTxT$De(gW({`iJsEq0jhO8smaN=c zlz4d`Ys&_^eJ6|T7;ZT49EhFIBs9%Hch+G@a49b zZ?)Qe_`_!R?5NB>(enxWj8xg}@?MwivrL_4m)DtM_aSJNO~Gj;yDxpB`;0=;_Lha+ pvyD { const navigate = useNavigate(); return ( - - - - - Name - Type - - Input - - - Date - - - Status - - - - - {rows.map((row) => ( - navigate("/")} - hover - > - - {row.name} - - - {row.type} - - - {row.input} + <> +
+ + + Name + Type + + Input - - {formatDate(row.date)} + + Date - - + + Status - ))} - -
-
+ + + {rows.map((row) => ( + navigate("/")} + hover + > + + {row.name} + + + {row.type} + + + {row.input} + + + {formatDate(row.date)} + + + + + + ))} + + + + ); }; diff --git a/frontend/playground-frontend/src/components/helper_functions/TalkWithBackend.js b/frontend/playground-frontend/src/components/helper_functions/TalkWithBackend.js index 39bdb49e7..c2a4927dc 100644 --- a/frontend/playground-frontend/src/components/helper_functions/TalkWithBackend.js +++ b/frontend/playground-frontend/src/components/helper_functions/TalkWithBackend.js @@ -52,6 +52,7 @@ async function sendToBackend(route, data) { } : undefined; data["route"] = route; + data["user_id"] = headers.uid; const timestamp = Date.now(); data["execution_id"] = createExecutionId(timestamp, headers.uid); if (process.env.REACT_APP_MODE === "prod") { diff --git a/package-lock.json b/package-lock.json index 412191e6a..92f0750c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,15 @@ "license": "MIT", "dependencies": { "dotenv": "^16.0.3", + "gestalt": "^93.0.1", "local-storage-fallback": "^4.1.2" } }, + "node_modules/classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + }, "node_modules/cookie": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", @@ -29,6 +35,33 @@ "node": ">=12" } }, + "node_modules/gestalt": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt/-/gestalt-93.0.1.tgz", + "integrity": "sha512-TgMLVOMEz5hjERrqHO+y7ZGLWca5oasuBg48GuwfzkgqS6gm8682pVKx6vPizHBghBiyc1AORWnIFoaDTSmQsg==", + "dependencies": { + "classnames": "^2.2.6", + "gestalt-design-tokens": ">0.0.0" + }, + "peerDependencies": { + "react": "^16.13.1 || ^17.0 || ^18.0", + "react-dom": "^16.13.1 || ^17.0 || ^18.0" + } + }, + "node_modules/gestalt-design-tokens": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt-design-tokens/-/gestalt-design-tokens-93.0.1.tgz", + "integrity": "sha512-MxF58+C2Gy8oL9ufZ8gwnC7LGTVeZuVzKbU5lZ4VOri0XtRyH69S+kb4oNTGFyA8MzXv4UREXAChbnEnh58cuw==", + "peerDependencies": { + "gestalt": ">0.0.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "peer": true + }, "node_modules/local-storage-fallback": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/local-storage-fallback/-/local-storage-fallback-4.1.2.tgz", @@ -36,9 +69,60 @@ "dependencies": { "cookie": "^0.3.1" } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + } } }, "dependencies": { + "classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + }, "cookie": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", @@ -49,6 +133,27 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" }, + "gestalt": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt/-/gestalt-93.0.1.tgz", + "integrity": "sha512-TgMLVOMEz5hjERrqHO+y7ZGLWca5oasuBg48GuwfzkgqS6gm8682pVKx6vPizHBghBiyc1AORWnIFoaDTSmQsg==", + "requires": { + "classnames": "^2.2.6", + "gestalt-design-tokens": ">0.0.0" + } + }, + "gestalt-design-tokens": { + "version": "93.0.1", + "resolved": "https://registry.npmjs.org/gestalt-design-tokens/-/gestalt-design-tokens-93.0.1.tgz", + "integrity": "sha512-MxF58+C2Gy8oL9ufZ8gwnC7LGTVeZuVzKbU5lZ4VOri0XtRyH69S+kb4oNTGFyA8MzXv4UREXAChbnEnh58cuw==", + "requires": {} + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "peer": true + }, "local-storage-fallback": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/local-storage-fallback/-/local-storage-fallback-4.1.2.tgz", @@ -56,6 +161,43 @@ "requires": { "cookie": "^0.3.1" } + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "requires": { + "loose-envify": "^1.1.0" + } + }, + "react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "peer": true, + "requires": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + } + }, + "scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "peer": true, + "requires": { + "loose-envify": "^1.1.0" + } } } } diff --git a/package.json b/package.json index b2aa4b8f2..9d91a2b0e 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "homepage": "https://github.com/karkir0003/Deep-Learning-Playground#readme", "dependencies": { "dotenv": "^16.0.3", + "gestalt": "^93.0.1", "local-storage-fallback": "^4.1.2" } } From cc06ec1432af796a194bbdd2844b6e0f500788f2 Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Sat, 11 Feb 2023 15:51:38 -0500 Subject: [PATCH 2/7] display execution table data from backend --- .../dynamo_db_utils/execution_db.py | 17 ++ backend/driver.py | 2 +- .../src/components/Dashboard/Dashboard.js | 160 ++++++++++-------- 3 files changed, 105 insertions(+), 74 deletions(-) diff --git a/backend/aws_helpers/dynamo_db_utils/execution_db.py b/backend/aws_helpers/dynamo_db_utils/execution_db.py index a61bfe51b..210399cd3 100644 --- a/backend/aws_helpers/dynamo_db_utils/execution_db.py +++ b/backend/aws_helpers/dynamo_db_utils/execution_db.py @@ -64,6 +64,23 @@ def createUserExecutionsData(entryData: dict) -> str: return json.dumps(newRecord.__dict__) def updateUserExecutionsData(requestData: dict) -> str: + """ + Updates an entry from the `execution-table` DynamoDB table given an `execution_id`. + @param requestData: A dictionary containing the execution_id and other table attributes to be updated, with user_id as a required field + @return a success status message if the update is successful + """ + + required_keys = ["execution_id"] + if not validate_keys(requestData, required_keys): + raise ValueError(f"Missing keys {required_keys} in request body") + + dynamoTable = ExecutionDDBUtil(EXECUTION_TABLE_NAME, AWS_REGION) + execution_id = requestData["execution_id"] + updatedRecord = ExecutionData(**requestData).__dict__ + updatedRecord.pop("execution_id") + dynamoTable.update_record(execution_id, **updatedRecord) + return "{\"status\": \"success\"}" + def getAllUserExecutionsData(user_id: str) -> str: """ Retrieves an entry from the `execution-table` DynamoDB table given an `execution_id`. Example output: {"execution_id": "blah", "user_id": "blah", "name": "blah", "timestamp": "blah", "data_source": "TABULAR", "status": "QUEUED", "progress": 1} diff --git a/backend/driver.py b/backend/driver.py index 8530431a1..64291feca 100644 --- a/backend/driver.py +++ b/backend/driver.py @@ -16,7 +16,7 @@ from backend.firebase_helpers.firebase import init_firebase from backend.aws_helpers.dynamo_db_utils.learnmod_db import UserProgressDDBUtil, UserProgressData from backend.aws_helpers.sqs_utils.sqs_client import add_to_training_queue -from backend.aws_helpers.dynamo_db_utils.execution_db import ExecutionDDBUtil, ExecutionData, createUserExecutionsData, getOrCreateUserExecutionsData_, updateUserExecutionsData_, getAllUserExecutionsData +from backend.aws_helpers.dynamo_db_utils.execution_db import createUserExecutionsData, getAllUserExecutionsData from backend.common.constants import EXECUTION_TABLE_NAME, AWS_REGION, USERPROGRESS_TABLE_NAME, POINTS_PER_QUESTION from backend.dl.detection import detection_img_drive diff --git a/frontend/playground-frontend/src/components/Dashboard/Dashboard.js b/frontend/playground-frontend/src/components/Dashboard/Dashboard.js index 3080b738d..fc93de0c3 100644 --- a/frontend/playground-frontend/src/components/Dashboard/Dashboard.js +++ b/frontend/playground-frontend/src/components/Dashboard/Dashboard.js @@ -6,15 +6,16 @@ import { TableHead, TableRow, } from "@mui/material"; -import { Button } from "gestalt"; +import { Box, Button } from "gestalt"; import "gestalt/dist/gestalt.css"; -import React, { useEffect } from "react"; +import React, { useEffect, useState } from "react"; import PropTypes from "prop-types"; import ArrowForwardIcon from "@mui/icons-material/ArrowForward"; import { useNavigate } from "react-router-dom"; import { useSelector } from "react-redux"; import { sendToBackend } from "../helper_functions/TalkWithBackend"; import "./../../App.css"; +import { auth } from "../../firebase"; const rows = [ { @@ -74,7 +75,7 @@ const StatusDisplay = ({ statusType, status }) => { Queued: {status} ); - } else if (statusType === "training") { + } else if (statusType === "STARTING") { return ( ); - } else if (statusType === "finished") { + } else if (statusType === "SUCCESS") { return ( ); } else if (statusType === "SUCCESS") { @@ -153,7 +155,8 @@ const FilledGrid = () => { ); + } else if (statusType === "ERROR") { + return ( + + ); } else if (statusType === "SUCCESS") { return ( ); + } else if (statusType === "UPLOADING") { + return ( + + ); + } else if (statusType === "TRAINING") { + return ( + + ); } else if (statusType === "ERROR") { return (