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

Remove shell-specific logic from Buildpack API #305

Merged
merged 10 commits into from
Aug 15, 2022
Merged

Remove shell-specific logic from Buildpack API #305

merged 10 commits into from
Aug 15, 2022

Conversation

mboldt
Copy link
Contributor

@mboldt mboldt commented Apr 15, 2022

Per RFC 0093.

Closes #244

Signed-off-by: Mikey Boldt [email protected]

@mboldt mboldt requested a review from a team as a code owner April 15, 2022 18:37
buildpack.md Show resolved Hide resolved
buildpack.md Show resolved Hide resolved
buildpack.md Show resolved Hide resolved
buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated
[†](README.md#linux-only)When executing a process using any execution strategy, the lifecycle SHOULD replace the lifecycle process in memory without forking it.

[†](README.md#linux-only)When executing a process with Bash, the lifecycle SHOULD additionally replace the Bash process in memory without forking it.
1. The lifecycle MUST use the `execve` syscall to invoke the command with its arguments, environment, and working directory following the process outlined in the [Platform Interface Specification](platform.md).
Copy link
Member

Choose a reason for hiding this comment

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

The platform spec says:

MUST execute the selected process as specified in the Buildpack Interface Specfication

So I think something needs to change in the platform spec at least? But maybe we want a little more here? A potential division of details

Platform Spec describes:

  • selection of user-defined process vs buildpack-defined process

  • syntax for overriding args

Buildpack spec:

  • Says that in the buildpack-defined process case: command+args will be executed but that args may be overridden with user provided args at the platform's discretion (basically what you have in the data format section below but moved up here so it's easier to find?)

Copy link
Member

Choose a reason for hiding this comment

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

Would it be worth having a section for the process definition interface? Similar to what we have for exec.d?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. tl;dr: I agree with the above, and I think we should:

  • consolidate the execution details in platform spec, without pointer back to buildpack spec.
  • add a table here with the command/args distinction.
  • note here (maybe a footnote in the table) that it's at the platform's discretion.

Some more color:

I don't think the platform spec should point back to the buildpack spec about execution. The buildpack can express intention, but it is really up to the platform spec how to execute. Perhaps that is the main message that should go here...this is what these things mean, but it is up to the platform to execute.

For example, in implementing this RFC, when we change command from a string to a list of strings, platforms with API < 0.10 won't know that some args are override-able (args) and some aren't (command[1:]), as there is no way to express this distinction in the current metadata.toml format. (I walked through this in almost absurd detail in this miro board: https://miro.com/app/board/uXjVO8dPGUU=/?share_link_id=509704965141 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took a shot at these items if you'd like to give it another pass.

Copy link
Member

Choose a reason for hiding this comment

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

Love the table @mboldt 🎉 the absurd level of detail would be great for our docs! Maybe in the migration guide?

buildpack.md Outdated Show resolved Hide resolved
@ekcasey
Copy link
Member

ekcasey commented Apr 27, 2022

sorry, not sure why github doubled all my comments :/

resolving the dupes...

Copy link
Member

@samj1912 samj1912 left a comment

Choose a reason for hiding this comment

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

This generally LGTM. Would like to see more details around the execution details as @ekcasey mentioned.

I think we should also make it clear from a BP Author's perspective on

what happens when they specify things in the command array v/s args array and how it interpolates with the user provided args (either via docker or k8s)

@samj1912 samj1912 requested review from a team May 25, 2022 21:10
buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated
- The first element of `command` is a path to an executable or the file name of an executable in `$PATH`.
- Any remaining elements of `command` are arguments that are always passed directly to the executable.
- MAY specify an `args` list to be passed directly to the specified executable, after arguments specified in `command`.
- The `args` list is a default list of arguments that may be overridden by the user.
Copy link
Member

Choose a reason for hiding this comment

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

Can there be a pointer here back to the platform spec? I think that would address @samj1912's comment here: #305 (review)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something like this? b9e6e34

@natalieparellano
Copy link
Member

@mboldt nice work! I left a couple comments but in general this LGTM

buildpack.md Outdated
Comment on lines 202 to 208
| Field | Type | Definition |
|---------------|-----------------|----------------------------------------------------------------------------------------------|
| `type` | String | An identifier for the process |
| `command` | Array of string | The command to execute, followed by arguments that should always be provided [^command-args] |
| `args` | Array of string | Default arguments to the command that can be overridden by the user |
| `default` | Boolean | If `true`, use this as the default process for the app image |
| `working-dir` | Path | Working directory for this process in the app image |
Copy link
Member

Choose a reason for hiding this comment

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

This information is somewhat duplicated in the launch.toml section below. I wonder if we could consolidate it in one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consolidated in launch.toml section in de2636c

buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated Show resolved Hide resolved
mboldt and others added 9 commits July 15, 2022 15:55
Closes #244

Signed-off-by: Mikey Boldt <[email protected]>
Signed-off-by: Mikey Boldt <[email protected]>
Co-authored-by: Natalie Arellano <[email protected]>
Signed-off-by: Mikey Boldt <[email protected]>
Co-authored-by: Natalie Arellano <[email protected]>
Signed-off-by: Mikey Boldt <[email protected]>
Co-authored-by: Natalie Arellano <[email protected]>
Signed-off-by: Mikey Boldt <[email protected]>
Co-authored-by: Natalie Arellano <[email protected]>
Signed-off-by: Mikey Boldt <[email protected]>
@natalieparellano
Copy link
Member

I believe this PR has all the required approvals. Can we merge it in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants