melodic-carpenter-39613
02/08/2023, 9:18 AMResolutionImpossible
when running ./pants generate-lock-files
due to multiple pinned versions of bcrypt (3.2.2 vs 4.0.1), but only have a single pinned version (3.2.2) in my top-level requirements. How would I use pants to debug the constraints for each package similar to pipdeptree
so that I can work out where the issue is coming from?alert-dawn-51425
02/08/2023, 2:40 PMcurved-manchester-66006
02/08/2023, 2:48 PMsrc/{python,jvm}
makes a lot of sense to me. Most of the docs for Docker, helm, etc also follow that pattern, so following them one would end up with src/python,docker,chart,deployment}
and each deploy-able container "app" would be spread across 4 directories (plus tests) instead of having the Dockerfile or whatnot live right next to the source code. Is pants intentionally trying to nudge me towards that per backend layout as a best practice, or is it just an accident of the example in the docs?lively-gpu-26436
02/08/2023, 4:53 PMpolite-garden-50641
02/08/2023, 4:59 PMModuleNotFoundError: No module named 'pants.backend.python.dependency_inference.scripts'
on the latest 2.16.0 dev release, I figured out it was related to https://github.com/pantsbuild/pants/pull/17997 but I can't figure out how to fix it. adding ``pants.backend.python.dependency_inference.scripts`` to backend_packages
doesn't fix the issue.happy-kitchen-89482
02/08/2023, 5:41 PMinit-pants
GitHub Action (in https://github.com/pantsbuild/actions) has been updated to bootstrap the new Pants launcher binary (AKA "scie-pants"). Once you upgrade, your CI Pants commands should just be pants
, not ./pants
. The upgrade tag is v3-scie-pants
, to emphasize this fact. Once this is standard, we will likely drop that suffix and continue with regular numbered versions. Please try it out!happy-kitchen-89482
02/08/2023, 6:08 PMv4-scie-pants
(or whatever the latest tag is there...)alert-dawn-51425
02/08/2023, 10:06 PMlively-gpu-26436
02/08/2023, 10:37 PM./pants package bin/python/k2-cli
22:22:25.21 [INFO] Canceled: Building docker image k2cli-image:latest
22:22:26.30 [INFO] Completed: Building docker image k2cli-image:latest
22:22:26.30 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Building docker image k2cli-image:latest' failed with exit code 1.
stdout:
stderr:
#1 [internal] load build definition from Dockerfile
#1 sha256:4a8abd0980b879a832783129b636eeff325378e63c397e805a03006b28634618
#1 transferring dockerfile: 276B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 sha256:fc552389e5436c35d97f01972fad8271931105a81c136e6441a7b201d03dc98f
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load metadata for <http://docker.io/library/python:3.11-buster|docker.io/library/python:3.11-buster>
#3 sha256:e6addec88fd262c680555922caa4a8358267c255899efe3bfe496a8402ddc253
Failed to fire hook: while creating logrus local file hook: user: Current requires cgo or $USER, $HOME set in environment
[2023-02-08T21:22:26.287981000Z][docker-credential-desktop][F] get system info: exec: "sw_vers": executable file not found in $PATH
[goroutine 1 [running, locked to thread]:
[common/pkg/system.init.0()
[ common/pkg/system/os_info.go:32 +0x29d
#3 ERROR: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
------
> [internal] load metadata for <http://docker.io/library/python:3.11-buster|docker.io/library/python:3.11-buster>:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
melodic-carpenter-39613
02/09/2023, 7:45 AM-ldebug
)?
I currently do not see any log file after locking with PEX_VERBOSITY=9 ./pants --keep-sandboxes=always -ldebug generate-lockfiles
and then `cd`ing to the directory mentioned in the debug console logs.thousands-plumber-33255
02/09/2023, 8:30 AMimport os
import sys
def run_manage():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_core.settings")
args = sys.argv
from django.core.management import execute_from_command_line
execute_from_command_line(args)
if __name__ == "__main__":
run_manage()
The PEX target like this:
pex_binary(
name="manage",
entry_point="manage.py",
restartable=True,
)
There is no issue running ./pants run django/manage.py -- runserver
.
But when running the PEX file in this docker container:
ARG PYTHON_VERSION
ARG VARIANT
FROM python:${PYTHON_VERSION}-${VARIANT}
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
COPY django/manage.pex /bin
EXPOSE 8000
CMD [ "/bin/manage.pex", "--", "runserver"]
I get this error: Unknown command: '--' Type 'manage.py help' for usage.
. It should be noted that it seems the app gets initialized as it throws an error when an env is missing that is used in settings.py.
When I remove "--" it just throws:
Traceback (most recent call last):
File "/root/.pex/unzipped_pexes/4385bc9a1b5d88169d1c8cca8cfb039ab5e16e21/manage.py", line 12, in <module>
run_manage()
File "/root/.pex/unzipped_pexes/4385bc9a1b5d88169d1c8cca8cfb039ab5e16e21/manage.py", line 7, in run_manage
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
When I check the pex I can see django in .deps
:
root@b11c2d409264:/bin/manage/.deps# ls -la | grep Django
drwxr-xr-x 5 root root 4096 Jan 1 1980 Django-3.2-py3-none-any.whl
What am I doing wrong?narrow-church-94634
02/09/2023, 11:15 AMnarrow-church-94634
02/09/2023, 11:17 AMnarrow-church-94634
02/09/2023, 11:19 AMnarrow-church-94634
02/09/2023, 11:19 AM./pants lint ::
110944.47 [ERROR] 1 Exception encountered:
NoSourceRootError: No source root found for utils/model_trainer.py
. See https://www.pantsbuild.org/v2.14/docs/source-roots for how to define source roots.narrow-church-94634
02/09/2023, 11:20 AMnarrow-church-94634
02/09/2023, 11:26 AMpython_sources()
narrow-church-94634
02/09/2023, 11:54 AMnarrow-church-94634
02/09/2023, 12:28 PMnarrow-church-94634
02/09/2023, 12:39 PMnarrow-church-94634
02/09/2023, 12:40 PMabundant-analyst-12845
02/09/2023, 2:39 PMalert-dawn-51425
02/09/2023, 4:01 PM10:57:10.41 [INFO] Completed: Building 35 requirements for klaviyo.domains.event_processing.ticketing_service.server/app.pex from the 3rdparty/python/python3-deps_lock.txt resolve: backoff==1.11.1, blinker==1.4, certifi==2022.6.15... (807 characters truncated)
10:57:10.41 [ERROR] 1 Exception encountered:
Engine traceback:
in `run` goal - environment:local
IntrinsicError: Failed to execute: Process {
argv: [
"/usr/local/bin/python",
"./pex",
"--tmpdir",
".tmp",
"--jobs",
"16",
"--pip-version",
"20.3.4-patched",
"--python-path",
"/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"--output-file",
"klaviyo.domains.event_processing.ticketing_service.server/app.pex",
"--no-emit-warnings",
"--venv",
"prepend",
"--requirements-pex",
"local_dists.pex",
"--interpreter-constraint",
"CPython==3.9.*",
"--console-script",
"gunicorn",
"--sources-directory=source_files",
"backoff==1.11.1",
"blinker==1.4",
"certifi==2022.6.15",
"charset-normalizer==2.1.0",
"click==8.0.1",
"deprecated==1.2.13",
"dumb-init==1.2.5",
"flask==2.0.1",
"googleapis-common-protos==1.56.1",
"grpcio==1.46.3",
"gunicorn==20.1.0",
"idna==3.2",
"itsdangerous==2.0.1",
"jinja2==3.0.1",
"markupsafe==2.0.1",
"opentelemetry-api==1.12.0",
"opentelemetry-exporter-otlp-proto-grpc==1.12.0",
"opentelemetry-exporter-otlp-proto-http==1.12.0",
"opentelemetry-exporter-otlp==1.12.0",
"opentelemetry-instrumentation-flask==0.33b0",
"opentelemetry-instrumentation-wsgi==0.33b0",
"opentelemetry-instrumentation==0.33b0",
"opentelemetry-proto==1.12.0",
"opentelemetry-sdk==1.12.0",
"opentelemetry-semantic-conventions==0.33b0",
"opentelemetry-util-http==0.33b0",
"protobuf==3.20.1",
"requests==2.28.1",
"sentry-sdk==0.12.3",
"six==1.16.0",
"statsd==3.3.0",
"typing-extensions==4.3.0",
"urllib3==1.26.6",
"werkzeug==2.0.1",
"wrapt==1.14.1",
"--lock",
"3rdparty/python/python3-deps_lock.txt",
"--no-pypi",
"--index=<https://pypi.org/simple/>",
"--find-links=<https://binaries.pantsbuild.org/wheels/pantsbuild.pants/0458301ee366cdd9de0513d0dce1c0ec026edbf8/2.16.0.dev6%2Bgit0458301e/index.html>",
"--manylinux",
"manylinux2014",
"--layout",
"packed",
],
env: {
"CPPFLAGS": "",
"LANG": "C.UTF-8",
"LDFLAGS": "",
"PATH": "/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin",
"PEX_IGNORE_RCFILES": "true",
"PEX_PYTHON_PATH": "/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"PEX_ROOT": ".cache/pex_root",
},
working_directory: None,
input_digests: InputDigests {
complete: DirectoryDigest {
digest: Digest {
hash: Fingerprint<37ece720d02b9894fb85bc81e1285c39894e518713ed0f93b2ec4606861262b4>,
size_bytes: 419,
},
tree: "Some(..)",
},
nailgun: DirectoryDigest {
digest: Digest {
hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>,
size_bytes: 0,
},
tree: "Some(..)",
},
input_files: DirectoryDigest {
digest: Digest {
hash: Fingerprint<37ece720d02b9894fb85bc81e1285c39894e518713ed0f93b2ec4606861262b4>,
size_bytes: 419,
},
tree: "Some(..)",
},
immutable_inputs: {},
use_nailgun: {},
},
output_files: {},
output_directories: {
RelativePath(
"klaviyo.domains.event_processing.ticketing_service.server/app.pex",
),
},
timeout: None,
execution_slot_variable: None,
concurrency_available: 35,
description: "Building 35 requirements for klaviyo.domains.event_processing.ticketing_service.server/app.pex from the 3rdparty/python/python3-deps_lock.txt resolve: backoff==1.11.1, blinker==1.4, certifi==2022.6.15, charset-normalizer==2.1.0, click==8.0.1, deprecated==1.2.13, dumb-init==1.2.5, flask==2.0.1, googleapis-common-protos==1.56.1, grpcio==1.46.3, gunicorn==20.1.0, idna==3.2, itsdangerous==2.0.1, jinja2==3.0.1, markupsafe==2.0.1, opentelemetry-api==1.12.0, opentelemetry-exporter-otlp-proto-grpc==1.12.0, opentelemetry-exporter-otlp-proto-http==1.12.0, opentelemetry-exporter-otlp==1.12.0, opentelemetry-instrumentation-flask==0.33b0, opentelemetry-instrumentation-wsgi==0.33b0, opentelemetry-instrumentation==0.33b0, opentelemetry-proto==1.12.0, opentelemetry-sdk==1.12.0, opentelemetry-semantic-conventions==0.33b0, opentelemetry-util-http==0.33b0, protobuf==3.20.1, requests==2.28.1, sentry-sdk==0.12.3, six==1.16.0, statsd==3.3.0, typing-extensions==4.3.0, urllib3==1.26.6, werkzeug==2.0.1, wrapt==1.14.1",
level: Info,
append_only_caches: {
CacheName(
"pex_root",
): RelativePath(
".cache/pex_root",
),
},
jdk_home: None,
platform: Linux_x86_64,
cache_scope: Successful,
execution_strategy: Docker(
"sha256:a037112b1932d8a1e40b606c914630e9517680424b837155ee45a101c1fbb04f",
),
remote_cache_speculation_delay: 0ns,
}
Failed to create Docker execution in container: DockerResponseServerError { status_code: 404, message: "No such container: 1e7c691a4c12e4a3d5128a360085eb500eda991fa0db1fbc4af7ad61aea56296" }
cold-branch-54016
02/09/2023, 4:33 PMfix
goal does not exit with 1
in case it fixed something. Is this intended behaviour? The lint
goal does behave differently here.
We have configured the following alias
valid = "tailor --check fix lint check"
Which we also use in our CI pipeline. Since the fix
goal fixes everything before the lint
goal runs and it does not exit with 1
we did not notice some style issues on some of our PRs.happy-kitchen-89482
02/09/2023, 4:58 PMfix
vs fmt
. Can someone remind me what's up with that?happy-kitchen-89482
02/09/2023, 5:56 PMcurved-microphone-39455
02/09/2023, 6:30 PMfiles
dependencies, I use a generic kind of import all for my Docker Image
files(
name="files",
sources=[
"project/**/*",
"**/*.py",
"poetry.lock",
"pyproject.toml",
"README.md",
"!tests/",
],
)
docker_image(
name="docker",
dependencies=[
":files",
[...]
without this, I am missing several files of all kinds during the Packaging of my Docker image, but when I remove this dependency, the tailor ::
command works again correctly. Is there a way to disable for certain targets dependencies ? I have tested almost all options on the tailor stuff and options in my pants.toml
I guess this is not ideal to do an import all with files but need a generic solution to build my docker image over ~20 micro services in a mono repo + multiples libraries. Any ideas?broad-processor-92400
02/09/2023, 8:15 PM[environments-previews.names] foo = "//:foo
with some_target(..., environment="foo")
could, naively, be collapsed to some_target(..., environment="//:foo")
without needing the duplication in `pants.toml`; am I missing something?high-yak-85899
02/09/2023, 8:48 PMsphinx.application.Sphinx
in a script (I know a bit different use than normal). I'd like to do this with Pants, but it can't find sphinxcontrib-serializinghtml
. This is a transitive dependency of sphinx
. Are there any options other than adding that transitive dependency to my requirements.txt
?cool-yacht-37128
02/09/2023, 9:42 PM