10 Commits

Author SHA1 Message Date
Daniel Bennett
49c147bcd7 dynamic host volumes: change env vars, fixup auto-delete (#24943)
* plugin env: DHV_HOST_PATH->DHV_VOLUMES_DIR
* client config: host_volumes_dir
* plugin env: add namespace+nodepool
* only auto-delete after error saving client state
  on *initial* create
2025-01-27 10:36:53 -06:00
Daniel Bennett
985eb53c65 dynamic host volumes: plugin spec tweaks (#24848)
* prefix plugin env vars with DHV_
* add env: DHV_VOLUME_ID, DHV_PLUGIN_DIR
* 5s timeout on fingerprint calls
2025-01-13 14:18:10 -06:00
Tim Gross
4a65b21aab dynamic host volumes: send register to client for fingerprint (#24802)
When we register a volume without a plugin, we need to send a client RPC so that
the node fingerprint can be updated. The registered volume also needs to be
written to client state so that we can restore the fingerprint after a restart.

Co-authored-by: Daniel Bennett <dbennett@hashicorp.com>
2025-01-08 16:58:58 -05:00
Daniel Bennett
459453917e dynamic host volumes: client-side tests, comments, tidying (#24747) 2025-01-06 13:20:07 -06:00
Daniel Bennett
af967184a6 dynamic host volumes: tweak plugin fingerprint (#24711)
Instead of a plugin `version` subcommand that responds with a string
(established in #24497), respond to a `fingerprint` command with a data
structure that we may extend in the future (such as plugin capabilities,
like size constraint support?). In the immediate term, it's still just the
version: `{"version": "0.0.1"}`

In addition to leaving the door open for future expansion, I think it will
also avoid false positives detecting executables that just happen to
respond to a `version` command.

This also reverses the ordering of the fingerprint string parts
from `plugins.host_volume.version.mkdir` (which aligned with CNI)
to `plugins.host_volume.mkdir.version` (makes more sense to me)
2024-12-19 09:25:55 -05:00
Daniel Bennett
e76f5e0b4c dynamic host volumes: volume fingerprinting (#24613)
and expand the demo a bit
2024-12-19 09:25:54 -05:00
Daniel Bennett
46a39560bb dynamic host volumes: fingerprint client plugins (#24589) 2024-12-19 09:25:54 -05:00
Piotr Kazmierczak
f0b89fc484 dynamic host volumes: make example-host-volume plugin run on macOS (#24563)
This adapts the shell script for darwin, making it easier to test.
2024-12-19 09:25:54 -05:00
Tim Gross
298460dcd9 dynamic host volumes: monitor readiness from CLI (#24528)
When creating a dynamic host volumes, set up an optional monitor that waits for
the node to fingerprint the volume as healthy.

Ref: https://github.com/hashicorp/nomad/pull/24479
2024-12-19 09:25:54 -05:00
Daniel Bennett
c2dd97dee7 HostVolumePlugin interface and two implementations (#24497)
* mkdir: HostVolumePluginMkdir: just creates a directory
* example-host-volume: HostVolumePluginExternal:
  plugin script that does mkfs and mount loopback

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-12-19 09:25:54 -05:00