Skip to content
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

Sets up the hamilton ui to run on sqlite + be installed/run with a pip install command #942

Merged
merged 4 commits into from
Jun 13, 2024

Conversation

elijahbenizzy
Copy link
Collaborator

@elijahbenizzy elijahbenizzy commented Jun 8, 2024

You can run it with:

  • python manage.py runserver --settings=server.settings_mini 0.0.0.0:8241 from ui/backend/server
  • npm run start from ui/frontend/server

Changes

How I tested this

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@elijahbenizzy
Copy link
Collaborator Author

This is working -- you can:

pip install "sf-hamilton[serve]==1.65.0rc0"
hamilton-serve

@elijahbenizzy elijahbenizzy force-pushed the simplify-ui-local-dev branch 9 times, most recently from a504907 to 02b058a Compare June 10, 2024 21:49
We:

1. get it to work with sqllite
2. Package up UI
3. Add a hamilton build script

This way someone can just run pip install hamilton[ui] && hamilton ui and it'll work.

Design decisions:

1. Switch fields between postgres and sqllite -- this is a bit of a hack but it's the only way to truly dynamically swap
between models. We use a custom array field in sqllite and use standard
array field in postgres.

2. Use a deploy/build script -- this is the only way to get it to work

Still need to add to docs + improve deployment/installation mechanism
@elijahbenizzy
Copy link
Collaborator Author

elijahbenizzy commented Jun 10, 2024

TODO:

  • Docs -- add to the UI section
  • README -- add getting started to the front page
  • Test out the docker iamges so they still world
  • Add in example projects (skipping out for now due to timing)

@elijahbenizzy elijahbenizzy marked this pull request as ready for review June 11, 2024 03:29
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to de201bb in 48 seconds

More details
  • Looked at 1892 lines of code in 33 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_9UR0UCedarVhF4fN


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

MANIFEST.in Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@elijahbenizzy elijahbenizzy changed the title Sets up the hamilton ui to run on sqlite (WIP) Sets up the hamilton ui to run on sqlite Jun 11, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 025945c in 48 seconds

More details
  • Looked at 19 lines of code in 1 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. setup.py:53
  • Draft comment:
    The removal of package_data in the setup.py file might affect the packaging of the UI or other components. Please ensure that this change does not unintentionally remove necessary files from the package.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_LSqGkXF1WxehFErL


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 1e84407 in 39 seconds

More details
  • Looked at 360 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. ui/backend/server/commands.py:60
  • Draft comment:
    The run function in commands.py has been modified to include a new parameter no_open and logic to open the browser when the server is ready. This is a significant change in behavior. Please ensure this is documented in the PR description and tested thoroughly.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_ZMjkzWZx0EpB0UKI


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

ui/backend/setup.py Outdated Show resolved Hide resolved
ui/backend/setup.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to clean up the UI setup.py I think.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on af7789d in 52 seconds

More details
  • Looked at 395 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. ui/backend/server/commands.py:62
  • Draft comment:
    The environment variable DJANGO_SETTINGS_MODULE is set to hamilton.server.server.settings_mini. Ensure the path is correct as it seems to include 'server' twice which might be incorrect.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_3fDK1ql4mQZWbYwB


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 1ffaabd in 1 minute and 7 seconds

More details
  • Looked at 317 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_ShzoXckHanzEdMLB


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.


def run(port: int, base_dir: str, no_migration: bool, no_open: bool):
env = {
"DJANGO_SETTINGS_MODULE": "hamilton.server.server.settings_mini",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Django settings module path seems incorrect. It points to 'hamilton.server.server.settings_mini', which likely does not exist due to the double 'server' directory. Please correct the path to ensure the Django application can start correctly.

Suggested change
"DJANGO_SETTINGS_MODULE": "hamilton.server.server.settings_mini",
"DJANGO_SETTINGS_MODULE": "hamilton_ui.server.settings_mini",

This is much cleaner/decoupled from the hamilton core capabilities.

See README for installation/publishing instructions.
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 9f0a7cd in 1 minute and 29 seconds

More details
  • Looked at 317 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. ui/README.md:90
  • Draft comment:
    The PR title and description should be updated to accurately reflect all the significant changes made, not just the setup to run on SQLite.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_bgb9fHkYruO1TP8g


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@elijahbenizzy elijahbenizzy changed the title Sets up the hamilton ui to run on sqlite Sets up the hamilton ui to run on sqlite + be installed/run with a pip install command Jun 13, 2024
@elijahbenizzy elijahbenizzy merged commit 3f96279 into main Jun 13, 2024
26 checks passed
@elijahbenizzy elijahbenizzy deleted the simplify-ui-local-dev branch June 13, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants