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

Add ability to upload files to an allocations data folder from the UI #25227

Open
octdanb opened this issue Feb 26, 2025 · 1 comment
Open

Add ability to upload files to an allocations data folder from the UI #25227

octdanb opened this issue Feb 26, 2025 · 1 comment
Labels
stage/needs-discussion theme/alloc_dir Work that impacts the structure or permissions on the allocation directories built by Nomad. theme/storage theme/ui type/enhancement

Comments

@octdanb
Copy link

octdanb commented Feb 26, 2025

Proposal

Add the ability to upload a file into an allocations data folder via the UI.
Something like a file picker/dropzone.
Obviously there would need to be configurable limits on file size, user permissions for the uploaded files, file location and permissions to allow specific ACLs to upload ect.

Image

Use-cases

We use nomad clusters for hosting various docker containers, mostly web apps, nextjs/django/nginx/postgres ect.

It would be extremely useful to add the functionality to be able to upload a file via the nomad ui into an allocations data folder. This would allow for one off tasks to be able to be run which rely on external files, which are not built inside the docker container.

For example a csv file which containers records which will be used for scaffolding users or content
Or external postgres backup for restoration.

Attempted Solutions

Our current implementation is,
SCP the required file via bastion server to a nomad node in a preconfigured location which an allocation has access to via a local volume.
Then SSH via bastion server to nomad node, change permissions of file to ensure the docker containers user is able to access file. 

Nomad UI Exec into running allocation, move file into place, and run command with the uploaded file as an input.

Other solutions are to store these files in a private S3 bucket and use a signed URl, and curl the file into the running container.

@philrenaud
Copy link
Contributor

Hey @octdanb, this is a cool idea that might be a little tricky to implement. After talking with a colleague, we think it could be possible to use a websocket to POST here with specific (new) ACL permissions.

Implementation difficulty aside, there are also some governance/operations management concerns around letting users upload to allocs' ephemeral disks. A big one is the lack of quotas: a cluster manager isn't able to easily prevent their job operators from adding files beyond a particular limit, causing failures elsewhere that would be hard for them to diagnose. We encourage quotas for other storage types for this very reason.

This is all to say: it's something I'll dig into a bit more, but there are some challenges involved. Thanks for bringing it up, though; I agree it would be nice to have in the UI.

@philrenaud philrenaud added theme/ui theme/storage theme/alloc_dir Work that impacts the structure or permissions on the allocation directories built by Nomad. stage/needs-discussion labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-discussion theme/alloc_dir Work that impacts the structure or permissions on the allocation directories built by Nomad. theme/storage theme/ui type/enhancement
Projects
Development

No branches or pull requests

2 participants