-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web dashboard #613
Web dashboard #613
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the great start @KIRA009 !
Code looks good other than a few small comments. Initially I was unable to install it:
(openadapt-py3.10) abrichr@MacBook-Pro-4 OpenAdapt % cd openadapt/app/dashboard
(openadapt-py3.10) abrichr@MacBook-Pro-4 dashboard % nvm use
Found '/Users/abrichr/oa/src/OpenAdapt/openadapt/app/dashboard/.nvmrc' with version <21>
N/A: version "21 -> N/A" is not yet installed.
You need to run "nvm install 21" to install it before using it.
(openadapt-py3.10) abrichr@MacBook-Pro-4 dashboard %
May be worth adding this to the README:
nvm install 21
As mentioned in a comment, ideally these would get executed automatically as part of the main project poetry install
.
Also, since I had another project running on port 3000:
2024-03-23 15:20:42.823 | INFO | openadapt.config:<module>:269 - active_branch_name='feature/web-dashboard-setup'
2024-03-23 15:20:42.824 | INFO | openadapt.config:<module>:271 - is_reporting_branch=False
> [email protected] dev
> concurrently "npm run next-dev" "npm run fastapi-dev"
[1]
[1] > [email protected] fastapi-dev
[1] > python3 -m uvicorn api.index:app --reload
[1]
[0]
[0] > [email protected] next-dev
[0] > next dev
[0]
[1] INFO: Will watch for changes in these directories: ['/Users/abrichr/oa/src/OpenAdapt/openadapt/app/dashboard']
[1] INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
[1] INFO: Started reloader process [4696] using WatchFiles
[0] ⚠ Port 3000 is in use, trying 3001 instead.
[0] ▲ Next.js 14.1.4
[0] - Local: http://localhost:3001
[0]
[1] INFO: Started server process [4698]
[1] INFO: Waiting for application startup.
[1] INFO: Application startup complete.
[0] ✓ Ready in 7.9s
The tab that opened in Chrome opened to http://localhost:3000/ , however. I think we need to be able to determine the url programmatically. What do you think?
openadapt/app/dashboard/api/index.py
Outdated
|
||
@app.get("/api/python") | ||
def hello_world(): | ||
return {"message": "Hello World"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think to get this merged, there should be some minimal functionality, e.g:
- list recordings (e.g. https://github.com/OpenAdaptAI/OpenAdapt/blob/main/openadapt/app/tray.py#L157)
- start recording (e.g. https://github.com/OpenAdaptAI/OpenAdapt/blob/main/openadapt/app/cards.py#L79)
- stop recording (e.g. https://github.com/OpenAdaptAI/OpenAdapt/blob/main/openadapt/app/cards.py#L68)
Please also add screenshots to your PR description! 🙏 |
75086c8
to
9af81f6
Compare
9af81f6
to
06c6f76
Compare
README.md
Outdated
cd openadapt/app/dashboard | ||
nvm install 21 | ||
nvm use | ||
npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally all of this would be automated.
What do you think about something like this: https://stackoverflow.com/a/73649412
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./entrypoint.sh: line 3: nvm: command not found
./entrypoint.sh: line 4: nvm: command not found
# __init__.py
import os
import subprocess
def _run(bash_script):
return subprocess.call(bash_script, shell=True)
def entrypoint():
cwd = os.path.dirname(os.path.realpath(__file__))
os.chdir(cwd)
return _run(f"source ./entrypoint.sh")
# entrypoint.sh
#!/bin/bash
nvm install 21
nvm use
npm install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Via ChatGPT:
#!/bin/bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 21
nvm use 21 # Specify the version to ensure it uses the right one
npm install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also install npm and nvm in the installation scripts, and update the manual installation steps in the README to include this as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added on cfba059
To get this merged:
|
1750f78
to
cfba059
Compare
README.md
Outdated
@@ -96,6 +96,8 @@ pip3 install poetry | |||
poetry install | |||
poetry shell | |||
alembic upgrade head | |||
poetry run dashbaord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command installs the npm packages, so I figured we should add it in the installation phase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to install the npm packages as part of poetry install
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to be the case 🤔
@KIRA009 can you please also look into why the build is failing? https://github.com/OpenAdaptAI/OpenAdapt/pull/613/checks |
fef417a
to
d8e4df7
Compare
The CI fail seems really baffling. |
Via ChatGPT: The issue here is with the Continuous Integration (CI) setup on GitHub Actions, specifically related to caching and the environment setup for running
Solutions
Review and adjust the GitHub Actions workflow file based on these suggestions to resolve the CI failure. |
c3a7fa2
to
8285e25
Compare
74ae8c8
to
23bd7d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What kind of change does this PR introduce?
This PR adds a web dashboard to the tray. The tray now contains a 'Launch dashboard' option, clicking on which will start a nextjs server at port 3000, and a fastapi server at 8000. A new browser tab will be opened with the nextjs app url. On exiting the tray, the servers are gracefully shutdown.
To complete the initial setup, see the changes to the
Manual Setup
section inREADME.md
Summary
Checklist
How can your code be run and tested?
To complete the initial setup, see the changes to the
Manual Setup
section inREADME.md
Screenshot
Screen recoding
[Google drive link](https://drive.google.com/file/d/18L3tR2IHKlRvU2XICfMphomd8-dQm-am/view?usp=drive_link)