-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Migrate the Docker context tags version from <stage>.tag
to tags.<stage>
.
#14376
Migrate the Docker context tags version from <stage>.tag
to tags.<stage>
.
#14376
Conversation
…stage>`. # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust]
Tried the deprecation message on the Docker testproject, and it looks like: diff --git a/testprojects/src/python/docker/BUILD b/testprojects/src/python/docker/BUILD
index a6e4ffef6..58c01faf4 100644
--- a/testprojects/src/python/docker/BUILD
+++ b/testprojects/src/python/docker/BUILD
@@ -9,7 +9,7 @@ docker_image(
docker_image(
name="test-example-synth",
- image_tags=["1.2.5"],
+ image_tags=["1.2.5-{baseimage.tag}", "{tags.baseimage}"],
instructions=[
"FROM python:3.7",
'ENTRYPOINT ["/hello"]',
Not sure really what to put in as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable
class DockerfileImageTagsDeprecation(DeprecatedDockerInterpolationValue): | ||
_removal_version = "2.11.0.dev0" | ||
_hint = ( | ||
"The `<stage>.tag` version values are deprecated in favour of `tags.<stage>`.\n\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to Save A Click and give an example:
For example, rather than using
{baseimage.tag}
in your Docker template, use{tags.baseimage}
.
But then still link to this PR like you do if people still aren't understanding.
The PR title: "using |
Rather than using the Class and Also, I'm not sure if this deprecation is always executed? It looks like it would be. We need to make sure the deprecation is silent if you did nothing wrong. |
That is the
At that point, we don't know if the deprecated name will be used or not, hence why I placed it in
See above.
That's a good idea, I'll take a stab at that. |
for this build target: docker_image(
name="test-example-synth",
image_tags=["1.2.5", "1.{baseimage.tag}"],
instructions=[
"FROM python:3.7",
'ENTRYPOINT ["/hello"]',
'CMD ["synthetic!"]',
"COPY testprojects.src.python.hello.main/main.pex /hello",
],
) |
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Awesome! To be crystal clear, if you remove the bad reference and rerun with |
Check. Works as expected both with and without the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
…stage>`. (pantsbuild#14376) Fixes pantsbuild#14023 Currently, the context gets values on the form `<stage>.tag = <tag>`, where stage is either `baseimage`, `stageN` or `<stage name>`. Given the dynamic nature of this key, it is not well suited to use as a root key for the context, as it may conflict with other values. e.g. if you have a stage named "build_args", it would collide with the context value for build args. This PR deprecates the current layout in 2.10, in favour of putting them under a `tags` key instead `tags.<stage> = <tag>`: ```python { "tags": { "baseimage": "latest", "stage0": "latest", "custom-stage-name": "1.2", ... }, "build_args": {...}, ... } ``` # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Fixes #14023
Currently, the context gets values on the form
<stage>.tag = <tag>
, where stage is eitherbaseimage
,stageN
or<stage name>
.Given the dynamic nature of this key, it is not well suited to use as a root key for the context, as it may conflict with other values. e.g. if you have a stage named "build_args", it would collide with the context value for build args.
This PR deprecates the current layout in 2.10, in favour of putting them under a
tags
key insteadtags.<stage> = <tag>
: