spkenv / spk

A Package Manager for high velocity software environments, built on spfs.
https://spkenv.dev
Apache License 2.0
34 stars 5 forks source link

spfs commit needs to allow committing non-editable runtimes #852

Open jrray opened 1 year ago

jrray commented 1 year ago

https://github.com/imageworks/spk/blob/a7da31e5ef232d681131475f76e0a679b769377c/crates/spfs-cli/main/src/cmd_commit.rs#L136-L140

This well-meaning check has created a problem for us now that we've fixed how spfs runtimes are not editable by default in more scenarios. We're using spfs commit platform --tag=<...> to stamp an spfs tag for the current runtime and we'd like this to succeed unconditionally, even if the runtime has not been modified. This had worked when the runtime is editable but is now failing on this check here if the runtime is not editable.

Side note: it is possible to make modifications to a runtime, then use spfs edit --off, and then not be able to commit the changes due to this check.

jrray@STRANDED:~/git/spk$ spfs run - -- bash
 WARN Failed to detect supported overlayfs params: OverlayFS kernel module does not appear to be installed
 WARN  > Falling back to the most conservative set, which is undesirable
jrray@STRANDED:~/git/spk$ touch /spfs/foo
jrray@STRANDED:~/git/spk$ spfs edit --off
 WARN Failed to detect supported overlayfs params: OverlayFS kernel module does not appear to be installed
 WARN  > Falling back to the most conservative set, which is undesirable
 INFO edit mode disabled
jrray@STRANDED:~/git/spk$ spfs commit platform --tag=commit-test
ERROR Active runtime is not editable, nothing to commit

Proposal: remove this check entirely, or at least skip this check if the --tag option is being used. The user is attempting to make a new tag that aliases the current runtime, with or without modifications from when the runtime was launched.

Other side note: we don't have a way on the CLI to ask if the runtime is editable, or in lieu of knowing if the runtime is already editable, have a way to run spfs edit without it failing with an error if the runtime is already editable.

rydrman commented 1 year ago

Proposal: remove this check entirely, or at least skip this check if the --tag option is being used. The user is attempting to make a new tag that aliases the current runtime, with or without modifications from when the runtime was launched.

Makes sense to me - maybe a warning if no additional layer was added? It's not clear how "normal" this is or if it would trip someone up...