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

CSI: per_alloc volumes have wrong link in alloc task table #11965

Closed
tgross opened this issue Jan 31, 2022 · 4 comments · Fixed by #12713
Closed

CSI: per_alloc volumes have wrong link in alloc task table #11965

tgross opened this issue Jan 31, 2022 · 4 comments · Fixed by #12713

Comments

@tgross
Copy link
Member

tgross commented Jan 31, 2022

In #11896 we moved the link target for CSI volumes on the allocation detail page to use the source field as the target for the URL. But for volumes with per_alloc = true, this doesn't work because the source does not include the allocation index:

$ curl -s "http://localhost:4646/v1/allocation/$alloc_id" |  jq '.Job.TaskGroups[0].Volumes'
{
  "csi_data": {
    "Name": "csi_data",
    "Type": "csi",
    "Source": "webdata",
    "ReadOnly": false,
    "AccessMode": "single-node-writer",
    "AttachmentMode": "file-system",
    "MountOptions": null,
    "PerAlloc": true
  }
}

For example, this link should be to webdata[0] because it's the 0th alloc:

Screen Shot 2022-01-31 at 2 21 00 PM

Because this data is written to the job and not to the individual allocations in the state store, we'd have to modify the state on the fly to make it the "correct" value in the API, but that would make the job definition in this API vary depending on which allocation we look at. So we should have this bit of logic in the UI add the allocation index, just as we do in the client when we consume this value.

Note that we haven't yet shipped this bug in a release, so it'd be nice for us to get to as part of the 1.3.0 work. I can probably take this one on while doing other CSI cleanup.

@tgross
Copy link
Member Author

tgross commented Apr 7, 2022

@philrenaud
Copy link
Contributor

Did some digging with @ChaiWithJai

  • The volumeMount object within a taskgroup lacks the volume.name property that would give us something like volume0[0] vs volume0[1];
  • the volume object has that name property, but does not come back with job.taskgroups[].tasks[].volumeMounts, nor with job.taskgroups[].volumes

there are two ways we could solve this:

  • Make an explicit ember store.findAll('volumes')... and query by the task's volume ID
  • Modify the API response for job.taskgroups[] and job.taskgroups[].tasks[] to return volume.name

Because of how many places we'd have to make that store request in the former option, I'm going to advocate for the latter. I'll have a look at the response schema shortly.

@tgross
Copy link
Member Author

tgross commented Apr 14, 2022

Modify the API response for job.taskgroups[] and job.taskgroups[].tasks[] to return volume.name

The problem here is that the API doesn't know the volume name, as the volume request is part of a task group and not an allocation. Including the name would imply that the output of nomad job status changes depending on which allocation you're looking at, but it doesn't look at allocations at all.

We're effectively running into the same problem with the first two bullet-points, which is that we're looking at the task group and not the allocation.

@github-actions
Copy link

github-actions bot commented Oct 9, 2022

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.