proud-byte-81916
09/28/2023, 11:23 AMpants package path/to/lambda/:lambda
it works and I get a deployable .zip file, but if I run the same in CD I get:
ProcessExecutionFailure: Process 'Build python_awslambda artifact for path/to/lambda/:lambda' failed with exit code 1.
stdout:
stderr:
A distribution for pillow could not be resolved for cp310-cp310-linux_x86_64.
Found 1 distribution for pillow that do not apply:
1.) The wheel tags for Pillow 10.0.1 are cp310-cp310-manylinux_2_28_x86_64 which do not match the supported tags of cp310-cp310-linux_x86_64:
cp310-cp310-manylinux2014_x86_64
I am running the same version of python on the GHA and in my local machine I believe, (3.10.13), so no idea why this wouldn't work - any idea how to solve it? appreciate a lot any guidance! 🙏proud-byte-81916
09/28/2023, 11:47 AM{
"algorithm": "sha256",
"hash": "f6d3d4c905e26354e8f9d82548475c46d8e0889538cb0657aa9c6f0872a37aa4",
"url": "<https://files.pythonhosted.org/packages/9b/ba/391fd1ff93e158cb34de3d2e003c070ee85b8840a4fe99a900463d75efad/Pillow-10.0.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "32bec7423cdf25c9038fef614a853c9d25c07590e1a870ed471f47fb80b244db",
"url": "<https://files.pythonhosted.org/packages/2c/30/458e634572b833d8208ee83ca4e43bb6c21ccdd1b6149f4baf072f8807e8/Pillow-10.0.1-pp310-pypy310_pp73-macosx_10_10_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "f11c9102c56ffb9ca87134bd025a43d2aba3f1155f508eff88f694b33a9c6d19",
"url": "<https://files.pythonhosted.org/packages/52/97/9fb1b66fbf98893722247fdf6ac39467a7b177483b546a94dbcff66653f0/Pillow-10.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "e6a90167bcca1216606223a05e2cf991bb25b14695c518bc65639463d7db722d",
"url": "<https://files.pythonhosted.org/packages/53/ac/3f9450af6583199b1c408f3a9a0f65e6dedc25aed15f691a74bcfa2d1077/Pillow-10.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl>"
},
{
"algorithm": "sha256",
"hash": "50bd5f1ebafe9362ad622072a1d2f5850ecfa44303531ff14353a4059113b12d",
"url": "<https://files.pythonhosted.org/packages/55/93/9a8b06ca5917f246d1cd31351d5ec38651f8f5f9619c8db5751583f49ba3/Pillow-10.0.1-cp310-cp310-macosx_11_0_arm64.whl>"
},
{
"algorithm": "sha256",
"hash": "d72967b06be9300fed5cfbc8b5bafceec48bf7cdc7dab66b1d2549035287191d",
"url": "<https://files.pythonhosted.org/packages/64/9e/7e638579cce7dc346632f020914141a164a872be813481f058883ee8d421/Pillow-10.0.1.tar.gz>"
},
{
"algorithm": "sha256",
"hash": "0462b1496505a3462d0f35dc1c4d7b54069747d65d00ef48e736acda2c8cbdff",
"url": "<https://files.pythonhosted.org/packages/7a/07/e896b096a77375e78e02ce222ae4fd6014928cd76c691d312060a1645dfa/Pillow-10.0.1-cp310-cp310-manylinux_2_28_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "8f06be50669087250f319b706decf69ca71fdecd829091a37cc89398ca4dc17a",
"url": "<https://files.pythonhosted.org/packages/8c/34/4e02804420b1cd9371ce5f7c0da7024a8450e6b092c336d3233d6c6448d9/Pillow-10.0.1-cp310-cp310-macosx_10_10_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "552912dbca585b74d75279a7570dd29fa43b6d93594abb494ebb31ac19ace6bd",
"url": "<https://files.pythonhosted.org/packages/9e/33/0140c7dbe509d4e765558c976bea108fd2f63d527a9e16860392ccbcae72/Pillow-10.0.1-cp310-cp310-musllinux_1_1_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "186f7e04248103482ea6354af6d5bcedb62941ee08f7f788a1c7707bc720c66f",
"url": "<https://files.pythonhosted.org/packages/a1/a7/35db8e4d15e8f139f9eda3378260a91b2ef7342342769dbeaff8dbc29c26/Pillow-10.0.1-cp310-cp310-manylinux_2_28_aarch64.whl>"
},
{
"algorithm": "sha256",
"hash": "b7cf63d2c6928b51d35dfdbda6f2c1fddbe51a6bc4a9d4ee6ea0e11670dd981e",
"url": "<https://files.pythonhosted.org/packages/af/66/d2aaf99819c7aef39f65b43c67ef968128aff33d44c230ec675b40a7ffb4/Pillow-10.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "d889b53ae2f030f756e61a7bff13684dcd77e9af8b10c6048fb2c559d6ed6eaf",
"url": "<https://files.pythonhosted.org/packages/d2/4f/9bb94120b219e050588684cc5f4d1d48d97e0e4a1ec6c1aa68369132d2c7/Pillow-10.0.1-cp310-cp310-musllinux_1_1_aarch64.whl>"
}
And if I re-generate the lockfile in the GHA runner, I get the same
This is quite strange, I wonder why is the package command looking for cp310-cp310-linux_x86_64
? and how to fix this?broad-processor-92400
09/28/2023, 12:28 PMproud-byte-81916
09/28/2023, 12:29 PMpython_awslambda(
name="lambda",
runtime="python3.10",
handler="app.py:lambda_handler",
)
and my local machine is a dev container with ubuntu linux 22.04, exactly the same as the gha runnerbroad-processor-92400
09/28/2023, 12:41 PMproud-byte-81916
09/28/2023, 12:44 PMproud-byte-81916
09/28/2023, 12:44 PMproud-byte-81916
09/28/2023, 12:46 PMcurved-television-6568
09/28/2023, 1:59 PMproud-byte-81916
09/28/2023, 2:00 PMproud-byte-81916
09/28/2023, 2:02 PMpython_default.lock
the wheel that pants is expecting to find
- name: Fix wheels in runner
run: |
# issue with Pants 2.17, will be fixed in 2.18 - this temporarly fixes it
# fix for pillow~=10.0.0
sed -i "s/cp310-cp310-manylinux_2_28_x86_64/cp310-cp310-manylinux2014_x86_64/g" python_default.lock
proud-byte-81916
09/28/2023, 2:02 PMenough-analyst-54434
09/28/2023, 3:20 PMproud-byte-81916
09/28/2023, 3:25 PMenough-analyst-54434
09/28/2023, 3:35 PMenough-analyst-54434
09/28/2023, 3:35 PMHm, definitely unexpected to me that there’s a difference between two almost identical platforms?There may not be, but the issue is the abbreviated platform used by default for python_awslambda does not have enough information to re-construct a either a full proper marker environment or a full proper tag set. It forces the tag set to be derived by calling Pip like so:
$ pip debug --verbose --platform linux_x86-64 --platform manylinux2014_x86_64 --implementation cp --python-version 3.10 --abi cp310 | grep -A105 "Compatible tags"
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
Compatible tags: 105 (target: platforms=['linux_x86-64', 'manylinux2014_x86_64'] version_info='3.10' abis=['cp310'] implementation='cp')
cp310-cp310-linux_x86-64
cp310-cp310-manylinux2014_x86_64
cp310-cp310-manylinux2010_x86_64
cp310-cp310-manylinux1_x86_64
cp310-abi3-linux_x86-64
cp310-abi3-manylinux2014_x86_64
cp310-abi3-manylinux2010_x86_64
cp310-abi3-manylinux1_x86_64
cp310-none-linux_x86-64
cp310-none-manylinux2014_x86_64
cp310-none-manylinux2010_x86_64
cp310-none-manylinux1_x86_64
cp39-abi3-linux_x86-64
cp39-abi3-manylinux2014_x86_64
... <snipped> ...
py30-none-any
Maybe the installed version of glibc is slightly different? (I don’t know how to check, though)A quick way to check glibc version:
$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.3) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
So glibc is 2.35 there.enough-analyst-54434
09/28/2023, 3:40 PMplatforms
(abbreviated platforms - what the python_awslambda
target is using in this problem case) - were introduced as a Twitter hack that worked in their limited / controlled environment, but do not work in general except by getting a bit lucky. Pants should eventually definitely deprecate them - a complete platform is always better and always correct. The abbreviated platform is often plain old incorrect. I've done my best to make them as robust as possible after taking over stewardship by failing fast for un-knowable environment markers, but they do not fail fast for un-knowable tags.proud-byte-81916
09/28/2023, 3:46 PMbroad-processor-92400
09/28/2023, 8:53 PMproud-byte-81916
09/28/2023, 9:59 PMproud-byte-81916
09/29/2023, 1:45 PMcomplete_platforms
directive, so my build file in the lambda function project now looks like:
python_sources(
name="ner_logo_gen",
sources=["**/*.py"],
dependencies=[":env_file"],
)
python_tests(
name="tests",
sources=["tests/**/test_*.py"],
dependencies=[":tests_support_files", ":env_file"],
)
resources(
name="tests_support_files",
sources=["tests/**/*"],
)
resources(name="env_file", sources=[".env", ".env.template"])
python_awslambda(
name="lambda",
runtime="python3.10",
handler="app.py:lambda_handler",
complete_platforms=["3rdparty/platforms:aws_lambda_python_3_10"]
)
Now when I run package, I get this new error though:
13:44:15.93 [INFO] Completed: Build python_awslambda artifact for kittl/projects/ner_logo_gen:lambda
13:44:15.93 [ERROR] 1 Exception encountered:
Engine traceback:
in `package` goal
ProcessExecutionFailure: Process 'Build python_awslambda artifact for kittl/projects/ner_logo_gen:lambda' failed with exit code 1.
stdout:
stderr:
A single target is required for creating a flat sys.path directory entry.
There were 2 targets selected:
1. cp310-cp310-linux_x86_64
2. cp310-cp310-manylinux_2_26_x86_64
Any idea as how to possibly fix this? Thanks so much really appreciate! 🙏enough-analyst-54434
09/29/2023, 2:58 PMpython_awslambda
target runtime
field.proud-byte-81916
09/29/2023, 2:58 PMproud-byte-81916
09/29/2023, 3:06 PM