Skip to content
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

Add builder labels #1917

Closed
wants to merge 1 commit into from
Closed

Conversation

caiges
Copy link
Contributor

@caiges caiges commented Oct 15, 2019

This adds builder labels during a commit. Closes #1864

Signed-off-by: caiges [email protected]

@vrothberg
Copy link
Member

vrothberg commented Oct 15, 2019

Hi @caiges, thanks for opening the PR! I think it's a bit too early to merge it as there's no consensus yet in #1864. I suggest to wait a bit longer and see if this is something we could get into the OCI spec. This would prevent us from letting users depend on something that is likely to change in the future.

@caiges
Copy link
Contributor Author

caiges commented Oct 15, 2019

Oh totally agree, I just wanted to throw out what the implementation & impact might look like.

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably f995696) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -158,6 +158,10 @@ func commitCmd(c *cobra.Command, args []string, iopts commitInputOptions) error
}
}

// Add builder information.
builder.SetLabel("org.opencontainers.image.builder.name", "buildah")
builder.SetLabel("org.opencontainers.image.builder.version", buildah.Version)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on @vbatts comment #1864 (comment), I think that we should not use the org.opencontainers.image prefix to prevent users from assuming that's a supported annotation of the OCI image spec.

How about a single io.buildah.version label? It's presence shows both, that is was built with buildah and with which version? @rhatdan @caiges @TomSweeneyRedHat @nalind WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur on not using the org.opencontainers.image. Where's the "io" from in your suggestion @vrothberg ? My initial thought was "containers.image.*"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is a good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur on not using the org.opencontainers.image. Where's the "io" from in your suggestion @vrothberg ? My initial thought was "containers.image.*"

The "io" comes from reversing the Buildah domain buildah.io -> io.buildah which might help consumers of an image find out what this label means. Maybe, just io.buildah as the key and have vX.Y.Z as the value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it could be com.github.containers.buildah.version/commit too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like io.podman, nice and simple and easy to find.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec's rules suggest the reverse-the-order-of-dns-labels method that's used for Java packages, D-Bus services, and others. This project doesn't "own" the com.github namespace prefix, and mustn't use the org.opencontainers prefix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with io.buildah for now since the podman/buildah relationship might be a little confusing if we were to use io.podman. I might be missing some context there though.

@rhatdan
Copy link
Member

rhatdan commented Nov 7, 2019

Needs a rebase.

@@ -158,6 +158,10 @@ func commitCmd(c *cobra.Command, args []string, iopts commitInputOptions) error
}
}

// Add builder information.
builder.SetLabel("org.opencontainers.image.builder.name", "buildah")
builder.SetLabel("org.opencontainers.image.builder.version", buildah.Version)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make these annotation keys constants that we export, so that API consumers can refer to them without risking typos.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a decent thought, I've exported the annotation key.

@TomSweeneyRedHat
Copy link
Member

LGTM assuming happy tests

Use io.podman.version and fix inspect tests

Signed-off-by: caiges <[email protected]>
@TomSweeneyRedHat
Copy link
Member

@vrothberg @nalind @rhatdan PTAL

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhatdan
Copy link
Member

rhatdan commented Nov 16, 2019

@rh-atomic-bot retry

@TomSweeneyRedHat
Copy link
Member

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 9019805 has been approved by TomSweeneyRedHat

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 9019805 with merge 9ff68b3...

@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr, status-travis
Approved by: TomSweeneyRedHat
Pushing 9ff68b3 to master...

edsantiago added a commit to edsantiago/buildah that referenced this pull request Dec 3, 2019
PR 1966 has languished for three weeks without activity from
submitter. In the interests of getting it online, I have
taken it over and:

  - rebased
  - fixed several misunderstandings (bugs) noted in review feedback
  - fixed a few more

I also slightly rewrote two tests (tag by id, commit with name)
that were incomprehensible to me: unnecessary mount/umount and
no actual testing of anything other than checking exit status.
I believe the new code is closer to the intention of testing
but please pay closer attention to those bits.

Also: fixed the basic 'inspect' test. It looks like at some
point in the last month containers#1917 added a version string to
the buildah-inspect output. The test was fixed on master,
but ypu's PR did not incorporate those fixes and the
test was breaking. I took the liberty of cleaning up
the entire test for readability and maintainability.

Signed-off-by: Ed Santiago <[email protected]>
@edsantiago edsantiago mentioned this pull request Dec 3, 2019
rh-atomic-bot pushed a commit that referenced this pull request Dec 4, 2019
PR 1966 has languished for three weeks without activity from
submitter. In the interests of getting it online, I have
taken it over and:

  - rebased
  - fixed several misunderstandings (bugs) noted in review feedback
  - fixed a few more

I also slightly rewrote two tests (tag by id, commit with name)
that were incomprehensible to me: unnecessary mount/umount and
no actual testing of anything other than checking exit status.
I believe the new code is closer to the intention of testing
but please pay closer attention to those bits.

Also: fixed the basic 'inspect' test. It looks like at some
point in the last month #1917 added a version string to
the buildah-inspect output. The test was fixed on master,
but ypu's PR did not incorporate those fixes and the
test was breaking. I took the liberty of cleaning up
the entire test for readability and maintainability.

Signed-off-by: Ed Santiago <[email protected]>

Closes: #2004
Approved by: rhatdan
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide metadata to indicate version of tools used to create a container
7 participants