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

Pin test_package_pex_environment's image to a particular sha #19324

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Jun 15, 2023

This pins the docker image used in src/python/pants/backend/docker/util_rules/docker_build_context_test.py:test_packaged_pex_environment to https://hub.docker.com/layers/library/python/3.8-buster/images/sha256-bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911?context=explore, which is (at the time of writing) the most recent 3.8-buster image.

This test has recently started failing with an error when building psutil:

E         psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
E             9 | #include <Python.h>
E               |          ^~~~~~~~~~
E         compilation terminated.
E         error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E         ----------------------------------------
E         ERROR: Failed building wheel for psutil

The failure correlates with the change in base image (from buster to bookworm) docker-library/python#822, which seems to have been published at 2023-06-14T23:05Z (https://hub.docker.com/layers/library/python/3.8/images/sha256-b904ee5365f53d19de5ff11c1ce96a616224a55306d55e3cf29a11e969a3a7e0?context=explore).

This change, that pins to the older image, seems to fix the problem.

This fixes https://pantsbuild.slack.com/archives/C0D7TNJHL/p1686790197387729

@huonw huonw added the category:internal CI, fixes for not-yet-released features, etc. label Jun 15, 2023
@@ -428,8 +429,8 @@ def test_packaged_pex_environment(rule_runner: RuleRunner) -> None:
rule_runner.write_digest(context.digest, path_prefix="contents")
with zipfile.ZipFile(os.path.join(rule_runner.build_root, "contents", pex_file), "r") as zf:
assert json.loads(zf.read("PEX-INFO"))["distributions"].keys() == {
"psutil-5.9.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
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 don't know why the distributions changed from 3.9 to 3.7 (both locally and in CI)?

@@ -393,7 +393,8 @@ def test_packaged_pex_environment(rule_runner: RuleRunner) -> None:
"""
docker_environment(
name="python_38",
image="python:3.8",
image="python:3.8-buster@sha256:bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911",
platform="linux_x86_64",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sha256 digest is specific to a particular platform, so we need to be specific here, or else running on arm64 (e.g. M1 Mac) fails because the x86-64 image doesn't match the default (linux_arm64).

@huonw huonw changed the title Pin test_package_pex_environment image to a particular sha Pin test_package_pex_environment's image to a particular sha Jun 15, 2023
@huonw huonw requested review from stuhood and kaos June 15, 2023 06:38
@thejcannon
Copy link
Member

Hey y'all. I'm going to merge this PR since it unblocks CI for other PRs.

We can address concerns in follow-up PRs

@thejcannon thejcannon merged commit cfab057 into pantsbuild:main Jun 15, 2023
@thejcannon thejcannon added this to the 2.15.x milestone Jun 15, 2023
github-actions bot pushed a commit that referenced this pull request Jun 15, 2023
This pins the docker image used in
`src/python/pants/backend/docker/util_rules/docker_build_context_test.py:test_packaged_pex_environment`
to
https://hub.docker.com/layers/library/python/3.8-buster/images/sha256-bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911?context=explore,
which is (at the time of writing) the most recent `3.8-buster` image.

This test has recently started failing with an error when building
`psutil`:

```
E         psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
E             9 | #include <Python.h>
E               |          ^~~~~~~~~~
E         compilation terminated.
E         error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E         ----------------------------------------
E         ERROR: Failed building wheel for psutil
```

The failure correlates with the change in base image (from buster to
bookworm) docker-library/python#822, which seems
to have been published at 2023-06-14T23:05Z
(https://hub.docker.com/layers/library/python/3.8/images/sha256-b904ee5365f53d19de5ff11c1ce96a616224a55306d55e3cf29a11e969a3a7e0?context=explore).

This change, that pins to the older image, seems to fix the problem.

This fixes
https://pantsbuild.slack.com/archives/C0D7TNJHL/p1686790197387729
github-actions bot pushed a commit that referenced this pull request Jun 15, 2023
This pins the docker image used in
`src/python/pants/backend/docker/util_rules/docker_build_context_test.py:test_packaged_pex_environment`
to
https://hub.docker.com/layers/library/python/3.8-buster/images/sha256-bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911?context=explore,
which is (at the time of writing) the most recent `3.8-buster` image.

This test has recently started failing with an error when building
`psutil`:

```
E         psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
E             9 | #include <Python.h>
E               |          ^~~~~~~~~~
E         compilation terminated.
E         error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E         ----------------------------------------
E         ERROR: Failed building wheel for psutil
```

The failure correlates with the change in base image (from buster to
bookworm) docker-library/python#822, which seems
to have been published at 2023-06-14T23:05Z
(https://hub.docker.com/layers/library/python/3.8/images/sha256-b904ee5365f53d19de5ff11c1ce96a616224a55306d55e3cf29a11e969a3a7e0?context=explore).

This change, that pins to the older image, seems to fix the problem.

This fixes
https://pantsbuild.slack.com/archives/C0D7TNJHL/p1686790197387729
github-actions bot pushed a commit that referenced this pull request Jun 15, 2023
This pins the docker image used in
`src/python/pants/backend/docker/util_rules/docker_build_context_test.py:test_packaged_pex_environment`
to
https://hub.docker.com/layers/library/python/3.8-buster/images/sha256-bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911?context=explore,
which is (at the time of writing) the most recent `3.8-buster` image.

This test has recently started failing with an error when building
`psutil`:

```
E         psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
E             9 | #include <Python.h>
E               |          ^~~~~~~~~~
E         compilation terminated.
E         error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E         ----------------------------------------
E         ERROR: Failed building wheel for psutil
```

The failure correlates with the change in base image (from buster to
bookworm) docker-library/python#822, which seems
to have been published at 2023-06-14T23:05Z
(https://hub.docker.com/layers/library/python/3.8/images/sha256-b904ee5365f53d19de5ff11c1ce96a616224a55306d55e3cf29a11e969a3a7e0?context=explore).

This change, that pins to the older image, seems to fix the problem.

This fixes
https://pantsbuild.slack.com/archives/C0D7TNJHL/p1686790197387729
@WorkerPants
Copy link
Member

I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants.

✔️ 2.15.x

Successfully opened #19337.

✔️ 2.16.x

Successfully opened #19336.

✔️ 2.17.x

Successfully opened #19335.


Thanks again for your contributions!

🤖 Beep Boop here's my run link

thejcannon pushed a commit that referenced this pull request Jun 15, 2023
…y-pick of #19324) (#19337)

This pins the docker image used in
`src/python/pants/backend/docker/util_rules/docker_build_context_test.py:test_packaged_pex_environment`
to
https://hub.docker.com/layers/library/python/3.8-buster/images/sha256-bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911?context=explore,
which is (at the time of writing) the most recent `3.8-buster` image.

This test has recently started failing with an error when building
`psutil`:

```
E         psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
E             9 | #include <Python.h>
E               |          ^~~~~~~~~~
E         compilation terminated.
E         error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E         ----------------------------------------
E         ERROR: Failed building wheel for psutil
```

The failure correlates with the change in base image (from buster to
bookworm) docker-library/python#822, which seems
to have been published at 2023-06-14T23:05Z
(https://hub.docker.com/layers/library/python/3.8/images/sha256-b904ee5365f53d19de5ff11c1ce96a616224a55306d55e3cf29a11e969a3a7e0?context=explore).

This change, that pins to the older image, seems to fix the problem.

This fixes
https://pantsbuild.slack.com/archives/C0D7TNJHL/p1686790197387729

Co-authored-by: Huon Wilson <huon@exoflare.io>
thejcannon pushed a commit that referenced this pull request Jun 15, 2023
…y-pick of #19324) (#19335)

This pins the docker image used in
`src/python/pants/backend/docker/util_rules/docker_build_context_test.py:test_packaged_pex_environment`
to
https://hub.docker.com/layers/library/python/3.8-buster/images/sha256-bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911?context=explore,
which is (at the time of writing) the most recent `3.8-buster` image.

This test has recently started failing with an error when building
`psutil`:

```
E         psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
E             9 | #include <Python.h>
E               |          ^~~~~~~~~~
E         compilation terminated.
E         error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E         ----------------------------------------
E         ERROR: Failed building wheel for psutil
```

The failure correlates with the change in base image (from buster to
bookworm) docker-library/python#822, which seems
to have been published at 2023-06-14T23:05Z
(https://hub.docker.com/layers/library/python/3.8/images/sha256-b904ee5365f53d19de5ff11c1ce96a616224a55306d55e3cf29a11e969a3a7e0?context=explore).

This change, that pins to the older image, seems to fix the problem.

This fixes
https://pantsbuild.slack.com/archives/C0D7TNJHL/p1686790197387729

Co-authored-by: Huon Wilson <huon@exoflare.io>
thejcannon pushed a commit that referenced this pull request Jun 15, 2023
…y-pick of #19324) (#19336)

This pins the docker image used in
`src/python/pants/backend/docker/util_rules/docker_build_context_test.py:test_packaged_pex_environment`
to
https://hub.docker.com/layers/library/python/3.8-buster/images/sha256-bc4b9fb034a871b285bea5418cedfcaa9d2ab5590fb5fb6f0c42aaebb2e2c911?context=explore,
which is (at the time of writing) the most recent `3.8-buster` image.

This test has recently started failing with an error when building
`psutil`:

```
E         psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
E             9 | #include <Python.h>
E               |          ^~~~~~~~~~
E         compilation terminated.
E         error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E         ----------------------------------------
E         ERROR: Failed building wheel for psutil
```

The failure correlates with the change in base image (from buster to
bookworm) docker-library/python#822, which seems
to have been published at 2023-06-14T23:05Z
(https://hub.docker.com/layers/library/python/3.8/images/sha256-b904ee5365f53d19de5ff11c1ce96a616224a55306d55e3cf29a11e969a3a7e0?context=explore).

This change, that pins to the older image, seems to fix the problem.

This fixes
https://pantsbuild.slack.com/archives/C0D7TNJHL/p1686790197387729

Co-authored-by: Huon Wilson <huon@exoflare.io>
@huonw huonw deleted the bugfix/docker-build-context-test branch June 15, 2023 19:46
This was referenced Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants