mobile_app_open icon indicating copy to clipboard operation
mobile_app_open copied to clipboard

simple web UI for submitted data

Open freedomtan opened this issue 1 year ago • 23 comments

Yes, most of us know how to read json files, but that's not convenient. We used to have some prototype web site, should we start from previous prototype or start a new one.

freedomtan avatar Nov 28 '23 05:11 freedomtan

Do we need a website? Currently, the app can upload, download and display the results from the same account stored as JSON files in Firebase. We can modify it to download any results stored in Firebase.

anhappdev avatar Nov 28 '23 05:11 anhappdev

Firebase Web hosting + React should be good enough. @RSMNYS please help have a prototype for this task.

freedomtan avatar Nov 28 '23 06:11 freedomtan

Hi guys! Here I've deployed the starter web app: https://mlcommons-8be22.web.app. It's linked to my firebase. Username/password: [email protected]/Qwerty1234(. The app has base routes: login, benchmarks, benchmark details. So far haven't worked on the list, and details UI, that's why I'm showing the text only. Please try.

RSMNYS avatar Dec 04 '23 09:12 RSMNYS

Hi guys! Did more adjustments. Please check, creds and url are the same. Also pushed the code to the branch. The project is linked to the test firebase account. Also added the README how to link to another firebase project and deploy. Working to add the filtering.

RSMNYS avatar Dec 11 '23 18:12 RSMNYS

Hi guys! Did more adjustments. Please check, creds and url are the same. Also pushed the code to the branch. The project is linked to the test firebase account. Also added the README how to link to another firebase project and deploy. Working to add the filtering.

Please add some device/machine information to the results

freedomtan avatar Dec 12 '23 06:12 freedomtan

@nathanw-mlc: please add @RSMNYS to the access list of the firebase project for the mobile app

freedomtan avatar Dec 19 '23 06:12 freedomtan

@nathanw-mlc: please add @RSMNYS to the access list of the firebase project for the mobile app

@RSMNYS should already have access to the mobile app firebase project through his MLCommons Google Workspace account. Is he needing elevated permissions?

nathanw-mlc avatar Dec 20 '23 00:12 nathanw-mlc

Screenshot 2024-01-01 at 17 43 22

@nathanw-mlc: please add @RSMNYS to the access list of the firebase project for the mobile app

@RSMNYS should already have access to the mobile app firebase project through his MLCommons Google Workspace account. Is he needing elevated permissions?

yes, I need the elevated permissions to manage the hosting.

RSMNYS avatar Jan 01 '24 15:01 RSMNYS

  • [x] If we create an account when submitting (instead of anonymous one), we should be able to use that account.

freedomtan avatar Jan 02 '24 06:01 freedomtan

@RSMNYS Please find a way to not expose the API key (e.g. like reading the values from the environment variables like here) https://github.com/mlcommons/mobile_app_open/security/secret-scanning/1

anhappdev avatar Jan 02 '24 06:01 anhappdev

Just found out that we can set up a GitHub Action to deploy the website to Firebase automatically on new PR. I will do the setup for it.

anhappdev avatar Jan 02 '24 06:01 anhappdev

Just found out that we can set up a GitHub Action to deploy the website to Firebase automatically on new PR. I will do the setup for it.

Will @RSMNYS still need elevated permissions if we use this solution?

nathanw-mlc avatar Jan 02 '24 21:01 nathanw-mlc

In this case we need to expose the project's API key and other settings from Firebase. Generally that info is not secure, but let me know if we are ok to reveal this: @freedomtan, @anhappdev.

RSMNYS avatar Jan 04 '24 07:01 RSMNYS

In this case we need to expose the project's API key and other settings from Firebase. Generally that info is not secure, but let me know if we are ok to reveal this: @freedomtan, @anhappdev.

We should not expose the API key, at least not storing it in the code. Please update file firebase-config.ts so it can read the values from the environment variable like this:

const firebaseConfig = {
  apiKey: process.env.REACT_APP_FIREBASE_WEB_API_KEY,
  authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
  // ... 
};

Then we can store the key and other values in env:

export REACT_APP_FIREBASE_WEB_API_KEY=abcd
export REACT_APP_FIREBASE_AUTH_DOMAIN=acbd

anhappdev avatar Jan 04 '24 08:01 anhappdev

@anhappdev it's clear, but how the GitHub will know this to build the app?

RSMNYS avatar Jan 04 '24 08:01 RSMNYS

@anhappdev it's clear, but how the GitHub will know this to build the app?

I will store it as a GitHub secret (https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions)

anhappdev avatar Jan 04 '24 08:01 anhappdev

Understood! Thanks.

RSMNYS avatar Jan 04 '24 08:01 RSMNYS

@nathanw-mlc here are the env variables for the web app:

REACT_APP_FIREBASE_WEB_API_KEY REACT_APP_FIREBASE_AUTH_DOMAIN REACT_APP_FIREBASE_DATABASE_URL REACT_APP_FIREBASE_PROJECT_ID REACT_APP_FIREBASE_STORAGE_BUCKET REACT_APP_FIREBASE_MESSAGING_SENDER_ID REACT_APP_FIREBASE_APP_ID REACT_APP_FIREBASE_MEASUREMENT_ID

RSMNYS avatar Jan 07 '24 16:01 RSMNYS

@nathanw-mlc here are the env variables for the web app:

REACT_APP_FIREBASE_WEB_API_KEY REACT_APP_FIREBASE_AUTH_DOMAIN REACT_APP_FIREBASE_DATABASE_URL ...

I already added these as GitHub secrets for this repo.

anhappdev avatar Jan 08 '24 03:01 anhappdev

This is the URL for the web UI. https://mobile-app-build-290400.web.app

We can also use a custom domain / URL if @nathanw-mlc provides us one.

anhappdev avatar Jan 11 '24 03:01 anhappdev

This is the URL for the web UI. https://mobile-app-build-290400.web.app

We can also use a custom domain / URL if @nathanw-mlc provides us one.

Hey Anh, where would I set that up?

nathanw-mlc avatar Jan 11 '24 21:01 nathanw-mlc

This is the URL for the web UI. https://mobile-app-build-290400.web.app We can also use a custom domain / URL if @nathanw-mlc provides us one.

Hey Anh, where would I set that up?

You can follow this guide: https://firebase.google.com/docs/hosting/custom-domain

anhappdev avatar Jan 12 '24 04:01 anhappdev

https://mlperf-mobile.mlcommons.org/

nathanw-mlc avatar Jan 12 '24 22:01 nathanw-mlc