-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildah-config: created and created-by confusion #595
Comments
@TomSweeneyRedHat Can you remove this option, but add the option when commit is executed. |
@rhatdan, I'm 99% sure what you're asking for. I think you want me to remove the created and created-by options from |
Believe this would also close #537 |
@TomSweeneyRedHat Yes on the first statement, but created and createdby should be populated on buildah commit, not no buildah config. |
@taqtiqa-mark #537 isn't just the format the date is displayed in, the primary issue is that local timezone isn't being applied when the time is displayed to the user. The spec isn't clear on which timezone the container 'created' should be in, I would assume UTC. This should probably be raised back as an issue to opencontainers. |
@pixdrift the created date shown in |
@TomSweeneyRedHat this is how I would expect it to work, but my ticket #537 shows that it is reporting the raw UTC time off the container and not adjusting for my local time (AEST which is UTC+10). In my situation, it looks like all container operations happened 10 hours in the past. |
@pixdrift @TomSweeneyRedHat I think if the spec format was followed then the timezone decoration would explain the 10 hour difference. My view is to keep things a simple as possible ... so just stick with UTC throughout and format the time as the spec states. Chopping and changing is problematic. To clarify the use case. An artifact is created on two CI services. Which one finished first? Reporting or recording with TZ or locale adjustments just opens up a world of pain for scripted scenarios. |
@taqtiqa-mark I am not suggesting that the date/time be anything other than UTC in the container. I was raising that the spec doesn't stipulate that UTC should be used for this date/time and the spec probably should define this categorically. My issue in #537 is that the displayed CREATED AT time in |
@pixdrift ack. I'm arguing displayed data should be UTC too. Humans are only one type of consumer of buildah output. Scripts are another important group. It's much easier for a Human to recognize a UTC time than to write scripts and pipelines that coordinate/adjust time zone/locale changes or differences. Automate everything is very nearly possible, and these sorts of "trivial" issues can cause havoc, then result in elaborate, fragile, expensive to maintain code bases. |
@taqtiqa-mark ack. I'd argue that
-edit- |
I'll let @rhatdan chime in on what we should be displaying time wise. But just to be totally clear, the times that we store for the containers and images are UTC times. What we display is UTC time with the exception of the time displayed in the @pixdrift I'm a little confused (it's late, so likely me) by your reply above: "but my ticket #537 shows that it is reporting the raw UTC time off the container and not adjusting for my local time (AEST which is UTC+10)." #537 was for the image, not the container. Is the latest Buildah (from GitHub, don't think we've spun a rpm with the fix yet) not showing that for you? Is there a spot that the time for a container is being displayed that should be showing UTC in your opinion. |
@TomSweeneyRedHat, my issue #537 is about display only, and is in I will follow up #537 in that issue and provide feedback, apologies I hadn't seen your fix. |
@TomSweeneyRedHat, @taqtiqa-mark To summarise above, this proposal/suggestion looks good, my comments were in response to how it related to #537, which is now closed. Crisis over 😄 |
How about buildah images does display in LocaleTime and buildah images --json returns in UTC. |
Appreciate the proposal. May be a Anyway, this could be made robust by providing an option Agree all dates and times sent in response to |
How about if we check if the output is a tty, if yes, then it is converted, if not then it get UTC. Although this might confuse certain users. Perhaps we should add a flag to tell it to not convert. buildah --utc |
@taqtiqa-mark, |
@rhatdan, I tend to prefer explicit Detecting a TTY rather than following a @pixdrift, json issue and not utc issue yes, json overly complex. I understand by using json the developers get some freedom, the tradeoff is that now buildah is one more tool's output for which busy-box isn't sufficient - note not all cases will Thanks for your time, thought and effort. |
@taqtiqa-mark, can you provide some examples of the buildah commands with proposed switches with proposed/expected output? eg. |
I was interested in how this situation was handled in Docker, and it looks like the solution in Docker is to use the more generic When looking for
Should there be some discussion about how all the tools under projectatomic umbrella (ie. |
[update] change from Refering to the configuration list in issue #591 table Ideal workflow would look like this, unless I missed something OCI_ID=$(buildah push ...)
OCI_CONFIG="$(buildah inspect --pipe --pipe-delimiter='|' |grep ${OCI_ID})"
IFS='|' read arch authors cmd created created_by description remain1 <<< ${OCI_CONFIG}
IFS='|' read documentation entrypoint env licenses oci_id os port ref_name remain2 <<< ${remain1}
IFS='|' read revision source title url user vendor remain3 <<< ${remain2}
IFS='|' read version volume workingdir <<< ${remain3} The assumptions are:
Hope that helps? P.S @pixdrift to my mind this isn't so much a 'format' as making the |
@taqtiqa-mark, what do you expect the output of |
[update] Added the OCI ID hash in this example as the first field which we grep on - could also place it in alphabetical order, wherever 'oci_id' then is placed. If you were worried about collision you could output the full hash. It's not for human parsing so no reason why not be safer than sorry. OCI_CONFIG='4272a169ec1c|amd_64|"Daniel Walsh, pixdrift"|"/bin/sh consul-entrypoint.sh"|"me oh <my@mailinator.com>"|http://www.google.com|1|@|3|&|'
IFS='|' read oci_id arch authors cmd description documentation remain1 <<< ${OCI_CONFIG}
echo $arch
echo $authors
echo $cmd
echo $description
echo $documentation
echo $remain1 Is that what you wanted? |
@taqtiqa-mark I am interested in what the output of this command would be. No parsing or interpretation, just what you would like to see printed to the console? My view is that the Unix Philosophy is absolutely supported in buildah's current form. You are referring to elements that you want to extract from the spec. The method provided to interrogate the spec of the container is I don't fully understand the constraint of limiting to commands available in -edit- I should point out I have no say on the outcome, I am just a user of the tools. I am genuinely interested in how you're using it. |
If I can make another point for jq. The jq solution is more robust than using positional parameters. Even if the output items are sorted alphabetically, if anything is added to the spec (even elements you don't utilise) the script will break. With |
[update] Removed wall of text to the salient point.
See OCI_CONFIG above. This is hypothetical output.
Fine, just change I'm not disputing I really don't see the value or ease of json piping being so overwhelming that std conventional plain string piping should be dropped. |
I would think the format command would be best to satisfy your needs then you can format the output of buildah images any way you want. Take a look at |
@rhatdan and @pixdrift I've given the concrete use case. (For later readers - the I'm not familiar with |
@taqtiqa-mark, I have provided the |
@taqtiqa-mark, As requested, example using jq in current config (random fields selected)
|
Thanks @pixdrift for taking the time to do that. I appreciate we are all doing this in what would otherwise be family or recreation time. A couple of observations.
|
Examples of displaying specific information formatted from inspect is as follows: So that would become This example can be extended to output any combination of fields/elements from the I can put together a more complete example from docker and post it.
|
@pixdrift : Thanks. Striving to keep things simple and avoid the need to consult docs etc. Not easy to write intuitive software, I know. Esp when user base is so diverse. The request for the complete equivalent example is to confirm my hunch: it's so painful, no one wants to be the one to write it out ;) And that's without facing the prospect of dealing with syntax errors, capitalization errors, |
@pixdrift @taqtiqa-mark Lets add the format and see if we can satisfy your needs with that. Should be simple to back port the changes from podman to buildah images. @umohnani8 Could you look at that? |
@rhatdan agreed, format to align with other tools would be a good solution. |
I am not sure what we are missing now?
If you want it in namevalue pairs
|
@rhatdan, looks fine to me. @taqtiqa-mark, does that meet your requirement/expectation? |
@rhatdan add |
@umohnani8 We have it now I believe. |
The OCI Spec v1.0.1 suggests that neither
--created
nor--created-by
ought to be user configurable.The text was updated successfully, but these errors were encountered: