classes/image-oci: Add OCI_IMAGE_ENTRYPOINT_ARG_LIST
PATCH 1/1 classes/image-oci: Add OCI_IMAGE_ENTRYPOINT_ARG_LIST
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current OCI_IMAGE_ENTRYPOINT_ARGS variables doesn't support however. In order to maintain backward compatibility, a new variable has to be introduced to that can be split into the multiple arguments required
--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)
classes/image-oci-umoci.inc +3 -0
@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG} --config.cmd "${OCI_IMAGE_ENTRYPOINT_ARGS}" fi + if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@" ".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())} + fi umoci config --image $image_name:${OCI_IMAGE_TAG} --author ${OCI_IMAGE_AUTHOR_EMAIL} # make a tar version of the image direcotry
classes/image-oci.bbclass +1 -0
@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE OCI_IMAGE_ENTRYPOINT ?= "sh" OCI_IMAGE_ENTRYPOINT_ARGS ?= "" +OCI_IMAGE_ENTRYPOINT_ARG_LIST ?="" OCI_IMAGE_WORKINGDIR ?= "" OCI_IMAGE_STOPSIGNAL ?= ""
Signature · 1 line
2.34.1
Quoted 7 lines · Joshua Watt
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. In order to maintain backward compatibility, a new variable has to be introduced to that can be split into the multiple arguments required
I haven't looked in detail, but the original intent of that variable IS to have more than
one argument. I was just the only current user of them, and only had one argument
that needed to be passed.
I'd rather not have a new variable, but just change the processing to do 1 or more
arguments in the existing variable.
I'll also have to figure out how to make the sloci backend work, but that's a different
question.
Bruce
Quoted 52 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)classes/image-oci-umoci.inc +0
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG} --config.cmd"${OCI_IMAGE_ENTRYPOINT_ARGS}"
ficlasses/image-oci-umoci.inc +2
-0+ if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@"".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())}
+ fiumoci config --image $image_name:${OCI_IMAGE_TAG} --author${OCI_IMAGE_AUTHOR_EMAIL}
# make a tar version of the image direcotryclasses/image-oci.bbclass +0
-0@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?="${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE
OCI_IMAGE_ENTRYPOINT?= "sh"
OCI_IMAGE_ENTRYPOINT_ARGS?= ""
+OCI_IMAGE_ENTRYPOINT_ARG_LIST ?=""
OCI_IMAGE_WORKINGDIR?= ""
OCI_IMAGE_STOPSIGNAL?= ""--
2.34.1-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8353):
https://lists.yoctoproject.org/g/meta-virtualization/message/8353
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 17 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 7 lines · Joshua Watt
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. In order to maintain backward compatibility, a new variable has to be introduced to that can be split into the multiple arguments requiredI haven't looked in detail, but the original intent of that variable IS to have more than
one argument. I was just the only current user of them, and only had one argument
that needed to be passed.
Quoted 5 lines
I'd rather not have a new variable, but just change the processing to do 1 or more
arguments in the existing variable.
Which if I'm not mistaken, is your first patch :)
Bruce
Quoted 71 lines
I'll also have to figure out how to make the sloci backend work, but that's a different
question.Bruce
Quoted 31 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)classes/image-oci-umoci.inc +0
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG} --config.cmd"${OCI_IMAGE_ENTRYPOINT_ARGS}"
ficlasses/image-oci-umoci.inc +2
-0+ if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@"".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())}
+ fiumoci config --image $image_name:${OCI_IMAGE_TAG} --author${OCI_IMAGE_AUTHOR_EMAIL}
# make a tar version of the image direcotryclasses/image-oci.bbclass +0
-0@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?="${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE
Quoted 13 lines
OCI_IMAGE_ENTRYPOINT?= "sh"
OCI_IMAGE_ENTRYPOINT_ARGS?= ""
+OCI_IMAGE_ENTRYPOINT_ARG_LIST ?=""
OCI_IMAGE_WORKINGDIR?= ""
OCI_IMAGE_STOPSIGNAL?= ""--
2.34.1--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8354):
https://lists.yoctoproject.org/g/meta-virtualization/message/8354
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/meta-virtualization/leave/6693017/1050810/978058475/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 20 lines · Bruce Ashfield
Quoted 16 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 7 lines · Joshua Watt
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. In order to maintain backward compatibility, a new variable has to be introduced to that can be split into the multiple arguments requiredI haven't looked in detail, but the original intent of that variable IS to have more than one argument. I was just the only current user of them, and only had one argument that needed to be passed.
Quoted 5 lines
Quoted 3 lines
I'd rather not have a new variable, but just change the processing to do 1 or more arguments in the existing variable.
Which if I'm not mistaken, is your first patch :)
Almost. The first patch does it for OCI_IMAGE_ENTRYPOINT. That one is straight forward because there is no backward compatible problem. The second one (this one) does it for OCI_IMAGE_ENTRYPOINT_ARGS, which is trickier because if we make it behave the same as OCI_IMAGE_ENTRYPOINT it will break anyone who is currently relying on a space in OCI_IMAGE_ENTRYPOINT_ARGS to be passed verbatim to their entrypoint (hence my tentative suggestion to add a new variable). I'd be fine with just make OCI_IMAGE_ENTRYPOINT_ARGS split on space if that was the original intention (I can even roll it into the previous patch if you want and make it do both variables at the same time).
Quoted 71 lines
Bruce
Quoted 53 lines
I'll also have to figure out how to make the sloci backend work, but that's a different question.
Bruce
Quoted 34 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)classes/image-oci-umoci.inc +3
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG} --config.cmd "${OCI_IMAGE_ENTRYPOINT_ARGS}" fi + if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@" ".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())} + fi umoci config --image $image_name:${OCI_IMAGE_TAG} --author ${OCI_IMAGE_AUTHOR_EMAIL} # make a tar version of the image direcotryclasses/image-oci.bbclass +1
-1@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE OCI_IMAGE_ENTRYPOINT ?= "sh" OCI_IMAGE_ENTRYPOINT_ARGS ?= "" +OCI_IMAGE_ENTRYPOINT_ARG_LIST ?="" OCI_IMAGE_WORKINGDIR ?= "" OCI_IMAGE_STOPSIGNAL ?= "" --Quoted 5 lines
2.34.1
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek IIQuoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8354): https://lists.yoctoproject.org/g/meta-virtualization/message/8354
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/leave/6693017/1050810/978058475/xyzzy [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=---
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Quoted 35 lines · Joshua Watt
Quoted 4 lines · Bruce Ashfield
On Thu, Oct 12, 2023 at 1:23 PM Bruce Ashfield via
lists.yoctoproject.org <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
On Thu, Oct 12, 2023 at 12:52 PM Joshua Watt <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. In orderto
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
maintain backward compatibility, a new variable has to be introduced to that can be split into the multiple arguments required
I haven't looked in detail, but the original intent of that variable IS
to have more than
Quoted 1 line
Quoted 1 line
one argument. I was just the only current user of them, and only had
one argument
Quoted 3 lines
Quoted 3 lines
that needed to be passed.
I'd rather not have a new variable, but just change the processing to
do 1 or more
Quoted 4 lines
Quoted 2 lines
arguments in the existing variable.
Which if I'm not mistaken, is your first patch :)
Quoted 12 lines
Almost. The first patch does it for
OCI_IMAGE_ENTRYPOINT. That one is straight forward because there is no backward compatible problem. The second one (this one) does it forOCI_IMAGE_ENTRYPOINT_ARGS, which is trickier because if we make it behave the same asOCI_IMAGE_ENTRYPOINTit will break anyone who is currently relying on a space inOCI_IMAGE_ENTRYPOINT_ARGSto be passed verbatim to their entrypoint (hence my tentative suggestion to add a new variable). I'd be fine with just makeOCI_IMAGE_ENTRYPOINT_ARGSsplit on space if that was the original intention (I can even roll it into the previous patch if you want and make it do both variables at the same time).
That's sort of my point.
The entry point can just be the executable, and this variable is supposed to be the arguments.
So no arguments should be passed via that first variable, but should be in this one. We can have the split and processing here, and check and forbid it in the first variable. It shouldn't be in both.
Bruce
Quoted 84 lines
Quoted 7 lines
Bruce
Quoted 2 lines
I'll also have to figure out how to make the sloci backend work, but
that's a different
Quoted 12 lines
Quoted 12 lines
question.
Bruce
Quoted 7 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)Quoted 7 lines
Quoted 7 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 104
Quoted 7 lines
classes/image-oci-umoci.inc +0
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG} --config.cmd"${OCI_IMAGE_ENTRYPOINT_ARGS}"
Quoted 3 lines
Quoted 3 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() {
Quoted 3 lines
classes/image-oci-umoci.inc +2
-0fi + if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@"".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())}
Quoted 2 lines
Quoted 2 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 109
Quoted 2 lines
classes/image-oci-umoci.inc +1
-0+ fi umoci config --image $image_name:${OCI_IMAGE_TAG} --author${OCI_IMAGE_AUTHOR_EMAIL}
Quoted 7 lines
Quoted 7 lines
classes/image-oci.bbclass OCI_IMAGE_SUBARCH ?=
Quoted 7 lines
classes/image-oci-umoci.inc +0
-0# make a tar version of the image direcotryclasses/image-oci.bbclass +0
-0@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?="${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE
Quoted 15 lines
Quoted 15 lines
Quoted 13 lines
classes/image-oci.bbclass +1
-1OCI_IMAGE_ENTRYPOINT ?= "sh" OCI_IMAGE_ENTRYPOINT_ARGS ?= "" +OCI_IMAGE_ENTRYPOINT_ARG_LIST ?="" OCI_IMAGE_WORKINGDIR ?= "" OCI_IMAGE_STOPSIGNAL ?= "" --2.34.1
Quoted 2 lines
Quoted 2 lines
--
- Thou shalt not follow the NULL pointer, for chaos and madness awaitthee at its end
Quoted 6 lines
Quoted 6 lines
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8354):https://lists.yoctoproject.org/g/meta-virtualization/message/8354
Quoted 3 lines
Quoted 3 lines
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected] Unsubscribe:https://lists.yoctoproject.org/g/meta-virtualization/leave/6693017/1050810/978058475/xyzzy
[[email protected]]Quoted 6 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
--
- Thou shalt not follow the NULL pointer, for chaos and madness awaitthee at its end
Quoted 2 lines
- "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 53 lines · Bruce Ashfield
Quoted 36 lines · Joshua Watt
Quoted 4 lines · Bruce Ashfield
On Thu, Oct 12, 2023 at 1:23 PM Bruce Ashfield via
lists.yoctoproject.org <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
On Thu, Oct 12, 2023 at 12:52 PM Joshua Watt <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. In orderto
Quoted 1 line
Quoted 1 line
Quoted 1 line
maintain backward compatibility, a new variable has to be introduced
to
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
that can be split into the multiple arguments required
I haven't looked in detail, but the original intent of that variable
IS to have more than
Quoted 1 line
Quoted 1 line
one argument. I was just the only current user of them, and only had
one argument
Quoted 3 lines
Quoted 3 lines
that needed to be passed.
I'd rather not have a new variable, but just change the processing to
do 1 or more
Quoted 4 lines
Quoted 2 lines
arguments in the existing variable.
Which if I'm not mistaken, is your first patch :)
Quoted 12 lines
Almost. The first patch does it for
OCI_IMAGE_ENTRYPOINT. That one is straight forward because there is no backward compatible problem. The second one (this one) does it forOCI_IMAGE_ENTRYPOINT_ARGS, which is trickier because if we make it behave the same asOCI_IMAGE_ENTRYPOINTit will break anyone who is currently relying on a space inOCI_IMAGE_ENTRYPOINT_ARGSto be passed verbatim to their entrypoint (hence my tentative suggestion to add a new variable). I'd be fine with just makeOCI_IMAGE_ENTRYPOINT_ARGSsplit on space if that was the original intention (I can even roll it into the previous patch if you want and make it do both variables at the same time).
Quoted 9 lines
That's sort of my point.
The entry point can just be the executable, and this variable is supposed to be the arguments.
So no arguments should be passed via that first variable, but should be in this one. We can have the split and processing here, and check and forbid it in the first variable. It shouldn't be in both.
I've made plenty of container images where ENTRYPOINT had multiple arguments; the trivial example is ["/usr/bin/python3", "my script"]. Sure, you can do it other ways (e.g. a proxy shell script.... Which then means your container needs a shell), but restricting that as an option doesn't seem necessary?
Quoted 95 lines
Bruce
Quoted 74 lines
Quoted 7 lines
Bruce
Quoted 2 lines
I'll also have to figure out how to make the sloci backend work, but
that's a different
Quoted 12 lines
Quoted 12 lines
question.
Bruce
Quoted 7 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)Quoted 7 lines
Quoted 7 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 104
Quoted 7 lines
classes/image-oci-umoci.inc +0
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG}--config.cmd "${OCI_IMAGE_ENTRYPOINT_ARGS}"
Quoted 3 lines
Quoted 3 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() {
Quoted 3 lines
classes/image-oci-umoci.inc +2
-0fi + if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@"".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())}
Quoted 2 lines
Quoted 2 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 109
Quoted 2 lines
classes/image-oci-umoci.inc +1
-0+ fi umoci config --image $image_name:${OCI_IMAGE_TAG} --author${OCI_IMAGE_AUTHOR_EMAIL}
Quoted 7 lines
Quoted 7 lines
classes/image-oci.bbclass OCI_IMAGE_SUBARCH ?=
Quoted 7 lines
classes/image-oci-umoci.inc +0
-0# make a tar version of the image direcotryclasses/image-oci.bbclass +0
-0@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?="${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE
Quoted 15 lines
Quoted 15 lines
Quoted 13 lines
classes/image-oci.bbclass +1
-1OCI_IMAGE_ENTRYPOINT ?= "sh" OCI_IMAGE_ENTRYPOINT_ARGS ?= "" +OCI_IMAGE_ENTRYPOINT_ARG_LIST ?="" OCI_IMAGE_WORKINGDIR ?= "" OCI_IMAGE_STOPSIGNAL ?= "" --2.34.1
Quoted 2 lines
Quoted 2 lines
--
- Thou shalt not follow the NULL pointer, for chaos and madness awaitthee at its end
Quoted 6 lines
Quoted 6 lines
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8354):https://lists.yoctoproject.org/g/meta-virtualization/message/8354
Quoted 3 lines
Quoted 3 lines
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected] Unsubscribe:https://lists.yoctoproject.org/g/meta-virtualization/leave/6693017/1050810/978058475/xyzzy
[[email protected]]Quoted 10 lines
Quoted 6 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
--
- Thou shalt not follow the NULL pointer, for chaos and madness awaitthee at its end
Quoted 2 lines
- "Use the force Harry" - Gandalf, Star Trek II
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Quoted 68 lines · Joshua Watt
Quoted 53 lines · Bruce Ashfield
Quoted 36 lines · Joshua Watt
Quoted 4 lines · Bruce Ashfield
On Thu, Oct 12, 2023 at 1:23 PM Bruce Ashfield via
lists.yoctoproject.org <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
On Thu, Oct 12, 2023 at 12:52 PM Joshua Watt <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. Inorder to
Quoted 1 line
Quoted 1 line
Quoted 1 line
maintain backward compatibility, a new variable has to be introduced
to
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
that can be split into the multiple arguments required
I haven't looked in detail, but the original intent of that variable
IS to have more than
Quoted 1 line
Quoted 1 line
one argument. I was just the only current user of them, and only had
one argument
Quoted 3 lines
Quoted 3 lines
that needed to be passed.
I'd rather not have a new variable, but just change the processing to
do 1 or more
Quoted 4 lines
Quoted 2 lines
arguments in the existing variable.
Which if I'm not mistaken, is your first patch :)
Quoted 12 lines
Almost. The first patch does it for
OCI_IMAGE_ENTRYPOINT. That one is straight forward because there is no backward compatible problem. The second one (this one) does it forOCI_IMAGE_ENTRYPOINT_ARGS, which is trickier because if we make it behave the same asOCI_IMAGE_ENTRYPOINTit will break anyone who is currently relying on a space inOCI_IMAGE_ENTRYPOINT_ARGSto be passed verbatim to their entrypoint (hence my tentative suggestion to add a new variable). I'd be fine with just makeOCI_IMAGE_ENTRYPOINT_ARGSsplit on space if that was the original intention (I can even roll it into the previous patch if you want and make it do both variables at the same time).Quoted 9 lines
That's sort of my point.
The entry point can just be the executable, and this variable is supposed to be the arguments.
So no arguments should be passed via that first variable, but should be in this one. We can have the split and processing here, and check and forbid it in the first variable. It shouldn't be in both.
Quoted 7 lines
I've made plenty of container images where ENTRYPOINT had multiple arguments; the trivial example is ["
/usr/bin/python3", "my script"]. Sure, you can do it other ways (e.g. a proxy shell script.... Which then means your container needs a shell), but restricting that as an option doesn't seem necessary?
Sure, but I'm saying put that "my script" in the args variable, that's exactly what I added it for.
Bruce
Quoted 98 lines
Quoted 98 lines
Bruce
Quoted 75 lines
Quoted 7 lines
Bruce
Quoted 2 lines
I'll also have to figure out how to make the sloci backend work, but
that's a different
Quoted 6 lines
Quoted 6 lines
question.
Bruce
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)(quoted diff) +0
-0b/classes/image-oci-umoci.inc
Quoted 6 lines
Quoted 6 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 104
Quoted 6 lines
index 6c7f244..da93570 100644
classes/image-oci-umoci.inc +0
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG}--config.cmd "${OCI_IMAGE_ENTRYPOINT_ARGS}"
Quoted 3 lines
Quoted 3 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() {
Quoted 3 lines
classes/image-oci-umoci.inc +2
-0fi + if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@"".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())}
Quoted 2 lines
Quoted 2 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 109
Quoted 2 lines
classes/image-oci-umoci.inc +1
-0+ fi umoci config --image $image_name:${OCI_IMAGE_TAG} --author${OCI_IMAGE_AUTHOR_EMAIL}
Quoted 7 lines
Quoted 7 lines
classes/image-oci.bbclass OCI_IMAGE_SUBARCH ?=
Quoted 7 lines
classes/image-oci-umoci.inc +0
-0# make a tar version of the image direcotryclasses/image-oci.bbclass +0
-0@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?="${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE
Quoted 15 lines
Quoted 15 lines
Quoted 13 lines
classes/image-oci.bbclass +1
-1OCI_IMAGE_ENTRYPOINT ?= "sh" OCI_IMAGE_ENTRYPOINT_ARGS ?= "" +OCI_IMAGE_ENTRYPOINT_ARG_LIST ?="" OCI_IMAGE_WORKINGDIR ?= "" OCI_IMAGE_STOPSIGNAL ?= "" --2.34.1
Quoted 2 lines
Quoted 2 lines
--
- Thou shalt not follow the NULL pointer, for chaos and madness awaitthee at its end
Quoted 6 lines
Quoted 6 lines
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8354):https://lists.yoctoproject.org/g/meta-virtualization/message/8354
Quoted 3 lines
Quoted 3 lines
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected] Unsubscribe:https://lists.yoctoproject.org/g/meta-virtualization/leave/6693017/1050810/978058475/xyzzy
[[email protected]]Quoted 10 lines
Quoted 6 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
--
- Thou shalt not follow the NULL pointer, for chaos and madness awaitthee at its end
Quoted 2 lines
- "Use the force Harry" - Gandalf, Star Trek II
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 80 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 69 lines · Joshua Watt
Quoted 54 lines · Bruce Ashfield
Quoted 36 lines · Joshua Watt
Quoted 4 lines · Bruce Ashfield
On Thu, Oct 12, 2023 at 1:23 PM Bruce Ashfield via
lists.yoctoproject.org <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
On Thu, Oct 12, 2023 at 12:52 PM Joshua Watt <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. Inorder to
Quoted 1 line
Quoted 1 line
Quoted 1 line
maintain backward compatibility, a new variable has to be
introduced to
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
that can be split into the multiple arguments required
I haven't looked in detail, but the original intent of that variable
IS to have more than
Quoted 1 line
Quoted 1 line
one argument. I was just the only current user of them, and only had
one argument
Quoted 3 lines
Quoted 3 lines
that needed to be passed.
I'd rather not have a new variable, but just change the processing
to do 1 or more
Quoted 4 lines
Quoted 2 lines
arguments in the existing variable.
Which if I'm not mistaken, is your first patch :)
Quoted 12 lines
Almost. The first patch does it for
OCI_IMAGE_ENTRYPOINT. That one is straight forward because there is no backward compatible problem. The second one (this one) does it forOCI_IMAGE_ENTRYPOINT_ARGS, which is trickier because if we make it behave the same asOCI_IMAGE_ENTRYPOINTit will break anyone who is currently relying on a space inOCI_IMAGE_ENTRYPOINT_ARGSto be passed verbatim to their entrypoint (hence my tentative suggestion to add a new variable). I'd be fine with just makeOCI_IMAGE_ENTRYPOINT_ARGSsplit on space if that was the original intention (I can even roll it into the previous patch if you want and make it do both variables at the same time).Quoted 9 lines
That's sort of my point.
The entry point can just be the executable, and this variable is supposed to be the arguments.
So no arguments should be passed via that first variable, but should be in this one. We can have the split and processing here, and check and forbid it in the first variable. It shouldn't be in both.
Quoted 7 lines
I've made plenty of container images where ENTRYPOINT had multiple arguments; the trivial example is ["
/usr/bin/python3", "my script"]. Sure, you can do it other ways (e.g. a proxy shell script.... Which then means your container needs a shell), but restricting that as an option doesn't seem necessary?
Quoted 4 lines
Sure, but I'm saying put that "my script" in the args variable, that's exactly what I added it for.
I should clarify that I mean that we don't have to process it via the config.cmd for umoci
.. if there's a technical need to change how it is encoded, we can deal with that. i.e in
theory that variable could just be turned into multiple config.entrypoint calls instead of
config.cmd
But both ways of encoding it work (entrypoint + cmd), and there's no need to complicate things by adding another variable, we should be able to express what
we need with the existing ones.
The umoci and image-spec tests that I've run use entrypoint + cmd to encode arguments
to the main executable / interpreter. We can sit around and talk about how we are reading
the oci-image-spec, but both entrypoint and cmd are optional in it (the spec), and have a
similar function. I've seen both ways of encoding in various container stacks over
the years.
But in the end, I don't think it matters at all. With umoci, it is valid to encode them either
way, so simply converting space separated entrypoints and arguments to repeated
--config.entrypoint and --config.cmd calls are fine, and we don't have to worry about
backward compatibility now that I've looked at things more closely.
If someone wants a single entrypoint and options via cmd, they can do that with them
both converted, and vice versa.
Bruce
Quoted 112 lines
Bruce
Quoted 83 lines
Quoted 83 lines
Bruce
Quoted 76 lines
Quoted 7 lines
Bruce
Quoted 2 lines
I'll also have to figure out how to make the sloci backend work, but
that's a different
Quoted 6 lines
Quoted 6 lines
question.
Bruce
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)(quoted diff) +0
-0b/classes/image-oci-umoci.inc
Quoted 6 lines
Quoted 6 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 104
Quoted 6 lines
index 6c7f244..da93570 100644
classes/image-oci-umoci.inc +0
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG}--config.cmd "${OCI_IMAGE_ENTRYPOINT_ARGS}"
Quoted 3 lines
Quoted 3 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 107
Quoted 3 lines
classes/image-oci-umoci.inc +2
-0fi + if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@"".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())}
Quoted 2 lines
Quoted 2 lines
classes/image-oci-umoci.inc IMAGE_CMD:oci() { · line 109
Quoted 2 lines
classes/image-oci-umoci.inc +1
-0+ fi umoci config --image $image_name:${OCI_IMAGE_TAG} --author${OCI_IMAGE_AUTHOR_EMAIL}
Quoted 7 lines
Quoted 7 lines
classes/image-oci.bbclass OCI_IMAGE_SUBARCH ?=
Quoted 7 lines
classes/image-oci-umoci.inc +0
-0# make a tar version of the image direcotryclasses/image-oci.bbclass +0
-0@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?="${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE
Quoted 15 lines
Quoted 15 lines
Quoted 13 lines
classes/image-oci.bbclass +1
-1OCI_IMAGE_ENTRYPOINT ?= "sh" OCI_IMAGE_ENTRYPOINT_ARGS ?= "" +OCI_IMAGE_ENTRYPOINT_ARG_LIST ?="" OCI_IMAGE_WORKINGDIR ?= "" OCI_IMAGE_STOPSIGNAL ?= "" --2.34.1
Quoted 2 lines
Quoted 2 lines
--
- Thou shalt not follow the NULL pointer, for chaos and madnessawait thee at its end
Quoted 9 lines
Quoted 5 lines
- "Use the force Harry" - Gandalf, Star Trek II
--
- Thou shalt not follow the NULL pointer, for chaos and madness awaitthee at its end
Quoted 2 lines
- "Use the force Harry" - Gandalf, Star Trek II
Quoted 6 lines
Quoted 6 lines
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8359):
https://lists.yoctoproject.org/g/meta-virtualization/message/8359
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/meta-virtualization/leave/6693017/1050810/978058475/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 86 lines · Bruce Ashfield
Quoted 58 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 54 lines · Joshua Watt
Quoted 50 lines · Bruce Ashfield
Quoted 29 lines · Joshua Watt
Quoted 20 lines · Bruce Ashfield
Quoted 16 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 7 lines · Joshua Watt
The "entrypoint arguments" (command) is allowed to be a list of arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGSvariables doesn't support however. In order to maintain backward compatibility, a new variable has to be introduced to that can be split into the multiple arguments requiredI haven't looked in detail, but the original intent of that variable IS to have more than one argument. I was just the only current user of them, and only had one argument that needed to be passed.
Quoted 5 lines
Quoted 3 lines
I'd rather not have a new variable, but just change the processing to do 1 or more arguments in the existing variable.
Which if I'm not mistaken, is your first patch :)
Quoted 11 lines
Almost. The first patch does it for
OCI_IMAGE_ENTRYPOINT. That one is straight forward because there is no backward compatible problem. The second one (this one) does it forOCI_IMAGE_ENTRYPOINT_ARGS, which is trickier because if we make it behave the same asOCI_IMAGE_ENTRYPOINTit will break anyone who is currently relying on a space inOCI_IMAGE_ENTRYPOINT_ARGSto be passed verbatim to their entrypoint (hence my tentative suggestion to add a new variable). I'd be fine with just makeOCI_IMAGE_ENTRYPOINT_ARGSsplit on space if that was the original intention (I can even roll it into the previous patch if you want and make it do both variables at the same time).That's sort of my point.
The entry point can just be the executable, and this variable is supposed to be the arguments.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
So no arguments should be passed via that first variable, but should be in this one. We can have the split and processing here, and check and forbid it in the first variable. It shouldn't be in both.
I've made plenty of container images where ENTRYPOINT had multiple arguments; the trivial example is ["
/usr/bin/python3", "my script"]. Sure, you can do it other ways (e.g. a proxy shell script.... Which then means your container needs a shell), but restricting that as an option doesn't seem necessary?Sure, but I'm saying put that "my script" in the args variable, that's exactly what I added it for.
I should clarify that I mean that we don't have to process it via the config.cmd for umoci .. if there's a technical need to change how it is encoded, we can deal with that. i.e in theory that variable could just be turned into multiple config.entrypoint calls instead of config.cmd
But both ways of encoding it work (entrypoint + cmd), and there's no need to complicate things by adding another variable, we should be able to express what we need with the existing ones.
The umoci and image-spec tests that I've run use entrypoint + cmd to encode arguments to the main executable / interpreter. We can sit around and talk about how we are reading the oci-image-spec, but both entrypoint and cmd are optional in it (the spec), and have a similar function. I've seen both ways of encoding in various container stacks over the years.
Quoted 7 lines
But in the end, I don't think it matters at all. With umoci, it is valid to encode them either way, so simply converting space separated entrypoints and arguments to repeated --config.entrypoint and --config.cmd calls are fine, and we don't have to worry about backward compatibility now that I've looked at things more closely.
If someone wants a single entrypoint and options via cmd, they can do that with them both converted, and vice versa.
Got it. I think I understand now. I'll send a patch.
Quoted 108 lines
Bruce
Quoted 90 lines
Bruce
Quoted 75 lines
Quoted 75 lines
Bruce
Quoted 67 lines
Quoted 67 lines
Bruce
Quoted 40 lines
I'll also have to figure out how to make the sloci backend work, but that's a different question.
Bruce
Quoted 33 lines
Signed-off-by Joshua Watt <[email protected]>--- classes/image-oci-umoci.inc | 3 +++ classes/image-oci.bbclass | 1 + 2 files changed, 4 insertions(+)classes/image-oci-umoci.inc +3
-0@@ -103,6 +103,9 @@ IMAGE_CMD:oci() { if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then umoci config --image $image_name:${OCI_IMAGE_TAG} --config.cmd "${OCI_IMAGE_ENTRYPOINT_ARGS}" fi + if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then + umoci config --image $image_name:${OCI_IMAGE_TAG} ${@" ".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())} + fi umoci config --image $image_name:${OCI_IMAGE_TAG} --author ${OCI_IMAGE_AUTHOR_EMAIL} # make a tar version of the image direcotryclasses/image-oci.bbclass +1
-0@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE OCI_IMAGE_ENTRYPOINT ?= "sh" OCI_IMAGE_ENTRYPOINT_ARGS ?= "" +OCI_IMAGE_ENTRYPOINT_ARG_LIST ?="" OCI_IMAGE_WORKINGDIR ?= "" OCI_IMAGE_STOPSIGNAL ?= ""Quoted 15 lines
Quoted 6 lines
--
2.34.1--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek IIQuoted 4 lines
Quoted 4 lines
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek IIQuoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8359): https://lists.yoctoproject.org/g/meta-virtualization/message/8359
Mute This Topic: https://lists.yoctoproject.org/mt/101922305/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/leave/6693017/1050810/978058475/xyzzy [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=---
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II