pex.pex_builder.InvalidExecutableSpecification: Co...
# general
a
pex.pex_builder.InvalidExecutableSpecification: Could not find script 'dagster api grpc --use-python-environment-entry-point -h 0.0.0.0 -p 4321 -f ./jobs/repository.py' in any distribution within PEX!
h
Hi, can you provide more details on what you're trying to do, what command you're running, what the inputs (e.g., requirements.txt) are?
That error indicates that you're trying to build a PEX with an entry point that is the shell command line
dagster api grpc --use-python-environment-entry-point -h 0.0.0.0 -p 4321 -f ./jobs/repository.py
, which is not possible to do. An entry point needs to point to something inside the pex.
a
hi
python_sources() # BUILD #pex_binary( # entry_point="dagster", # execution_mode="venv", ##script="dagster api grpc --use-python-environment-entry-point -h 0.0.0.0 -p 4321 -f ./jobs/repository.py", #)
An entry point needs to point to something inside the pex. Can you give me an example how?
h
script
would be something like
script="dagster"
, not all those args after. Then you would run it like
./pants run path/to:dagster -- api grpc --use-python
And you probably need to explicitly add a dependency on your
python_requirement
target for
dagster
, something like
Copy code
pex_binary(
   dependencies=["3rdparty/python#dagster"],
   ...
)
(adjust the address for where you have your requirements.txt)
a
thanks eric the PEX file I need is of the dagster gRPC server [10:31 AM] After changing to script i am getting this error [10:31 AM] pex.pex_builder.InvalidExecutableSpecification: Could not find script 'dagster api grpc --use-python-environment-entry-point -h 0.0.0.0 -p 4321 -f ./jobs/repository.py' in any distribution within PEX!
h
Yes, because you're using the
script
as the whole list of arguments. It should just be
script="dagster"
a
gotcha .... thanks eric
h
fyi I opened https://github.com/pantsbuild/pants/issues/15765 based on this feedback
👍 1
a
And you probably need to explicitly add a dependency on your
python_requirement
target for
dagster
, something like
Copy code
pex_binary(
   dependencies=["3rdparty/python#dagster"],
   ...
)
But i have already specified dependencies elsewhere throughout pants via poetry
Hi Eric
Made those changes And got this : Traceback (most recent call last): File "/root/.cache/pants/named_caches/pex_root/unzipped_pexes/49dbdad484000b38e63ed8b7458f5be5bed153a4/.bootstrap/pex/pex.py", line 504, in execute exit_value = self._wrap_coverage(self._wrap_profiling, self._execute) File "/root/.cache/pants/named_caches/pex_root/unzipped_pexes/49dbdad484000b38e63ed8b7458f5be5bed153a4/.bootstrap/pex/pex.py", line 409, in _wrap_coverage return runner(*args) File "/root/.cache/pants/named_caches/pex_root/unzipped_pexes/49dbdad484000b38e63ed8b7458f5be5bed153a4/.bootstrap/pex/pex.py", line 440, in _wrap_profiling return runner(*args) File "/root/.cache/pants/named_caches/pex_root/unzipped_pexes/49dbdad484000b38e63ed8b7458f5be5bed153a4/.bootstrap/pex/pex.py", line 560, in _execute return self.execute_entry(self._pex_info.entry_point) File "/root/.cache/pants/named_caches/pex_root/unzipped_pexes/49dbdad484000b38e63ed8b7458f5be5bed153a4/.bootstrap/pex/pex.py", line 696, in execute_entry return self.execute_pkg_resources(entry_point) File "/root/.cache/pants/named_caches/pex_root/unzipped_pexes/49dbdad484000b38e63ed8b7458f5be5bed153a4/.bootstrap/pex/pex.py", line 728, in execute_pkg_resources return runner() File "/root/.cache/pants/named_caches/pex_root/installed_wheels/81c06b5d43e95626f8e7265d8d9bc14ffa7e43206ab96e13882aad4c45dbe099/pex-2.1.80-py2.py3-none-any.whl/pex/bin/pex.py", line 760, in main do_main( File "/root/.cache/pants/named_caches/pex_root/installed_wheels/81c06b5d43e95626f8e7265d8d9bc14ffa7e43206ab96e13882aad4c45dbe099/pex-2.1.80-py2.py3-none-any.whl/pex/bin/pex.py", line 781, in do_main pex_builder = build_pex( File "/root/.cache/pants/named_caches/pex_root/installed_wheels/81c06b5d43e95626f8e7265d8d9bc14ffa7e43206ab96e13882aad4c45dbe099/pex-2.1.80-py2.py3-none-any.whl/pex/bin/pex.py", line 706, in build_pex pex_builder.set_script(options.script) File "/root/.cache/pants/named_caches/pex_root/installed_wheels/81c06b5d43e95626f8e7265d8d9bc14ffa7e43206ab96e13882aad4c45dbe099/pex-2.1.80-py2.py3-none-any.whl/pex/pex_builder.py", line 369, in set_script raise self.InvalidExecutableSpecification( pex.pex_builder.InvalidExecutableSpecification: Could not find script 'dagster' in any distribution within PEX! Use
--no-process-cleanup
to preserve process chroots for inspection.
Exception :raise self.InvalidExecutableSpecification( pex.pex_builder.InvalidExecutableSpecification: Could not find script 'dagster' in any distribution within PEX!