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

Update buildpack spec for RFC-0042 #98

Merged
merged 8 commits into from
Jul 8, 2020
Merged

Update buildpack spec for RFC-0042 #98

merged 8 commits into from
Jul 8, 2020

Conversation

jkutner
Copy link
Member

@jkutner jkutner commented Jun 24, 2020

Fixes #90

Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jkutner jkutner requested review from jabrown85 and a team June 24, 2020 21:50
buildpack.md Outdated

##### Default

If the environment variable file name ends in `.default`, then the value of the environment variable MUST only be the file contents if the environment variable is empty.
For that environment variable value,
- Earlier buildpacks' environment default variable file contents MUST override later buildpacks' environment variable file contents.
- For default environment variable file contents originating from the same buildpack, file contents that are earlier (when sorted alphabetically ascending by associated layer name) MUST override file contents that are later.
- Default environment variable file contents originating in the same layer MUST be sorted such that file contents in `<layers>/<layer>/env/` override file contents in `<layers>/<layer>/env.build/` or `<layers>/<layer>/env.launch/`.
- **Default environment variable file contents originating in the same layer MUST be sorted such that file contents in `<layers>/<layer>/env/` override file contents in `<layers>/<layer>/env.build/` or `<layers>/<layer>/env.launch/` which override file contents in `<layers>/<layer>/env.launch/<process>/`.**
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 one is backwards (both here and in the current spec). Wouldn't we want defaults from the more specific case to override the more general case?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. The whole idea is to set something only if nothing is already set. It seems to me that a single layer attempting to set the default would be expecting the most specific default to win.

Copy link
Member

Choose a reason for hiding this comment

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

paging at @sclevine

Copy link
Member

Choose a reason for hiding this comment

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

I originally thought this was inaccurate. After talking with @sclevine I realize it is accurate. If we wanted to change this behavior for default env vars I think that would be separate conversation and doesn't need to happen as part of this PR.

Copy link
Member

Choose a reason for hiding this comment

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

@ekcasey is there a tl;dr from your discussion with Stephen?

Copy link
Member

Choose a reason for hiding this comment

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

TLDR: This is how it works today. Setting multiple defaults is a bit of a weird edge case anyways. It would be slightly complicated to change b/c of the current implementation (the current behavior is easy/natural given the order in which we process env dirs). But we certainly could change it if we were motivated.

I feel strongly that any discussion of changing this behavior should be decoupled from the process-specific env vars discussion.

@ekcasey ekcasey changed the base branch from main to buildpack/0.3 June 25, 2020 14:30
@ekcasey
Copy link
Member

ekcasey commented Jun 25, 2020

@jkutner I repointed this PR at the buildpack/0.3 branch

@ekcasey ekcasey added this to the Buildpack 0.3 milestone Jun 25, 2020
@nebhale nebhale changed the base branch from buildpack/0.3 to extensions/buildpack-registry/0.1 June 26, 2020 20:12
@nebhale nebhale changed the base branch from extensions/buildpack-registry/0.1 to buildpack/0.3 June 26, 2020 20:13
@nebhale nebhale requested a review from a team June 26, 2020 20:14
@nebhale nebhale requested a review from a team June 26, 2020 20:20
Copy link
Member

@hone hone left a comment

Choose a reason for hiding this comment

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

Did you mean to leave out env.build in the Prepend section?

buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated Show resolved Hide resolved
jkutner and others added 2 commits June 30, 2020 21:15
Signed-off-by: Joe Kutner <jpkutner@gmail.com>

Co-authored-by: Terence Lee <hone02@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jkutner
Copy link
Member Author

jkutner commented Jul 1, 2020

@jabrown85 can you take a second look at this and confirm it matches the implementation you're working on?

jabrown85 added a commit to buildpacks/lifecycle that referenced this pull request Jul 1, 2020
Include process type specific paths when processing env vars during launch.

Spec: buildpacks/spec#98

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
jabrown85 added a commit to buildpacks/lifecycle that referenced this pull request Jul 1, 2020
Include process type specific paths when processing env vars during launch.

Spec: buildpacks/spec#98

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
@ekcasey
Copy link
Member

ekcasey commented Jul 1, 2020

@jkutner @jabrown85 Seems like RFC-0042 includes process-specific profile scripts in addition to env vars. Are you going to make a separate PR for that or should it be added to this one?

@jabrown85
Copy link
Contributor

@ekcasey good question. What would you rather me do? I don't mind adding another commit here or another PR.

jabrown85 added a commit to buildpacks/lifecycle that referenced this pull request Jul 1, 2020
Include process type specific paths when processing env vars during launch.

Spec: buildpacks/spec#98

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
jabrown85 added a commit to buildpacks/lifecycle that referenced this pull request Jul 1, 2020
Include process type specific paths when processing env vars during launch.

Spec: buildpacks/spec#98

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
@nebhale nebhale requested review from hone and a team July 1, 2020 18:14
@ekcasey
Copy link
Member

ekcasey commented Jul 1, 2020

good question. What would you rather me do? I don't mind adding another commit here or another PR.

Either is fine with me. Given the title of the PR I lean towards just adding another commit.

jabrown85 added a commit to buildpacks/lifecycle that referenced this pull request Jul 1, 2020
Include process type specific paths when processing profile.d scripts during launch.

Spec: buildpacks/spec#98

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
jabrown85 added a commit to buildpacks/lifecycle that referenced this pull request Jul 2, 2020
Include process type specific paths when processing profile.d scripts during launch.

Spec: buildpacks/spec#98

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
nebhale added a commit to buildpacks/libcnb that referenced this pull request Jul 2, 2020
This change adds support for Process-specific environment variables and
profile.d scripts.

[RFC 42][buildpacks/spec#98][buildpacks/lifecycle#327]

Signed-off-by: Ben Hale <bhale@vmware.com>
buildpack.md Outdated Show resolved Hide resolved
Signed-off-by: Joe Kutner <jpkutner@gmail.com>

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
@nebhale nebhale merged commit b8d0fef into buildpack/0.3 Jul 8, 2020
@nebhale nebhale deleted the rfc-0042 branch July 8, 2020 18:25
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.

Specify process specific env vars
6 participants