-
Notifications
You must be signed in to change notification settings - Fork 71
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
RFC: Combine and organize metadata file locations across lifecycle #145
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sambhav Kothari <[email protected]>
…proach Signed-off-by: Sambhav Kothari <[email protected]>
I updated the rfc with the sub-directory proposal instead of the prefix one as discussed in the last WG meeting. |
This makes it sound like the sub-directory structure would be the primary idea but I'm still seeing prefixes as the primary proposal. Am I missing something? |
Urgh - I think I forgot to push. Should be fixed now. |
Really like the directory restructure. The term |
Signed-off-by: Sambhav Kothari <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the structure change.
|
Capturing a discussion from WG, Stephen proposed:
Elaborating on this idea and digging the details we would need to work out: current directory structure:
Assuming we want to reusing the existing layers volume for the new files instead of introducing a new required volume, I think these are the possible future directory structures?
pros:
Option 2:
pros:
In the above examples names of specific directories or env vars could change. E.g:
But I think the overall structures represent the two obvious options. Other possibilities that I won't take as much time to elaborate on:
|
I'm +1 on @ekcasey's "option 1". I'm also fine with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bikeshed
text/0000-layer-metadata-files.md
Outdated
│ └── plan.toml | ||
│ └── report.toml | ||
├── layers (configurable with `CNB_LAYERS_DIR` or -layers) | ||
│ └── new-buildpack (`CNB_BP_LAYERS_DIR`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since CNB_BP_LAYERS_DIR
is used more often than CNB_LAYERS_DIR
, could we pick a shorter name for the former?
Maybe something like:
CNB_ALL_LAYERS_DIR
for/workspace/layers
CNB_ALL_CONFIG_DIR
for/workspace/layers-config
CNB_LAYERS_DIR
for/workspace/layers/<buildpack-id>
CNB_CONFIG_DIR
for/workspace/layers-config/<buildpack-id>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a minor concern with using CNB_LAYERS_DIR
for CNB_BP_LAYERS_DIR
since the former is already a config var for /layers
. We would be moving CNB_LAYERS_DIR
from a platform env var to a buildpack env var, which feels a bit weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. Maybe CNB_ALL_LAYER_DIR
and CNB_LAYER_DIR
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still like CNB_BP_LAYERS_DIR
for its obviousness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the buildpack's layers dir is provided to it as a positional arg
/bin/build <layers[EIC]> <platform[AR]> <plan[ER]>, Working Dir: <app[AI]>
Are we proposing replacing all positional args in the buildpack API with environment variables as part of that RFC? J I think that is a good idea but it's a big enough change that I think we should call this out explicitly in a separate section and provide the names for the env vars that will replace the plan and platform arguments as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go with CNB_BP_LAYERS_DIR
should we switch from CNB_BUILDPACK_DIR
to CNB_BP_DIR
for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to change them to _BUILDPACK_
to match CNB_BUILDPACK_DIR
. They are long, but explicit and match our current standards that buildpacks are already built against.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekcasey I would prefer to not tackle the positional argument changes in this RFC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we aren't switching from position arguments to environment variables then I am unsure what CNB_BUILDPACK_LAYERS_DIR
is referring to above. The layers dir is currently a positional argument and nobody would be setting or reading this environment variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if we are introducing at least one environment variable CNB_BUILDPACK_CONFIG_DIR
it does seem to me like an appropriate time to convert the rest (just for the sake of internal consistency).
├── plan.toml | ||
├── order.toml (written by a platform, optionally) | ||
├── report.toml | ||
├── <escaped_buildpack_id> (buildpack arg `$1`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For new buildpacks running on the old platform, do we set CNB_BP_CONFIG_DIR
equal to CNB_BP_LAYERS_DIR
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would need to.
text/0000-layer-metadata-files.md
Outdated
│ └── plan.toml | ||
│ └── report.toml | ||
├── layers (configurable with `CNB_LAYERS_DIR` or -layers) | ||
│ └── new-buildpack (`CNB_BP_LAYERS_DIR`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go with CNB_BP_LAYERS_DIR
should we switch from CNB_BUILDPACK_DIR
to CNB_BP_DIR
for consistency?
Changes based on feedback Signed-off-by: Jesse Brown <[email protected]>
Signed-off-by: Jesse Brown <[email protected]>
73a97d3
to
069ae1e
Compare
│ └── lifecycle (configurable with `CNB_LIFECYCLE_CONFIG_DIR`) | ||
│ ├── analyzed.toml | ||
│ ├── group.toml | ||
│ ├── plan.toml | ||
│ └── report.toml | ||
│ └── platform (configurable with `CNB_PLATFORM_CONFIG_DIR`) | ||
│ ├── order.toml (written by a platform, optionally - prior to `lifecycle` execution) | ||
└ └── project-metadata.toml (written by a platform, optionally - prior to `lifecycle` execution, configurable with `CNB_PROJECT_METADATA_PATH`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this make sense to go in the platform directory? In talking through buildpacks/pack#1221 it seems like it could be helpful for the platform to mount a directory where it could provide configuration and receive output.
│ └── <layer> | ||
├── config | ||
│ └── layers (configurable with `CNB_LAYERS_CONFIG_DIR`) | ||
│ ├── metadata.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a child of config
?
Putting on the backburner for now due to other active RFCs. |
Maintainers, As you review this RFC please queue up issues to be created using the following commands:
Issues(none) |
@natalieparellano suggested of pairing this with deprecation of other APIs. |
│ └── <layer> | ||
└── config | ||
└── metadata.toml | ||
/workspace (configurable with `CNB_APP_DIR ` or -app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to change the default location for the app from /workspace
to /app
. Could we incorporate that change into this RFC too?
Readable
It's my first time creating an rfc so not sure if I did everything right here.