DISCLAIMER: This package is pre v1.x and not stable
hotfix
dumb file sync/transfer to your labelled pods
installation
releases are tagged in git and uploaded to
https://steady.supply/git/hotfix/release/
usage
command line options are -v
, etc for
glog, and -c
to specify a
configuration file, eg.
namespace: xyz
ignore:
- "*.tmp"
- "*.{html,css,js}"
include:
- "*.py"
shell: ash
path: src:/app
target:
- label: service in (web, api)
- label: service=postgres
path: src/database:/app/database
- label: service=chrome
shell: bash
- label: service=static
include:
- "*.{html,css,js}"
which specifes defaults for the namespace
to work in, the transfer path
s
(in standard local:remote
format), the
globs to be ignore
d / include
d and
the shell
offered by the default container in matched pods. this
configuration will be used for each target
, having
label
filter
and being able to specify any of namespace
, shell
and path
. see below for
discussion on how ignore
and include
rules are evalulated.
for each target
the local path is
watched, and when a file changes, that
file is streamed to all the pods matching the label
specification.
why is it dumb?
the dumb part is how we stream files; the method is essentially
cat local_file | cat > remote_file
. this is perfectly sufficient since, when
writing code (unless you’re an octopus), you probably only write to handful of
files at a given time and you probably don’t write to files more frequently
than every few seconds (unless you’re a hummingbird).
ignore
and include
when hotfix
receives a file change event, both the “outer” and “inner”
ignore
and include
rules for a particular target are evaluated against the
path that is the subject of the event.
include
takes precedence over ignore
- “inner” rules take precedence over “outer” rules
alternatives to hotfix
there are already too many tools on the market that attempt to scratch the same
itch; “i miss docker run -v $(pwd):/app
”.
but ... why?
yes, quite. perhaps a more pertinent question would be “why not any of the
others?”. let’s enumerate
ksync
seems rather complicated
for a noddy development tool, and doesn’t quite work
kubectl-warp
is also complicated and
requires rsync
on the remote
devspace sync
is pretty nice (they somewhat built their own rsync
-a-like
lib), but it’s part of an ecosystem i don’t want and has
odd
behaviours
oc rsync
doesn’t watch files for me
none of the above let you spam files out based on labels (eg. you want to
send a file out to all the pods in a deployment) and all of the above require
either special software on your containers or additional pods in your cluster.
hotfix
is a simple solution to a simple problem.
contributions
drop a line to git@steady.supply
:)