Project

General

Profile

Actions

Feature #23026

closed

UI to connect to a container's services from its page

Added by Brett Smith 9 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Target version:
Story points:
-
Release relationship:
Auto

Description

See the published_ports documentation for background. Something developed in #22859 but not documented yet is that the hash for each port also has an initial_url key, so
  • if published_ports[portnum].access = "public", link to published_ports[portnum].initial_url
  • if published_ports[portnum].access = "private", link to published_ports[portnum].initial_url with the current user's token inserted as arvados_api_token=v2/zzzzz-...& at the front of the query (typically initial_url will not have an existing query but we should preserve it when it does)

(Note the initial_url key appears only in the container record, not the container request record.)

When viewing a running process:

  • If it has exactly one published port, provide a button "Connect to [label]" that opens the service URL in a new tab.
  • If it has more than one published port, provide a button "Connect to service…" This opens a pulldown that lists the different services the container provides by label. The user can select one, and then Workbench opens the corresponding service URL in a new tab. The button should have the pulldown triangle on it so it's clear it's a pulldown.
    • In discussion we decided on a pulldown over a modal or other options. While we fully expect there to be more than one service per container, we never expect the number to get huge. More than 10 would be very surprising. So a pulldown is easy to navigate and easy enough to implement.
    • Where should the button go? With discussion, it should become the first item among the status buttons, before the "Cancel" button and "Running" badge. In wide windows there's enough space. In two-row situations, it becomes the top button with the other two below it. We should make sure the button has enough space to accommodate reasonable two-word service names like "Jupyter Notebook" or "Foobar Imaging." We can start thinking about truncation beyond that point. The button simply does not appear for non-service containers or non-running service containers. This button should be Action Button Blue, same as the Run button for unstarted processes.

Implementation note: There is a branch that already exists, 22706-show-published-ports @ ae9e27749c15411381f9ad77e2e7b589a90633be. You may use it as much or as little as you like for this. Some background you should have about it before you start:

  • It's a few weeks old so you should rebase on main first.
  • It was written before the API changes discussed above, so it probably generates URLs the "old" way and would need to be updated to the "new" way above.
  • We definitely want the UI described above and I think it implements something very different.

Files

service-menu-tooltip.png (22.3 KB) service-menu-tooltip.png Stephen Smith, 09/11/2025 02:13 PM
service-menu.png (155 KB) service-menu.png Stephen Smith, 09/11/2025 02:13 PM
running-singleservice.png (151 KB) running-singleservice.png Stephen Smith, 09/11/2025 02:13 PM
running-multiservice.png (151 KB) running-multiservice.png Stephen Smith, 09/11/2025 02:13 PM
nginx-double.json (998 Bytes) nginx-double.json Double service container Stephen Smith, 09/24/2025 02:46 PM
nginx-private.json (768 Bytes) nginx-private.json Private service container Stephen Smith, 09/24/2025 02:46 PM
default.conf (1.05 KB) default.conf Double service first config Stephen Smith, 09/24/2025 02:46 PM
extra.conf (1.05 KB) extra.conf Double service second config Stephen Smith, 09/24/2025 02:46 PM
nginx.json (764 Bytes) nginx.json Single service container Stephen Smith, 09/24/2025 02:46 PM
Screenshot_20250929_120558.png (155 KB) Screenshot_20250929_120558.png awkard layout Stephen Smith, 09/29/2025 04:07 PM

Subtasks 2 (0 open2 closed)

Task #23137: Review 23026-container-services-uiResolvedStephen Smith10/01/2025Actions
Task #23138: Interface review 23026-container-services-uiResolvedBrett Smith09/15/2025Actions

Related issues 4 (1 open3 closed)

Related to Arvados Epics - Idea #17207: services running in containersIn Progress03/01/202508/31/2025Actions
Related to Arvados - Feature #22706: show published ports on workbench process pageClosedStephen SmithActions
Related to Arvados - Feature #23163: Add confirmation dialog to process title bar cancel buttonDuplicateActions
Related to Arvados - Feature #23161: Cancelling a process should require confirmationResolvedStephen SmithActions
Actions #1

Updated by Brett Smith 9 months ago

  • Related to Idea #17207: services running in containers added
Actions #2

Updated by Brett Smith 9 months ago

  • Description updated (diff)
Actions #3

Updated by Tom Clegg 9 months ago

  • Description updated (diff)
Actions #4

Updated by Brett Smith 9 months ago

  • Target version deleted (Development 2025-07-23)
Actions #5

Updated by Brett Smith 8 months ago

  • Description updated (diff)
Actions #6

Updated by Brett Smith 8 months ago

  • Related to Feature #22076: keep-web can create a zipfile on the fly of a collection added
Actions #7

