Skip to main content

Week 3

Dec 12/12/2022

  1. Tasks for today
  2. refactor template for aspnetcore template
  3. split frontend and backend
  4. check with Melissa once you receive the latest datadump from her
  5. onClick behavior enabled for the pushpins
  6. CHAMA
    1. deploy aspnet core backend as an app service
    2. deploy react frontend
    3. have the frontend query the weatherforecast api
    4. this works without the proxy (calling the endpoint directly)

Finding closest rainguage for each subcatchment

The following logic would be implemented as a Python Script.

pseduocode

for each subcatchment
calculate the distance between it and all rainguages
find the smallest
update the `rainguage` attribute inside the rainguages GeoJSON

output --> subcatchment id, raingage as a csv?
how do we update inside the SWMM file?

Dec 12/13/2022

  1. ORSANCO
    1. Restore SQL Dump from Melissa
    2. Run and check the queries, graph looks okay
    3. Directly populate graph No need to click on Apply (automatic apply button event)
  2. TDEngine
    1. Look at the TDEngine and familiarize yourself with it
    2. Create an account on TDEngine
    3. Dig up Pavan's C# console app (CURL app)
    4. TDEngine repo(app is called test_tdconnection)
      1. Repo is now created over here
      2. Create a README and point it over here
  3. Links for .NET 6 CORS stuff
    1. Link 1
    2. Links from Microsoft Documentation
      1. Link 1
      2. Microsoft CORS Documentation
    3. Reach out to Steve for some advice
  4. Collimator
    1. Follow up with Brian high priority
  5. Grafana
    1. create Grafana account
    2. login with Pavan's account
    3. look at gqccollimator Grafana dashboard

Design for foo

Notes on proxy-server

TLDR; Proxy is not meant to be used in production (deployment). It is only meant to be used of local development.

  1. Link 1
  2. Link 2
  3. Link 3

Suggested solution

What to use instead of a proxy? Answer HERE

Proxy server

Dec 12/14/2022

  1. ORSANCO
    1. Fix bug on the deployed site
    2. disabled text input now you can only update the textboxes from the maps page
  2. Reply from Brian
    1. Waiting for his reply
    2. created a new gqc-collimator discord server
  3. Deployed ASP.NET Core
    1. create a new endpoint to get the sensor data from the TDEngine repo
  4. Reply the guy from Azure support
  5. CHAMA
    1. write up the action plan
  6. OH
    1. reorg of project docs in the people and docs
    2. need to write up a small plan and show it to Sudhir

Action plan for Chama

  1. get cordinates of the 5 subcatchments
  2. find the size of the ellipse
    1. size of the ellipse (vertical span) = dist(center , bottom left)
    2. width of the ellipse (horizontal span) = 0.5 * vertical span
  3. C = 1/(ax + ay + k), k=(1/100)
  4. Now, (x and y are in feet)
    1. x = 0.5*y
    2. k = known
    3. C = 10 lbs
    4. solve for a

Dec 12/15/2022

  1. Meeting with Azure support today @1.30 pm (Probably cancel the meeting)
  2. Enable caching node_modules in people site and the docs site
  3. Follow-up with Brian (Collimator) he wanted to check with the engineering team
  4. Suggestion from Ragu
    1. Remove trailing slash fixes the CORS issue
  5. CHAMA
    1. plumes are ready
    2. subcatchments impacted by ploom
    3. impacts with linear and exponential decay
    4. shape files for the plume (individual and merged) sent
    5. shape files for the affected subcatchment (individual and merged) sent

CHAMA Meeting notes

  1. Send Melissa the new pushpin layer
    1. Add TSS as Polutant
  2. Factor in the radioactive Jake mentioned it briefly
  3. SWMM on my system
  4. Any other CHAMA repositories as well
  5. Doc for raingage generation

Dec 12/16/2022

  1. ORSANCO
    1. new support ticket created for debugging
    2. Deployed Orsanco backend
      1. check available smaller sizes, switch to a smaller one
  2. aspbackend
    1. started the creation of the TDEngine controller
    2. will need more help either from Jake or Melissa

ORSANCO DB querying and other issues

  1. Running the debugger to see the response of the query
    note

    the debugger directly connects to the VM.

  2. Through the debugger you can see how the Queryset are being populated and filtered. Connection details are encapsulated.
  3. The connection is made possible, since Deven's and Jake's IP addresses are configured in the VM settings.

Additional deployment created for testing

  1. I created a new web app -- clone of the existing orsanco-frontend
  2. The repo is called orsanco_frontend_test_master
  3. The app is deployed over here LINK
  4. The app contains the deployment from the master branch.
frontend branchextrasfrontend-urltoolurlDRFDatabaseWorks?
masterif you go directlyhttps://witty-plant-016ac0c10.2.azurestaticapps.net/dashboard/graphpagebrowserhttps://riverflows.azurewebsites.net/api/fake_datamasterNAyes
masterif you select a push pin and then go to graphpagehttps://witty-plant-016ac0c10.2.azurestaticapps.net/dashboard/graphpagebrowserhttps://riverflows.azurewebsites.net/api/daily/?startdate=1662076800&enddate=1663459200&river=Mississippi&reach=Lower%20Miss.&station=846&agg=flowmasteryesCORS error

Error

Cors error while querying DB

  • The CORS error on the site indicates a weird thing.
  • It is able to query the fake_data endpoint at https://riverflows.azurewebsites.net/api/fake_data (output at the btm of the screenshot)
  • But, when it tries to query the endpoint at https://riverflows.azurewebsites.net/api/daily... it gives a CORS policy error.
  • API Query String:
    https://riverflows.azurewebsites.net/api/daily?startdate=1662076800&enddate=1663459200&river=Ohio%20River&reach=Mile=470.5_545&station=-485.25&agg=flow
  • Meaning, the VM is blocking the connection from frontend.
  • To resolve this, I added the frontend's IP into allowed origins on the VM in the configuration settings but that did not work.
  • Allowed origins VM
  • I even added the VM's IP address in Django's allowed origin, even that does not help.
  • The only thing left is to add the DRF in allowed origins of the VM.