-
Notifications
You must be signed in to change notification settings - Fork 362
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
fix: persist workspace id/name & experiment id for historic allocations [DET-10378] #9550
Conversation
✅ Deploy Preview for determined-ui canceled.
|
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.
It looks mostly good, though I have some slight concerns about how it behaves in the event insertion into allocation_workspace_info
fails but allocation starts.
@@ -459,38 +459,13 @@ func (m *Master) getResourceAllocations(c echo.Context) error { | |||
Where("ts.event_type = 'IMAGEPULL'"). | |||
Group("a.allocation_id") | |||
|
|||
taskWorkspaceIDs := db.Bun().NewSelect(). |
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.
-- Populate the new table with existing data based on the previous method of resolving the workspace info & experiment_id | ||
insert into allocation_workspace_info (allocation_id, workspace_id, workspace_name, experiment_id) | ||
select | ||
allocation_workspace.allocation_id, |
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.
nit: de-indent?
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.
should I also de-indent all the above select columns 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.
I kinda like the indentation for clarity, but I will make sure that I'm consistent with my case (insert into & select should be caps)
c205145
to
2cd5f4b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9550 +/- ##
==========================================
- Coverage 52.20% 49.82% -2.39%
==========================================
Files 753 1247 +494
Lines 112452 162278 +49826
Branches 2888 2888
==========================================
+ Hits 58711 80847 +22136
- Misses 53569 81259 +27690
Partials 172 172
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
looks good, modulo a few nits & making sure CircleCI is green.
If more tests can't be added in this PR I do want to see this PR linked in a backlog ticket to write them
… for lost entries due to experiment deletion
…in memory workspace information
f4e1272
to
9a06d53
Compare
AllocationID AllocationID `db:"allocation_id" bun:"allocation_id,notnull"` | ||
ExperimentID int `db:"experiment_id" bun:"experiment_id"` | ||
WorkspaceID int `db:"workspace_id" bun:"workspace_id,notnull"` | ||
WorkspaceName string `db:"workspace_name" bun:"workspace_name,notnull"` |
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 there a reason why we need to persist workspace name separately? is it to avoid doing another join on the workspaces table?
if at the time of the allocation/persist, the workspace (let's say ID=1) had name "myworkspace", but when fetching historical records the workspace 1 had changed names to "neworkspacename", is expected behavior to show the old name or the latest?
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.
The intention here is to show the old name, this was primarily done to handle cases where the workspace had been deleted
do we have a sense of how long the migration will take? might be worth calling out in release notes. |
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.
few clarifying questions but otherwise lgtm
@azhou-determined |
0dd2204
to
96eb30e
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.
looks good! Thanks for handling it :)
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
alloc_experiments AS ( | ||
SELECT | ||
allocations.allocation_id, | ||
rtrim(substring(task_id, '\d+?\.'), '.')::int AS experiment_id |
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.
Technically this can be any string, right? Should we have a fallback in case there is some "bad" data?
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.
Yep! If there's not a match or if the string is null, this will return null
Ticket
DET-10378
Description
Creates
allocation_workspace_information
table, responsible for persisting workspace id/name & experiment id for historic allocation reports. Adds new entries on successful creation of allocation for trials & NTSC tasks.Backfills table using existing process used to retrieve workspace & experiment information for the historic allocation CSV endpoints.
Modifies logic for historic allocation report to leverage
allocation_workspace_information
instead of resolving based on current state.Modifies existing e2e test to confirm workspace name is consistent when experiments are moved & deleted.
Test Plan
Checklist
docs/release-notes/
See Release Note for details.