Updated by Brett Smith 8 months ago

  • Related to deleted (Feature #22076: keep-web can create a zipfile on the fly of a collection)
Actions #8

Updated by Brett Smith 8 months ago

  • Related to Feature #22706: show published ports on workbench process page added
Actions #9

Updated by Brett Smith 8 months ago

  • Description updated (diff)
Actions #10

Updated by Brett Smith 8 months ago

  • Target version set to Development 2025-08-21
  • Assigned To set to Stephen Smith
Actions #11

Updated by Brett Smith 7 months ago

  • Target version changed from Development 2025-08-21 to Development 2025-09-03
Actions #12

Updated by Stephen Smith 7 months ago

  • Status changed from New to In Progress
Actions #13

Updated by Stephen Smith 7 months ago

  • Subtask #23137 added
Actions #14

Updated by Stephen Smith 7 months ago

  • Subtask #23138 added
Actions #15

Updated by Brett Smith 7 months ago

  • Target version changed from Development 2025-09-03 to Development 2025-09-17
Actions #16

Updated by Tom Clegg 7 months ago

(This would have been more helpful to say earlier, but...)

Space is already tight in the top title/button bar where the "cancel" button and "running" badge are. I can see this getting awkward when the (entirely user-defined) service label gets longer.

Could this go in its own tab? It wouldn't even need to be a dropdown, we could just show the entire list. (Admittedly there are already lots of tabs.)

Could it go in the Overview tab? Even here it might not need to be a dropdown.

Updated by Stephen Smith 6 months ago

I've tried to address the space concerns by limiting the button to a fixed width and using an ellipse and tooltip to let users see the truncated name. I also ended up making it always a 2-row layout (instead of 1 row that automatically wraps) for several reasons:

  • The automatic wrapping of the process name doesn't coordinate well with automatic wrapping of the button row
  • In a single row layout and a short process and service name like "nginx server" and "service", the top row is basically full already so it would immediately wrap anyway once resized, so it would be a lot of work for something that won't be seen except for the most ideal cases

Here are some screenshots of the single/multi service button, the multi service menu, and the single service tooltip. The button shows up any time the process is running and there is 1 or more service definitions on the container.

Actions #18

Updated by Brett Smith 6 months ago

The UI is good, thanks. I happened to notice one bug that would be good to fix if possible:

  1. I have All Processes open in a tab.
  2. I submit a service container request via CLI.
  3. In my open tab, I see the new process and open it.
  4. When I open the process page, the "Connect to service" button is available (good).
  5. But if I just sit on that process page, after about 5-10 seconds the button disappears (bad). If I refresh the page it reappears and stays there. I'm guessing there's some state transition early in the process lifecycle that clears the button that shouldn't.

I noticed this with both single-port and multi-port containers.

Actions #19

Updated by Brett Smith 6 months ago

  • Target version changed from Development 2025-09-17 to Development 2025-10-01
Actions #20

Updated by Stephen Smith 6 months ago

  • Related to Feature #23163: Add confirmation dialog to process title bar cancel button added
Actions #21

Updated by Stephen Smith 6 months ago

  • Related to Feature #23161: Cancelling a process should require confirmation added
Actions #22

Updated by Stephen Smith 6 months ago

Changes at arvados|cfcd70a4b097bf258553c3c45ffe0328baf3bf65 branch 23026-container-services-ui
Tests developer-run-tests-services-workbench2: #1614

  • All agreed upon points are implemented / addressed.
    • Added service button which shows whenever status=running and published_ports.length
    • Styled buttons to always be in a 2-row format, with the stop/status stretching to match the service button width
    • Added tooltip to single service button for long names
    • Added error toasts for when token is missing (for private services) or empty/malformed URL
    • Added published_ports field to containerRequestFieldsNoMounts, fixes the bug Brett noticed due to some requests excluding published_ports causing it to disappear
    • Added unit tests for the URL token injection - I could not find a case where the URL constructor does not return a search+hash that does not match the end of the href, but that case is checked just to be safe
    • Added component test for single/multi service with public/private url that verifies correct URL opened
    • Added integration test to test basic service button and URL opened (I only did a basic test for the integration since the component / unit tests already cover all the edge cases)
  • Anything not implemented (discovered or discussed during work) has a follow-up story.
    • Follow up ticket #23161 to add confirmation dialog to cancel button to prevent misclicks
  • Code is tested and passing, both automated and manual, what manual testing was done is described
    • Passes all tests, added fairly comprehensive new tests
  • Documentation has been updated.
    • n/a
  • Behaves appropriately at the intended scale (describe intended scale).
    • Intended scale to be ~10ish services
  • Considered backwards and forwards compatibility issues between client and server.
    • There is only 1 concern, if WB is updated before the server knows about published_ports, then processes won't load. This is probably unlikely to happen since I assume the only time anyone updates WB is when they're updating arvados.
  • Follows our coding standards and GUI style guidelines.
    • yes

Updated by Stephen Smith 6 months ago

Steps to create the service containers with published ports are roughly following: https://dev.arvados.org/attachments/3910

(As an alternate option, I shared my nginx test project so you should be able to just edit the owner_uuid in the json to a project of your own and reuse my collections/docker image)

  • Upload default.conf and extra.conf to an nginx config collection
  • Upload a root index.html and an extra/index.html to a webroot collection
  • Upload nginx docker image with docker pull nginx:1.29.0 && arv-keepdocker nginx 1.29.0
  • Replace owner_uuid with the project to hold the processes, container_image with the pdh of the uploaded docker image, the html mount collection uuid with the webroot collection uuid, and for the double service, the conf.d mount with the collection uuid containing nginx configs

arv container_request create -o nginx.json and the container will start

Copying and rerunning the processes loses the published ports currently.

Actions #24

Updated by Lisa Knox 6 months ago

UI notes (acknowledging this is not actually an Interface review):
  • On my screen, the ServiceMenu button cuts off with ellipses for no real reason (as in, it's not saving a significant amount of space and looks off). Removing the flexGrow, flexbasis, and minWidth properties on the buttonContainer frees this up and looks better in my opinion. The button will still overflow to ellipses when occluded by the toolbar, so I can't see a reason not to.
  • To me, it looks better if the ServiceMenu button is below the Run/Cancel button and status badge rather than above (something about the order of the colors I think), but I don't feel too strongly about it either way.
  • I'm also not a fan of the ServiceMenu with multiple ports looking like an HTML <select> but behaving like a button with a popover. Perhaps setting the width of the popover to the same as the width of the button and word-wrapping the list items? Or changing it to an MUI Select (https://mui.com/material-ui/react-select/#placeholder) maybe? Again, I don't feel too strongly about this.
Code notes:
  • injectTokenParam() is very generic and might be useful elsewhere, so it should probably be in its own file in /common
  • in process.cy.js L465, Cypress best practices recommends using data-* for test selectors, because sometimes UI libraries (like MUI) inject their own id prop.
Actions #25

Updated by Stephen Smith 6 months ago

Changes at arvados|fd4d2f302031a433d9b2c99b545dc549fea1ec96
Tests developer-run-tests-services-workbench2: #1622

On my screen, the ServiceMenu button cuts off with ellipses for no real reason

So I actually spent several days trying to get this to work nicely - with the suggested changes, the service button does expand to take up extra space, but that happens at the expense of space for the title which is noticeable when the title is long. It seems flexbox is unable to operate in a mode where the title is 100% prioritized before giving extra space to the button cluster, since flexbox allocates space in a proportional mode. So when the process title and service name are both long, space is split proportionally between them causing the service button to get a lot of space and causing the title to wrap.

Ideally, the title would be given as much space as possible minus the minimum space required for the buttons (their min-width) and then the service button expanded as needed, but I don't think it's possible to do that without JS. I had attempted to make this happen by making the flex-basis of the title to be content and the flex-basis of the button to be it's min-width, but flex-basis doesn't seem to work as expected for content that wraps (I think the basis ends up being the wrapped content). And then there's the problem that you must pick a static proportion for allocating extra space or shrinking the basis if the title is too big. Removing flex-grow and flex-shrink really just defaults it 0 and 1, so the areas would be equally shrunk as necessary instead of shrinking the button cluster before the title so you end up with a wrapped title and the button cluster awkwardly taking up half the space.

(basically this can happen and because the allocation is proportional to flex-basis, there isn't a good way to prevent it)

I would be open to a solution but I don't think it's easy to make it behave nicely with longer process titles, and I think that may be a common case so it seems safer to just stick to a static button cluster width.

To me, it looks better if the ServiceMenu button is below the Run/Cancel button

Done

I'm also not a fan of the ServiceMenu with multiple ports looking like an HTML <select>

I was actually modeling it after the Menu component (https://mui.com/material-ui/react-menu/#customization). I would push back against using Select since it's unexpected for a select input to perform an action when something is selected, and I think the popover menu being a different width is fine since it's anchored on one corner and that's the normal behavior in the MUI example

injectTokenParam() is very generic and might be useful elsewhere

Moved to common/url

in process.cy.js L465

Fixed, I kept the ID since it's used for aria-labeledby but the test uses data-cy

Actions #27

Updated by Brett Smith 6 months ago

  • Target version changed from Development 2025-10-01 to Development 2025-10-15
Actions #28

Updated by Lisa Knox 6 months ago

LGTM

Actions #29

Updated by Stephen Smith 6 months ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF