Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

implement ch-image modify #1408

Merged
merged 71 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e8b04c9
draft docs [skip ci]
reidpr Jul 9, 2022
2e1da45
attempt to merge
lucaudill Feb 14, 2024
83beda8
add proper formatting [skip ci]
lucaudill Feb 14, 2024
244d174
interactive modify [skip ci]
lucaudill Feb 26, 2024
1ae7c94
Merge branch 'master' into modify_1400
lucaudill Feb 26, 2024
580b6ec
move modify function, other additions (buggy) [skip ci]
lucaudill Mar 14, 2024
e843576
clean stuff up a bit?
lucaudill Mar 19, 2024
d05460e
add (prototype) completion [skip ci]
lucaudill Mar 19, 2024
1df874f
don't enforce different out image [skip ci]
lucaudill Mar 28, 2024
50f917f
standardize ch-run exit codes, make sure out image is different than …
lucaudill Apr 4, 2024
2f43bc9
fix a bug?
lucaudill Apr 4, 2024
491ce01
update some return codes in CI
lucaudill Apr 4, 2024
6f8014e
update test suite
lucaudill Apr 22, 2024
4996b4e
update more exit statuses
lucaudill Apr 22, 2024
feee043
Merge branch 'master' into modify_1400
lucaudill Apr 22, 2024
e641935
wtf
lucaudill Apr 23, 2024
a0867d4
Merge branch 'modify_1400' of github.com:hpc/charliecloud into modify…
lucaudill Apr 23, 2024
151592f
enable CI ssh
lucaudill Apr 24, 2024
e0bc574
run ci
lucaudill Apr 24, 2024
7d6f66e
oops
lucaudill Apr 24, 2024
2c8b2f7
CI debugging
lucaudill Apr 25, 2024
731cfe8
CI debugging again
lucaudill Apr 25, 2024
fd45f64
CI debugging again pt 2
lucaudill Apr 25, 2024
05dac9b
fix a CI bug
lucaudill Apr 25, 2024
00e2ec6
more ci
lucaudill Apr 25, 2024
de7d63c
uggh
lucaudill Apr 25, 2024
f7b87e5
lets try this
lucaudill Apr 25, 2024
4b84644
fix disabled cache bug
lucaudill Apr 25, 2024
1afc853
update docs [skip ci]
lucaudill Apr 26, 2024
c6ae8a9
weird docker message?
lucaudill Apr 29, 2024
4e61c06
some cleanup [skip ci]
lucaudill Apr 30, 2024
9d74d19
put CI exit statuses in one place
lucaudill May 1, 2024
579ec81
ignore seemingly erroneous SC error
lucaudill May 2, 2024
b37232b
update exit codes and docs
lucaudill May 2, 2024
3742a28
oops 🤦
lucaudill May 6, 2024
6e0ff69
tidy docs [skip ci]
reidpr May 10, 2024
26ce9e6
work on suggestions
lucaudill May 21, 2024
dbbf74d
more work on non-interactive script case
lucaudill Jun 4, 2024
8cb7975
try to debug CI
lucaudill Jun 4, 2024
b859089
hopefully this works
lucaudill Jun 5, 2024
54c2ee8
back to how it used to work?
lucaudill Jun 5, 2024
bb0283e
more interactive shell troubles
lucaudill Jun 5, 2024
6bc35a9
skip mysteriously failing test for now
lucaudill Jun 6, 2024
8a97d8d
work on some suggestions
lucaudill Jun 7, 2024
5be8c3e
more RPM issues?
lucaudill Jun 7, 2024
c53a820
oops, misread failure
lucaudill Jun 7, 2024
1dcbb4d
what happens when I do this
lucaudill Jun 7, 2024
3314546
try removing hidden ci opt
lucaudill Jun 10, 2024
6ec4b26
fully remove automated ci option
lucaudill Jun 10, 2024
b6da358
hopefully this also works in CI
lucaudill Jun 10, 2024
2b96ecc
fix syntax error
lucaudill Jun 10, 2024
ed46d89
check for empty string instead of None
lucaudill Jun 10, 2024
fc5c89a
update comment [skip ci]
lucaudill Jun 11, 2024
a9b1e23
Merge branch 'master' into modify_1400
lucaudill Jun 21, 2024
dc5ed4d
fix interactive case
lucaudill Jun 21, 2024
1593009
Merge branch 'modify_1400' of github.com:hpc/charliecloud into modify…
lucaudill Jun 21, 2024
7c320e7
create new Python module
lucaudill Jul 5, 2024
d3b06fb
add new module to makefile
lucaudill Jul 5, 2024
ce2a620
update fedora spec
lucaudill Jul 5, 2024
7f17900
a few minor suggestions
lucaudill Jul 5, 2024
8d0befc
more suggestions, move some build cli stuff around
lucaudill Jul 15, 2024
1b65df9
fix CI tty error
lucaudill Jul 15, 2024
d4f90f3
add cache validation test
lucaudill Jul 15, 2024
09f78f2
add cache validation for interactive modify
lucaudill Jul 16, 2024
681a39c
more suggestions
lucaudill Jul 18, 2024
2cd6149
fix CI
lucaudill Jul 18, 2024
20e2d91
even more suggestions
lucaudill Jul 19, 2024
32efbe4
couple more suggestions
lucaudill Jul 23, 2024
f4b1ba7
docs + comments
lucaudill Jul 24, 2024
62fe3e2
comment on log level stuff
lucaudill Jul 24, 2024
621b19a
some cleanup
lucaudill Jul 24, 2024
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
Prev Previous commit
Next Next commit
comment on log level stuff
lucaudill committed Jul 24, 2024
commit 62fe3e2079312e1de3d7418a0e99aa7f5b357317
14 changes: 9 additions & 5 deletions bin/ch-image.py.in
Original file line number Diff line number Diff line change
@@ -283,14 +283,18 @@ def main():
# modify
sp = ap.add_parser("modify", "foo")
add_opts(sp, modify.main, deps_check=True, stog_init=True)
sp.add_argument("-c", metavar="CMD", action="append", default=[], nargs=1, help="foo")
sp.add_argument("-i", "--interactive", action="store_true", help="foo")
sp.add_argument("-t", "--test", action="store_true", help="foo")
sp.add_argument("-S", "--shell", metavar="shell", default="/bin/sh", help="foo")
sp.add_argument("-c", metavar="CMD", action="append", default=[], nargs=1,
help="Run CMD as though specified by a RUN instruction. Can be repeated.")
sp.add_argument("-i", "--interactive", action="store_true",
help="modify in interactive mode, even if stdin is not a TTY")
sp.add_argument("-S", "--shell", metavar="shell", default="/bin/sh",
help="use SHELL instead of the default /bin/sh")
sp.add_argument("image_ref", metavar="IMAGE_REF", help="image to modify")
sp.add_argument("out_image", metavar="OUT_IMAGE", help="destination of modified image")
sp.add_argument("script", metavar="SCRIPT", help="foo", nargs='?')
# Options “modify” shares with “build”.
# Options “modify” shares with “build”. Note that while we could abstract
# this out to avoid repeated lines, as we do for “common_opts”, we’ve decided
# that the tradeoff in code readability wouldn’t be worth it.
sp.add_argument("-b", "--bind", metavar="SRC[:DST]",
action="append", default=[],
help="mount SRC at guest DST (default: same as SRC)")
6 changes: 6 additions & 0 deletions bin/ch_misc.c
Original file line number Diff line number Diff line change
@@ -592,10 +592,16 @@ void msg_error(const char *file, int line, int errno_,
va_list ap;

va_start(ap, fmt);
/* We print errors at LL_FATAL because, according to our documentation,
errors are never suppressed. Perhaps we need to rename this log level (see
issue #1914). */
msgv(LL_FATAL, file, line, errno_, fmt, ap);
va_end(ap);
}

/* Note that msg_fatal doesn’t call msg_error like we do in the Python code
because the variable number of arguments make it easier to simply define
separate functions. */
noreturn void msg_fatal(const char *file, int line, int errno_,
const char *fmt, ...)
{
6 changes: 3 additions & 3 deletions doc/ch-image.rst
Original file line number Diff line number Diff line change
@@ -2258,9 +2258,9 @@ Interactive mode
iterating a container, it rarely saves time over editing a Dockerfile or
shell script. Only use it if you really know what you are doing.

If :code:`SCRIPT` is not provided and standard input *is* a TTY,
:code:`ch-image modify` opens an interactive shell. That is, the following are
roughly equivalent (assuming a terminal)::
If :code:`SCRIPT` is not provided and standard input *is* a TTY, or if
:code:`-i` is specified :code:`ch-image modify` opens an interactive shell. That
is, the following are roughly equivalent (assuming a terminal)::

$ ch-image modify foo bar

3 changes: 0 additions & 3 deletions lib/modify.py
Original file line number Diff line number Diff line change
@@ -91,9 +91,6 @@ def main(cli_):
ch.VERBOSE("modify shell: %s" % cli.shell)
ch.VERBOSE("modify mode: %s" % mode.value)

if (cli.test):
exit(0)

if (mode == Modify_Mode.INTERACTIVE):
# Interactive case

2 changes: 1 addition & 1 deletion lib/pull.py
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ def download(self):
# currently, this error is only raised if we’ve downloaded the
# skinny manifest.
have_skinny = True
if (ch.arch in "amd64"):
if (ch.arch == "amd64"):
# We’re guessing that enough arch-unaware images are amd64 to
# barge ahead if requested architecture is amd64.
ch.arch = "yolo"