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

Procfile parsing doesn't separate command from arguments #347

Open
3 of 6 tasks
glasnt opened this issue Oct 2, 2023 · 1 comment
Open
3 of 6 tasks

Procfile parsing doesn't separate command from arguments #347

glasnt opened this issue Oct 2, 2023 · 1 comment
Labels
kind/bug Something isn't working

Comments

@glasnt
Copy link

glasnt commented Oct 2, 2023

Describe the bug

If use a Procfile to declare a complex command, I would expect that the first token would be the command and the rest be arguments. This would allow me to define default behaviour, but then allow me to customise arguments in later invocations.

However, it appears that there is no tokenization of the commands in entrypoint parsing.

Example:

app.py (chmod +x):

#!/usr/bin/env python
import sys
print(f"Invocation: {', '.join(sys.argv)} (len = {len(sys.argv)})")

Testing a single command as the process definition:

web: ./app.py
$ pack build single --path .
...
$ docker run single
Invocation: ./app.py (len = 1)
$ docker run single more args
Invocation: ./app.py, more, args (len = 3)
$ pack inspect single

Processes:
  TYPE                 SHELL        COMMAND        ARGS
  web (default)        bash         ./app.py

But changing this process entrypoint to something more complex:

web: python app.py
$ pack build single --path .
...
$ docker run double
Invocation: app.py (len = 1)
python app.py: python app.py: command not found
$ pack inspect double
Processes:
  TYPE                 SHELL        COMMAND        ARGS
  web (default)        bash         python app.py

I know I can use the launcher entrypoint to define a completely new set of command and args, but I'd rather be able to just append args to my invocation.

(I'm currently encountering this using google cloud buildpack images in Cloud Build steps, but also (yet to confirm) Cloud Run jobs)

From current codebase:

https://github.com/GoogleCloudPlatform/buildpacks/blob/main/cmd/config/entrypoint/main_test.go#L90
implies the process is parsed into just a command

https://github.com/GoogleCloudPlatform/buildpacks/blob/main/pkg/gcpbuildpack/gcpbuildpack_test.go#L329
implies the process is separated into 1 command and N arguments

Additional context

How are you using GCP buildpacks?

  • pack and the gcr.io/buildpacks/builder
  • Cloud Functions
  • Cloud Run + Cloud Run Jobs
  • Cloud Build (replicated, but requires pack build --workspace /app (additional bug))
  • App Engine Standard
  • App Engine Flex

What language is your project primarily written in?

Python

@glasnt glasnt added the kind/bug Something isn't working label Oct 2, 2023
@JanakaSandaruwan
Copy link

Is there any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants