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

Annotations #383

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Annotations #383

merged 2 commits into from
Oct 11, 2024

Conversation

elijahbenizzy
Copy link
Contributor

@elijahbenizzy elijahbenizzy commented Oct 1, 2024

Adds annotations workflow. See #285.

High-level:

  1. You can annotate an action
  2. This can be associated with a number of "observations", each one on a piece of data
  3. You can add notes/ground truths/thumbs up/thumbs down on these
  4. There is a project-level view (meant to be a queue) that you can work on
  5. You can download these into a CSV.

Changes

  • BE -- added endpoints to create, expose
  • FE -- added annotations view to app
  • FE -- added annotations by project
  • Edit + create modals to both

How I tested this

  • manually

Notes

Remaining:

  • Ensure this doesn't break the S3 implementation
  • Add docs + appropriate references

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.

Important

Add comprehensive annotations workflow with backend endpoints and frontend views for creating, updating, and managing annotations.

  • Backend:
    • Add AnnotationsBackendMixin to backend.py for handling annotations.
    • New endpoints in run.py for creating, updating, and retrieving annotations.
  • Frontend:
    • Add AnnotationsViewContainer and AnnotationsView in AppView.tsx for displaying annotations.
    • Add Drawer component in drawer.tsx for annotation editing.
    • Update ProjectList.tsx to include annotations link.
  • API:
    • Add models AnnotationCreate, AnnotationUpdate, AnnotationOut, AnnotationObservation, and AnnotationDataPointer.
    • Update DefaultService.ts with new annotation-related API calls.
  • Misc:
    • Update package.json dependencies for new features.
    • Add Chip component updates in chip.tsx for annotation tags.

This description was created by Ellipsis for bcd21d7. It will automatically update as commits are pushed.

Copy link

github-actions bot commented Oct 1, 2024

A preview of bcd21d7 is uploaded and can be seen here:

https://burr.dagworks.io/pull/383

Changes may take a few minutes to propagate. Since this is a preview of production, content with draft: true will not be rendered. The source is here: https://github.com/DAGWorks-Inc/burr/tree/gh-pages/pull/383/

@elijahbenizzy
Copy link
Contributor Author

elijahbenizzy commented Oct 1, 2024

TODO, will add more:

  • skip loading of annotations if BE does not support it
  • Fix up so it works with spans
    • Add in UI
    • Ensure it's in data model
  • Wire through to BE
    • create
    • get
    • update
  • Ergonomics
    • Restrict to a single annotation per (sequence_id, span_id) on the BE
    • Add form-validation for create
    • Add different tags for colors
    • Search bar based on tags
  • Test on S3/implement

@elijahbenizzy elijahbenizzy force-pushed the annotations branch 10 times, most recently from 647ec4f to 76caa91 Compare October 8, 2024 21:12
@elijahbenizzy elijahbenizzy changed the title WIP for annotations Annotations Oct 8, 2024
@elijahbenizzy
Copy link
Contributor Author

Annotations view with inline app
image

Annotations edit/create window:
image

Inline annotation edit modal
image

burr/tracking/server/backend.py Show resolved Hide resolved
burr/tracking/server/backend.py Show resolved Hide resolved
burr/tracking/server/backend.py Show resolved Hide resolved
burr/tracking/server/run.py Outdated Show resolved Hide resolved
burr/tracking/server/run.py Show resolved Hide resolved
burr/tracking/server/run.py Show resolved Hide resolved
burr/tracking/server/schema.py Show resolved Hide resolved
telemetry/ui/src/components/common/chip.tsx Outdated Show resolved Hide resolved
telemetry/ui/src/components/routes/app/StepList.tsx Outdated Show resolved Hide resolved
1. Exposes as mixin in the BE
2. Adds GET/POST/PUT endpoints
3. Creates data models

Does not work with s3 yet.
This allows for:
1. Creating + editing annotations in the app view
2. Viewing all annotations for a project
3. Editing in the project view
@elijahbenizzy elijahbenizzy marked this pull request as ready for review October 11, 2024 04:35
Copy link

@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 bcd21d7 in 59 seconds

More details
  • Looked at 3020 lines of code in 25 files
  • Skipped 1 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. telemetry/ui/src/components/routes/app/AppView.tsx:191
  • Draft comment:
    Consider simplifying the logic for setting the current action index by consolidating the logic for 'forceCurrentActionIndex' and 'disableNavigateSteps'. This will make the code cleaner and reduce duplication.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in AppView.tsx has a potential issue with the use of the 'forceCurrentActionIndex' prop. The logic to set the current action index is duplicated and could be simplified.
2. telemetry/ui/src/examples/MiniTelemetry.tsx:22
  • Draft comment:
    Consider removing the check against the string 'null' for the 'partitionKey' prop if it's already typed as 'string | null'. This can simplify the code and prevent potential errors.
  • Reason this comment was not posted:
    Confidence changes required: 30%
    In the MiniTelemetry.tsx file, the 'partitionKey' prop is checked against the string 'null', which might not be necessary if the prop is already typed as 'string | null'.

Workflow ID: wflow_TSM3mfjJbSGkk8Mv


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

@elijahbenizzy elijahbenizzy requested a review from skrawcz October 11, 2024 16:52
Copy link
Contributor

@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.

this looks good for a v1

@elijahbenizzy elijahbenizzy merged commit 7ab9513 into main Oct 11, 2024
12 checks passed
@elijahbenizzy elijahbenizzy deleted the annotations branch October 11, 2024 16:57
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