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 and update related command/arg handling #306

Closed
wants to merge 14 commits into from
Closed

Remove shell-specific logic and update related command/arg handling #306

wants to merge 14 commits into from

Conversation

mboldt
Copy link
Contributor

@mboldt mboldt commented Apr 15, 2022

Per RFC 0093.

Closes #245

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

@mboldt mboldt requested a review from a team as a code owner April 15, 2022 18:49
@mboldt mboldt marked this pull request as draft April 18, 2022 20:36
platform.md Show resolved Hide resolved
# OR
/cnb/lifecycle/launcher [--] [<cmd> <arg>...]
/cnb/lifecycle/launcher [<cmd> <args>...]
Copy link
Member

Choose a reason for hiding this comment

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

This is a very significant end user change. We should be careful around this since users won't be able to control this. How do you imagine this working in general since processes are global and not buildpack specific? Would processes contributed by the older buildpack apis still allow for the old launcher approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I do expect process types contributed by older buildpack APIs to maintain the old launcher approach (that is, allowing direct=false to spawn using a shell), with the caveat that the launcher will not source .profile scripts (though we will develop the .profile buildpack and systems buildpack feature to avoid platform regressions for that). I did not have this in my first commit here, but should be there now.

I will review/refresh my thinking on the buildpack -> launch.toml -> metadata.toml -> launcher to make sure it lines up without the connection from the global process in metadata.toml back to the buildpack API version. I think this is part of the concern you're expressing. Let me know if I misread.

(Note, I think you're speaking more generally here as opposed to just the couple lines that this comment got associated with...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reviewing, the platform can link the launch.toml to its buildpack, and set direct in metadata.toml appropriately. I wrote out an almost-ridiculous number of permutations to get my head straight around this, if you want to take a look: https://miro.com/app/board/uXjVO8dPGUU=/

@mboldt mboldt marked this pull request as ready for review June 2, 2022 19:58
platform.md Outdated Show resolved Hide resolved
platform.md Outdated Show resolved Hide resolved
platform.md Outdated Show resolved Hide resolved
Comment on lines +777 to +780
- **If** `<direct>` is `true`
- MUST invoke the command `<cmd>` with its arguments `<args>`, environment `<env>`, and working directory `<working-dir>`.
- **Else** `<direct>` is `false`, and
- MUST invoke the command `<cmd>` using a shell with its arguments `<args>`, environment `<env>`, and working directory `<working-dir>`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- **If** `<direct>` is `true`
- MUST invoke the command `<cmd>` with its arguments `<args>`, environment `<env>`, and working directory `<working-dir>`.
- **Else** `<direct>` is `false`, and
- MUST invoke the command `<cmd>` using a shell with its arguments `<args>`, environment `<env>`, and working directory `<working-dir>`.
- MUST invoke the command `<cmd>` with its arguments `<args>`, environment `<env>`, and working directory `<working-dir>`.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is right... right? You can't have a direct process if it wasn't defined by a buildpack on an older buildpack api.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It think we need to consider both here...I updated the indentation in 493bb4a to try to show the intention.

Basically, above this part we define how to set direct, and here we describe what needs to happen based on the value of direct. Does that make sense?

platform.md Outdated Show resolved Hide resolved
@natalieparellano
Copy link
Member

@mboldt left a couple of suggestions. I think we'd want to update #306 (comment) so that it's accurate, but otherwise this looks pretty good to me.

mboldt and others added 14 commits June 13, 2022 19:43
Signed-off-by: Mikey Boldt <[email protected]>
We still need it for older Buildpack API versions.

Signed-off-by: Mikey Boldt <[email protected]>
They get combined into command in the new metadata.toml format.

Signed-off-by: Mikey Boldt <[email protected]>
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]>
@samj1912
Copy link
Member

I have approved the related Buildpack API changes. But as discussed in WG the launcher changes have user facing impact and we probably want to hold off on this for now?

@natalieparellano natalieparellano marked this pull request as draft July 28, 2022 14:34
@mboldt mboldt closed this by deleting the head repository Sep 26, 2022
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.

3 participants