DSGT-DLP / Deep-Learning-Playground

Web Application where people new to Deep Learning can input a dataset and toy around with basic Pytorch modules without writing any code
MIT License
24 stars 8 forks source link

New POST endpoint to create Trainspace, as well as new dynamodb table #1110

Closed ssh51117 closed 8 months ago

ssh51117 commented 8 months ago

New POST endpoint to create Trainspace, as well as new dynamodb table

Github Issue Number Here: #1073 Issue Description Old POST endpoints went to a dynamodb table in us-west-2, and were separated by whether they were image or tabular. They also did not contain the right information

What solution does this PR provide? Made new create_trainspace file with the correct information, which can take in a list of models, datasets, and blocks and post them to a new trainspace database in us-east-1, and modified the necessary files for this to function correctly. Files changed: .gitignore: added terraform.tfstate dynamodb.tf: changed region to us-east-1 and updated file to reflect new dynamo table create_trainspace.ts: wrote this file to create the new POST endpoint get_all_trainspace.ts: changed function to get data from the correct table serverless/sst.config.ts: updated region to us-east-1 serverless/stacks/AppStack.ts: added POST trainspace/create function

Testing Methodology Tested using Postman to POST data to the new dynamodb table successfully. Test using multiple blocks and multiple datasets in one entry.

Any other considerations create_trainspace.ts can be easily edited to take different parameters if need be.

sweep-ai[bot] commented 8 months ago
Sweeping Resolving merge conflicts: track the progress here.

I'm currently resolving the merge conflicts in this PR. I will stack a new PR once I'm done.

[!CAUTION]

An error has occurred: [Errno 2] No such file or directory: '/tmp/cache/repos/DSGT-DLP/Deep-Learning-Playground/56b5ca5f18e637629ce3c8a44bb034201fbea2e678829951a5cfa057a17adcf9/feature-1073-terraform-trainspace-ddb/aws_write/init.py' (tracking ID: 26efa4a15d)

sweep-ai[bot] commented 8 months ago
Sweeping Fixing PR: track the progress here.

I'm currently fixing this PR to address the following:

[Sweep GHA Fix] The GitHub Actions run failed on 790a33d (nextjs) with the following error logs: ``` ```

[!CAUTION]

An error has occurred: Sweep could not find any files to modify (tracking ID: 59a81c3ae7)

farisdurrani commented 8 months ago

We don't push *.tfstate files ref. Please remove the file

sweep-ai[bot] commented 8 months ago
Sweeping Resolving merge conflicts: track the progress here.

I'm currently resolving the merge conflicts in this PR. I will stack a new PR once I'm done.

[!CAUTION]

An error has occurred: [Errno 2] No such file or directory: '/tmp/cache/repos/DSGT-DLP/Deep-Learning-Playground/88ed6bf30334d8651d76dd30eb8a93254d50a595ce818f9ab3dcc4d0495b2fec/feature-1073-terraform-trainspace-ddb/aws_write/init.py' (tracking ID: 042682124a)

ssh51117 commented 8 months ago

We don't push *.tfstate files ref. Please remove the file

I added dlp-terraform/dynamodb/terraform.tfstate to the gitignore. Is there anything else I need to do?

farisdurrani commented 8 months ago

You'll need to explicitly delete the file and push that change for it to disappear from the repo @ssh51117

ssh51117 commented 8 months ago

got it. Should I leave the file in gitignore? @farisdurrani

farisdurrani commented 8 months ago

Yes

sweep-ai[bot] commented 8 months ago
Sweeping Resolving merge conflicts: track the progress here.

I'm currently resolving the merge conflicts in this PR. I will stack a new PR once I'm done.

[!CAUTION]

An error has occurred: [Errno 2] No such file or directory: '/tmp/cache/repos/DSGT-DLP/Deep-Learning-Playground/089fe82b8d3071fe23a401d340c788ac04372c0a3fc2dc03ea2a69ac27d9a9a6/feature-1073-terraform-trainspace-ddb/aws_write/init.py' (tracking ID: b3bff3f5f7)

farisdurrani commented 8 months ago

So... SonarCloud is complaining about duplicate code in create_trainspace.ts and create_tabular_trainspace.ts starting from if (putCommandInput == null). Personally, I don't have a problem with this since we may want each file to act differently in the future, so I'll give my approval. But do wait for at least one other reviewer

karkir0003 commented 8 months ago

@farisdurrani @ssh51117 lets not worry abt sonarcloud here

sonarcloud[bot] commented 8 months ago

Quality Gate Failed Quality Gate failed

Failed conditions

29.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud