Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ef25f0f
Add mount/umount commands to SSH driver for sshfs-based filesystem mo…
Apr 8, 2026
e27c07c
refactor: extract sshfs mount/umount into separate jumpstarter-driver…
Apr 8, 2026
7254e19
fix: add ssh-mount to docs toctree and use SSH driver in example config
Apr 8, 2026
0e53d5d
refactor: make SSHMount consume SSH driver for credentials and TCP ac…
Apr 8, 2026
ba58dae
Rename driver to 'mount', use --umount flag for cleaner CLI UX
Apr 8, 2026
ba868e7
fix: address PR review feedback for ssh-mount driver
Apr 9, 2026
036a5ad
Fix lint C901 complexity in umount, add CLI dispatch tests
Apr 9, 2026
bc71488
Fix macOS test failures: use os.path.realpath for mount path assertions
Apr 9, 2026
6385e9c
Refactor mount to run sshfs in foreground with subshell
Apr 10, 2026
ab2ef17
Fix lint errors and test failures in ssh-mount driver
Apr 10, 2026
2a8a1c2
Fix CI failures: unused variable lint error and test mock side_effects
Apr 10, 2026
a53fc54
Add jumpstarter-driver-ssh-mount to UV workspace sources
Apr 10, 2026
d62c230
Address second review round: fix sshfs cleanup, deadlock, and macOS u…
Apr 14, 2026
32aab8c
Fix CI: remove unused sys import and fix generic failure test assertion
Apr 14, 2026
0ada859
Fix extra_args -o prefix, remove dead port_forward param, add subshel…
Apr 15, 2026
155cc91
Fix SIGPIPE risk and ruff B904 lint error
Apr 15, 2026
644350e
Fix ruff B904: add 'from None' to raise in except clause
Apr 15, 2026
4817f42
Address review feedback: fix fragile mountpoint extraction and misc i…
Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/docs/source/reference/package-apis/drivers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ General-purpose utility drivers:
* **[Shell](shell.md)** (`jumpstarter-driver-shell`) - Shell command execution
* **[TMT](tmt.md)** (`jumpstarter-driver-tmt`) - TMT (Test Management Tool) wrapper driver
* **[SSH](ssh.md)** (`jumpstarter-driver-ssh`) - SSH wrapper driver
* **[SSH Mount](ssh-mount.md)** (`jumpstarter-driver-ssh-mount`) - SSHFS remote filesystem mounting

```{toctree}
:hidden:
Expand Down Expand Up @@ -140,8 +141,9 @@ gpiod.md
ridesx.md
sdwire.md
shell.md
ssh.md
snmp.md
ssh.md
ssh-mount.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] ssh-mount is placed after ssh but before snmp in the toctree. Alphabetically, snmp comes before ssh-mount (since 'n' < 's' at the fourth character). Consider reordering, or if grouping SSH-related entries together is intentional, a brief comment in the file would clarify.

AI-generated, human reviewed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Reordered toctree entries to be alphabetical: snmp.md now comes before ssh.md and ssh-mount.md.

someip.md
tasmota.md
tmt.md
Expand Down
3 changes: 3 additions & 0 deletions python/packages/jumpstarter-driver-ssh-mount/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__pycache__/
.coverage
coverage.xml
96 changes: 96 additions & 0 deletions python/packages/jumpstarter-driver-ssh-mount/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# SSHMount Driver

`jumpstarter-driver-ssh-mount` provides remote filesystem mounting via sshfs. It allows you to mount remote directories from a target device to your local machine using SSHFS (SSH Filesystem).

## Installation

```shell
pip3 install --extra-index-url https://pkg.jumpstarter.dev/simple/ jumpstarter-driver-ssh-mount
```

You also need `sshfs` installed on the client machine:

- **Fedora/RHEL**: `sudo dnf install fuse-sshfs`
- **Debian/Ubuntu**: `sudo apt-get install sshfs`
- **macOS**: Install macFUSE from https://macfuse.github.io/ and then install
sshfs from source, as Homebrew has removed sshfs support.

## Configuration

The SSHMount driver references an existing SSH driver to inherit credentials
(username, identity key) and TCP connectivity. No duplicate configuration is needed.

Example exporter configuration:

```yaml
export:
ssh:
type: jumpstarter_driver_ssh.driver.SSHWrapper
config:
default_username: "root"
# ssh_identity_file: "/path/to/ssh/key"
children:
tcp:
type: jumpstarter_driver_network.driver.TcpNetwork
config:
host: "192.168.1.100"
port: 22
mount:
type: jumpstarter_driver_ssh_mount.driver.SSHMount
children:
ssh:
ref: "ssh"
```

## CLI Usage

Inside a `jmp shell` session:

```shell
# Mount remote filesystem (spawns a subshell; type 'exit' to unmount)
j mount /local/mountpoint
j mount /local/mountpoint -r /remote/path
j mount /local/mountpoint --direct

# Mount in foreground mode (blocks until Ctrl+C)
j mount /local/mountpoint --foreground

# Pass extra sshfs options
j mount /local/mountpoint -o reconnect -o cache=yes

# Unmount an orphaned mount
j mount --umount /local/mountpoint
j mount --umount /local/mountpoint --lazy
```
Comment thread
mangelajo marked this conversation as resolved.
Comment thread
raballew marked this conversation as resolved.

By default, `j mount` runs sshfs in foreground mode and spawns a subshell
with a modified prompt. The mount stays active while the subshell is running.
When you type `exit` (or press Ctrl+D), sshfs is terminated and all resources
(port forwards, temporary identity files) are cleaned up automatically.

Use `--foreground` to skip the subshell and block directly on sshfs. Press
Ctrl+C to unmount.

The `--umount` flag is available as a fallback for mounts that were orphaned
(e.g., if the process was killed without cleanup).

## API Reference

### SSHMountClient

- `mount(mountpoint, *, remote_path="/", direct=False, foreground=False, extra_args=None)` - Mount remote filesystem locally via sshfs
- `umount(mountpoint, *, lazy=False)` - Unmount an sshfs filesystem (fallback for orphaned mounts)

### Required Children

| Child name | Type | Description |
|-----------|------|-------------|
| `ssh` | `jumpstarter_driver_ssh.driver.SSHWrapper` | SSH driver providing credentials (username, identity key) and TCP connectivity. Must itself have a `tcp` child of type `TcpNetwork`. |

### CLI

The driver registers as `mount` in the exporter config. When used in a `jmp shell` session, the CLI is a single command with a `--umount` flag for unmounting.
Comment thread
raballew marked this conversation as resolved.

Note: `extra_args` values (passed via `-o`) are forwarded directly to sshfs. This
can be used to override defaults such as `StrictHostKeyChecking=no` -- for example,
`-o StrictHostKeyChecking=yes`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: jumpstarter.dev/v1alpha1
kind: ExporterConfig
metadata:
namespace: default
name: demo
endpoint: grpc.jumpstarter.192.168.0.203.nip.io:8082
token: "<token>"
export:
ssh:
type: jumpstarter_driver_ssh.driver.SSHWrapper
config:
default_username: "root"
# ssh_identity_file: "/path/to/key"
children:
tcp:
type: jumpstarter_driver_network.driver.TcpNetwork
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use here an SSH driver instead, in that way the ssh_identity file and other settings are already provided and we don't need to do that here as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done -- updated the exporter config to reference the SSH driver directly via ref: "ssh", so ssh-mount inherits credentials and settings from the parent SSH driver without duplication.

config:
host: "192.168.1.100"
port: 22
mount:
type: jumpstarter_driver_ssh_mount.driver.SSHMount
children:
ssh:
ref: "ssh"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading