From 8ef0a623b82351593b1a1bd80ae4135268924d8b Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Thu, 1 Apr 2021 13:03:15 +0100 Subject: [PATCH 01/53] Add builder to the project descriptor specification Signed-off-by: Sambhav Kothari --- extensions/project-descriptor.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 83531a7c..6d5e9fe4 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -9,10 +9,11 @@ A project descriptor is a file that MAY contain configuration for apps, services - [Table of Contents](#table-of-contents) - [Schema](#schema) - [`[project]`](#project) - - [`[[project.licenses]]`](#projectlicenses) - - [`[build.include]` and `[build.exclude]`](#buildinclude-and-buildexclude) - - [`[[build.buildpacks]]`](#buildbuildpacks) - - [`[[build.env]]`](#buildenv) + - [`[[project.licenses]]`](#projectlicenses) + - [`[build]`](#build) + - [`[build.include]` and `[build.exclude]`](#buildinclude-and-buildexclude) + - [`[[build.buildpacks]]`](#buildbuildpacks) + - [`[[build.env]]`](#buildenv) - [`[metadata]`](#metadata) - [Example](#example) @@ -34,6 +35,7 @@ type = "" uri = "" [build] +builder = "" include = [""] exclude = [""] [[build.buildpacks]] @@ -69,16 +71,22 @@ version = "" * `documentation-url` - (optional) a URL to the documentation for the project * `source-url` - (optional) a URL to the source code for the project -## `[[project.licenses]]` +### `[[project.licenses]]` An optional list of project licenses. * `type` - This MAY use the [SPDX 2.1 license expression](https://spdx.org/spdx-specification-21-web-version), but is not limited to identifiers in the [SPDX Licenses List](https://spdx.org/licenses/). * `uri` - If this project is using a nonstandard license, then this key MAY be specified in lieu of or in addition to `type` to point to the license. -## `[build.include]` and `[build.exclude]` +## `[build]` -A optional list of files to include in the build (while excluding everything else): +The top-level `[build]` table MAY contain configuration about how to build the project. It MAY include the following keys and others defined below in their individual sub-sections - + +* `builder` - (optional) the builder image to use (ex. "cnbs/sample-builder:bionic") + +### `[build.include]` and `[build.exclude]` + +An optional list of files to include in the build (while excluding everything else): ```toml [build] @@ -101,11 +109,11 @@ exclude = [ The `.gitignore` pattern is used in both cases. The `exclude` and `include` keys are mutually exclusive, and if both are present the Lifecycle will error out. -Any files that are excluded (either via `include` or `exclude`) MUST BE excluded before the build (i.e. not only exluded from the final image). +Any files that are excluded (either via `include` or `exclude`) MUST BE excluded before the build (i.e. not only excluded from the final image). If both `exclude` and `include` are defined, the build process MUST result in an error. -## `[[build.buildpacks]]` +### `[[build.buildpacks]]` The build table MAY contain an array of buildpacks. The schema for this table is: @@ -120,7 +128,7 @@ This defines the buildpacks that a platform should use on the repo. Either an `id` or a `uri` MUST be included, but MUST NOT include both. If `uri` is provided, `version` MUST NOT be allowed. -## `[[build.env]]` +### `[[build.env]]` Used to set environment variables at build time, for example: @@ -147,6 +155,7 @@ id = "io.buildpacks.my-app" version = "0.1" [build] +builder = "cnbs/sample-builder:bionic" include = [ "cmd/", "go.mod", From 4fd34a17e1e7838a565c2514e1a5e4e2fbfb5d55 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Mon, 26 Apr 2021 15:37:02 -0700 Subject: [PATCH 02/53] add Project Descriptor Reverse Domain RFC Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 136 +++++++++++++++++++------------ 1 file changed, 83 insertions(+), 53 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 6d5e9fe4..e2b2fcff 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -8,21 +8,29 @@ A project descriptor is a file that MAY contain configuration for apps, services - [Project Descriptor](#project-descriptor) - [Table of Contents](#table-of-contents) - [Schema](#schema) - - [`[project]`](#project) - - [`[[project.licenses]]`](#projectlicenses) - - [`[build]`](#build) + - [`[_]`](#_) + - [`[_]`](#_-1) + - [`[[_.licenses]]`](#_licenses) + - [`[_.metadata]`](#_metadata) + - [Non-`[_]` Tables](#non-_-tables) + - [`[io.buildpacks]`](#iobuildpacks) + - [`[io.buildpacks.build.include]` and `[io.buildpacks.build.exclude]`](#iobuildpacksbuildinclude-and-iobuildpacksbuildexclude) - [`[build.include]` and `[build.exclude]`](#buildinclude-and-buildexclude) - - [`[[build.buildpacks]]`](#buildbuildpacks) - - [`[[build.env]]`](#buildenv) - - [`[metadata]`](#metadata) + - [`[[io.buildpacks.build.buildpacks]]`](#iobuildpacksbuildbuildpacks) + - [`[[io.buildpacks.build.env]]`](#iobuildpacksbuildenv) - [Example](#example) ## Schema -The TOML schema of the project descriptor is the following: +### `[_]` + +API Version: `0.2` + +The TOML schema of the project section of the project descriptor: ```toml -[project] +[_] +api = "" id = "" # machine readable name = "" # human readable version = "" @@ -30,40 +38,32 @@ authors = [""] documentation-url = "" source-url = "" -[[project.licenses]] +[[_.licenses]] type = "" uri = "" -[build] -builder = "" -include = [""] -exclude = [""] -[[build.buildpacks]] -id = "" -version = "" -uri = "" -[[build.env]] -name = "" -value = "" -[metadata] +[_.metadata] # additional arbitrary keys allowed ``` The following sections describe each part of the schema in detail. -## `[project]` - -The top-level `[project]` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. +#### `[_]` -The `project.id` +The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `api` to denote which version of this API the descriptor is using. ```toml -[project] +[_] +api = "" id = "" name = "" version = "" +authors = [""] +documentation-url = "" +source-url = "" ``` +* `api` - version identifier for the schema of the `_` table and structure of the project descriptor file. This version format follows the rules of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). * `id` - (optional) the machine readable identifier of the project (ex. "com.example.myservice") * `name` - (optional) the human readable name of the project (ex. "My Example Service") * `version` - (optional) and arbitrary string representing the version of the project @@ -71,14 +71,53 @@ version = "" * `documentation-url` - (optional) a URL to the documentation for the project * `source-url` - (optional) a URL to the source code for the project -### `[[project.licenses]]` +#### `[[_.licenses]]` An optional list of project licenses. * `type` - This MAY use the [SPDX 2.1 license expression](https://spdx.org/spdx-specification-21-web-version), but is not limited to identifiers in the [SPDX Licenses List](https://spdx.org/licenses/). * `uri` - If this project is using a nonstandard license, then this key MAY be specified in lieu of or in addition to `type` to point to the license. -## `[build]` + +#### `[_.metadata]` + +Keys in this table are not validated and can be used by users. + +```toml +[_.metadata.foo] +checksum = "a28a0d7772df1f918da2b1102da4ff35" +``` + +### Non-`[_]` Tables +All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `api` field. + +### `[io.buildpacks]` + +API Version: `0.1` + +This is the Cloud Native Buildpacks' section of the project descriptor. It contains a different API version from [`_`](#_). The TOML schema is the following: + +``` +[io.buildpacks] +api = "" + +[io.buildpacks.build] +include = [""] +exclude = [""] + +[[io.buildpacks.build.buildpacks]] +id = "" +version = "" +uri = "" + +[[io.buildpacks.build.env]] +name = "" +value = "" +``` + +* `api` - version identifier for the schema of the `io.buildpacks` table. + +#### `[io.buildpacks.build.include]` and `[io.buildpacks.build.exclude]` The top-level `[build]` table MAY contain configuration about how to build the project. It MAY include the following keys and others defined below in their individual sub-sections - @@ -89,7 +128,7 @@ The top-level `[build]` table MAY contain configuration about how to build the p An optional list of files to include in the build (while excluding everything else): ```toml -[build] +[io.buildpacks.build] include = [ "cmd/", "go.mod", @@ -101,7 +140,7 @@ include = [ A list of files to exclude from the build (while including everything else): ```toml -[build] +[io.buildpacks.build] exclude = [ "spec/" ] @@ -113,12 +152,12 @@ Any files that are excluded (either via `include` or `exclude`) MUST BE excluded If both `exclude` and `include` are defined, the build process MUST result in an error. -### `[[build.buildpacks]]` +#### `[[io.buildpacks.build.buildpacks]]` The build table MAY contain an array of buildpacks. The schema for this table is: ```toml -[[build.buildpacks]] +[[io.buildpacks.build.buildpacks]] id = "" version = "" uri = ")" @@ -128,29 +167,20 @@ This defines the buildpacks that a platform should use on the repo. Either an `id` or a `uri` MUST be included, but MUST NOT include both. If `uri` is provided, `version` MUST NOT be allowed. -### `[[build.env]]` +#### `[[io.buildpacks.build.env]]` Used to set environment variables at build time, for example: ```toml -[[build.env]] +[[io.buildpacks.build.env]] name = "JAVA_OPTS" value = "-Xmx1g" ``` -## `[metadata]` - -This table includes a some defined keys, but additional keys are not validated. It can be used to add platform specific metadata. For example: - -```toml -[metadata.heroku] -pipeline = "foobar" -``` - ## Example ```toml -[project] +[_] id = "io.buildpacks.my-app" version = "0.1" @@ -163,17 +193,17 @@ include = [ "*.go" ] -[[build.buildpacks]] +[_.metadata] +foo = "bar" + +[_.metadata.fizz] +buzz = ["a", "b", "c"] + +[[io.buildpacks.build.buildpacks]] id = "io.buildpacks/java" version = "1.0" -[[build.buildpacks]] +[[io.buildpacks.build.buildpacks]] id = "io.buildpacks/nodejs" version = "1.0" - -[metadata] -foo = "bar" - -[metadata.fizz] -buzz = ["a", "b", "c"] -``` +``` \ No newline at end of file From 89f25a447d5623d1b8804164e50234cad6b7d84c Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 5 May 2021 12:04:58 -0500 Subject: [PATCH 03/53] update with feedback from @ekcasey Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 96 ++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index e2b2fcff..6051a6db 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -7,36 +7,46 @@ A project descriptor is a file that MAY contain configuration for apps, services - [Project Descriptor](#project-descriptor) - [Table of Contents](#table-of-contents) - - [Schema](#schema) - - [`[_]`](#_) - - [`[_]`](#_-1) - - [`[[_.licenses]]`](#_licenses) - - [`[_.metadata]`](#_metadata) - - [Non-`[_]` Tables](#non-_-tables) - - [`[io.buildpacks]`](#iobuildpacks) - - [`[io.buildpacks.build.include]` and `[io.buildpacks.build.exclude]`](#iobuildpacksbuildinclude-and-iobuildpacksbuildexclude) + - [API Version](#api-version) + - [Special Value Types](#special-value-types) + - [Top Level Tables](#top-level-tables) + - [`_`](#_) + - [`_.licenses`](#_licenses) + - [`_.metadata`](#_metadata) + - [Non-`_` Tables](#non-_-tables) + - [`io.buildpacks`](#iobuildpacks) + - [`io.buildpacks.build.include` and `io.buildpacks.build.exclude`](#iobuildpacksbuildinclude-and-iobuildpacksbuildexclude) - [`[build.include]` and `[build.exclude]`](#buildinclude-and-buildexclude) - - [`[[io.buildpacks.build.buildpacks]]`](#iobuildpacksbuildbuildpacks) - - [`[[io.buildpacks.build.env]]`](#iobuildpacksbuildenv) + - [`io.buildpacks.build.buildpacks`](#iobuildpacksbuildbuildpacks) + - [`io.buildpacks.build.env`](#iobuildpacksbuildenv) - [Example](#example) -## Schema +## API Version -### `[_]` +This document specifies Project Descriptor API Version `0.2`. -API Version: `0.2` +The API version format follows the form of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). + +## Special Value Types + +* `api` - A string that follows the formot of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). +* `uri` - A string that follows the format of [RFC3986](https://tools.ietf.org/html/rfc3986). + +## Top Level Tables + +### `_` The TOML schema of the project section of the project descriptor: ```toml [_] -api = "" +api = "" id = "" # machine readable name = "" # human readable version = "" authors = [""] -documentation-url = "" -source-url = "" +documentation-url = "" +source-url = "" [[_.licenses]] type = "" @@ -46,10 +56,6 @@ uri = "" # additional arbitrary keys allowed ``` -The following sections describe each part of the schema in detail. - -#### `[_]` - The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `api` to denote which version of this API the descriptor is using. ```toml @@ -59,8 +65,8 @@ id = "" name = "" version = "" authors = [""] -documentation-url = "" -source-url = "" +documentation-url = "" +source-url = "" ``` * `api` - version identifier for the schema of the `_` table and structure of the project descriptor file. This version format follows the rules of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). @@ -68,38 +74,42 @@ source-url = "" * `name` - (optional) the human readable name of the project (ex. "My Example Service") * `version` - (optional) and arbitrary string representing the version of the project * `authors` - (optional) the names and/or email addresses of the project's authors -* `documentation-url` - (optional) a URL to the documentation for the project +* `documentation-url` - (optional) a URL to the documentation for the project. * `source-url` - (optional) a URL to the source code for the project -#### `[[_.licenses]]` +#### `_.licenses` An optional list of project licenses. +```toml +[[_.licenses]] +type = "" +uri = "" +``` + * `type` - This MAY use the [SPDX 2.1 license expression](https://spdx.org/spdx-specification-21-web-version), but is not limited to identifiers in the [SPDX Licenses List](https://spdx.org/licenses/). * `uri` - If this project is using a nonstandard license, then this key MAY be specified in lieu of or in addition to `type` to point to the license. -#### `[_.metadata]` +#### `_.metadata` -Keys in this table are not validated and can be used by users. +This is an optional free form table for users to use as they see fit. The Keys in this table are not validated. ```toml [_.metadata.foo] checksum = "a28a0d7772df1f918da2b1102da4ff35" ``` -### Non-`[_]` Tables -All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `api` field. +### Non-`_` Tables -### `[io.buildpacks]` +All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `api` field. All these tables are optional. -API Version: `0.1` +### `io.buildpacks` This is the Cloud Native Buildpacks' section of the project descriptor. It contains a different API version from [`_`](#_). The TOML schema is the following: ``` [io.buildpacks] -api = "" [io.buildpacks.build] include = [""] @@ -117,7 +127,7 @@ value = "" * `api` - version identifier for the schema of the `io.buildpacks` table. -#### `[io.buildpacks.build.include]` and `[io.buildpacks.build.exclude]` +#### `io.buildpacks.build.include` and `io.buildpacks.build.exclude` The top-level `[build]` table MAY contain configuration about how to build the project. It MAY include the following keys and others defined below in their individual sub-sections - @@ -152,9 +162,9 @@ Any files that are excluded (either via `include` or `exclude`) MUST BE excluded If both `exclude` and `include` are defined, the build process MUST result in an error. -#### `[[io.buildpacks.build.buildpacks]]` +#### `io.buildpacks.build.buildpacks` -The build table MAY contain an array of buildpacks. The schema for this table is: +An optional build table containining an array of buildpacks. The schema for this table is: ```toml [[io.buildpacks.build.buildpacks]] @@ -167,9 +177,9 @@ This defines the buildpacks that a platform should use on the repo. Either an `id` or a `uri` MUST be included, but MUST NOT include both. If `uri` is provided, `version` MUST NOT be allowed. -#### `[[io.buildpacks.build.env]]` +#### `io.buildpacks.build.env` -Used to set environment variables at build time, for example: +An optional table used to set environment variables at build time, for example: ```toml [[io.buildpacks.build.env]] @@ -184,7 +194,13 @@ value = "-Xmx1g" id = "io.buildpacks.my-app" version = "0.1" -[build] +[_.metadata] +foo = "bar" + +[_.metadata.fizz] +buzz = ["a", "b", "c"] + +[io.buildpacks.build] builder = "cnbs/sample-builder:bionic" include = [ "cmd/", @@ -193,12 +209,6 @@ include = [ "*.go" ] -[_.metadata] -foo = "bar" - -[_.metadata.fizz] -buzz = ["a", "b", "c"] - [[io.buildpacks.build.buildpacks]] id = "io.buildpacks/java" version = "1.0" From ad3d13f3848850bef448a12ede636a756cf81b81 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 5 May 2021 12:25:16 -0500 Subject: [PATCH 04/53] make optional more clear Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 6051a6db..29accb96 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -10,15 +10,15 @@ A project descriptor is a file that MAY contain configuration for apps, services - [API Version](#api-version) - [Special Value Types](#special-value-types) - [Top Level Tables](#top-level-tables) - - [`_`](#_) - - [`_.licenses`](#_licenses) - - [`_.metadata`](#_metadata) - [Non-`_` Tables](#non-_-tables) - - [`io.buildpacks`](#iobuildpacks) - - [`io.buildpacks.build.include` and `io.buildpacks.build.exclude`](#iobuildpacksbuildinclude-and-iobuildpacksbuildexclude) - - [`[build.include]` and `[build.exclude]`](#buildinclude-and-buildexclude) - - [`io.buildpacks.build.buildpacks`](#iobuildpacksbuildbuildpacks) - - [`io.buildpacks.build.env`](#iobuildpacksbuildenv) + - [`_`](#_) + - [`_.licenses` (optional)](#_licenses-optional) + - [`_.metadata` (optional)](#_metadata-optional) + - [`io.buildpacks` (optional)](#iobuildpacks-optional) + - [`io.buildpacks.build.builder` (optional)](#iobuildpacksbuildbuilder-optional) + - [`io.buildpacks.build.include` (optional) and `io.buildpacks.build.exclude` (optional)](#iobuildpacksbuildinclude-optional-and-iobuildpacksbuildexclude-optional) + - [`io.buildpacks.build.buildpacks` (optional)](#iobuildpacksbuildbuildpacks-optional) + - [`io.buildpacks.build.env` (optional)](#iobuildpacksbuildenv-optional) - [Example](#example) ## API Version @@ -29,11 +29,15 @@ The API version format follows the form of [Buildpack API Version](https://githu ## Special Value Types -* `api` - A string that follows the formot of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). +* `api` - A string that follows the format of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). * `uri` - A string that follows the format of [RFC3986](https://tools.ietf.org/html/rfc3986). ## Top Level Tables +### Non-`_` Tables + +All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `api` field. All these tables are optional. + ### `_` The TOML schema of the project section of the project descriptor: @@ -77,9 +81,9 @@ source-url = "" * `documentation-url` - (optional) a URL to the documentation for the project. * `source-url` - (optional) a URL to the source code for the project -#### `_.licenses` +#### `_.licenses` (optional) -An optional list of project licenses. +This table MAY contain project licenses. ```toml [[_.licenses]] @@ -90,21 +94,17 @@ uri = "" * `type` - This MAY use the [SPDX 2.1 license expression](https://spdx.org/spdx-specification-21-web-version), but is not limited to identifiers in the [SPDX Licenses List](https://spdx.org/licenses/). * `uri` - If this project is using a nonstandard license, then this key MAY be specified in lieu of or in addition to `type` to point to the license. +#### `_.metadata` (optional) -#### `_.metadata` - -This is an optional free form table for users to use as they see fit. The Keys in this table are not validated. +This is a free form table for users to use as they see fit. The keys in this table are not validated. ```toml [_.metadata.foo] checksum = "a28a0d7772df1f918da2b1102da4ff35" ``` -### Non-`_` Tables -All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `api` field. All these tables are optional. - -### `io.buildpacks` +### `io.buildpacks` (optional) This is the Cloud Native Buildpacks' section of the project descriptor. It contains a different API version from [`_`](#_). The TOML schema is the following: @@ -112,6 +112,7 @@ This is the Cloud Native Buildpacks' section of the project descriptor. It conta [io.buildpacks] [io.buildpacks.build] +builder = "" include = [""] exclude = [""] @@ -127,15 +128,14 @@ value = "" * `api` - version identifier for the schema of the `io.buildpacks` table. -#### `io.buildpacks.build.include` and `io.buildpacks.build.exclude` - -The top-level `[build]` table MAY contain configuration about how to build the project. It MAY include the following keys and others defined below in their individual sub-sections - +#### `io.buildpacks.build.builder` (optional) -* `builder` - (optional) the builder image to use (ex. "cnbs/sample-builder:bionic") +This is the builder image to use (ex. "cnbs/sample-builder:bionic"). -### `[build.include]` and `[build.exclude]` +#### `io.buildpacks.build.include` (optional) and `io.buildpacks.build.exclude` (optional) An optional list of files to include in the build (while excluding everything else): +This MAY contain a list of files to include in the build (while excluding everything else): ```toml [io.buildpacks.build] @@ -162,9 +162,9 @@ Any files that are excluded (either via `include` or `exclude`) MUST BE excluded If both `exclude` and `include` are defined, the build process MUST result in an error. -#### `io.buildpacks.build.buildpacks` +#### `io.buildpacks.build.buildpacks` (optional) -An optional build table containining an array of buildpacks. The schema for this table is: +This table MAY contain an array of buildpacks. The schema for this table is: ```toml [[io.buildpacks.build.buildpacks]] @@ -177,9 +177,9 @@ This defines the buildpacks that a platform should use on the repo. Either an `id` or a `uri` MUST be included, but MUST NOT include both. If `uri` is provided, `version` MUST NOT be allowed. -#### `io.buildpacks.build.env` +#### `io.buildpacks.build.env` (optional) -An optional table used to set environment variables at build time, for example: +This table MAY be used to set environment variables at build time, for example: ```toml [[io.buildpacks.build.env]] From 9f1e939cfed0c64175bdcf782600201d417d7ac0 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Thu, 6 May 2021 12:44:00 -0500 Subject: [PATCH 05/53] change api -> schema_version Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 29accb96..660a9654 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -7,7 +7,7 @@ A project descriptor is a file that MAY contain configuration for apps, services - [Project Descriptor](#project-descriptor) - [Table of Contents](#table-of-contents) - - [API Version](#api-version) + - [Schema Version API Version](#schema-version-api-version) - [Special Value Types](#special-value-types) - [Top Level Tables](#top-level-tables) - [Non-`_` Tables](#non-_-tables) @@ -21,9 +21,9 @@ A project descriptor is a file that MAY contain configuration for apps, services - [`io.buildpacks.build.env` (optional)](#iobuildpacksbuildenv-optional) - [Example](#example) -## API Version +## Schema Version API Version -This document specifies Project Descriptor API Version `0.2`. +This document specifies Project Descriptor Schema API Version `0.2`. The API version format follows the form of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). @@ -36,7 +36,7 @@ The API version format follows the form of [Buildpack API Version](https://githu ### Non-`_` Tables -All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `api` field. All these tables are optional. +All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `schema_version` field. All these tables are optional. ### `_` @@ -44,7 +44,7 @@ The TOML schema of the project section of the project descriptor: ```toml [_] -api = "" +schema_version = "" id = "" # machine readable name = "" # human readable version = "" @@ -60,11 +60,11 @@ uri = "" # additional arbitrary keys allowed ``` -The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `api` to denote which version of this API the descriptor is using. +The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `schema_version` to denote which version of this API the descriptor is using. ```toml [_] -api = "" +schema_version = "" id = "" name = "" version = "" @@ -73,7 +73,7 @@ documentation-url = "" source-url = "" ``` -* `api` - version identifier for the schema of the `_` table and structure of the project descriptor file. This version format follows the rules of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). +* `schema_version` - version identifier for the schema of the `_` table and structure of the project descriptor file. * `id` - (optional) the machine readable identifier of the project (ex. "com.example.myservice") * `name` - (optional) the human readable name of the project (ex. "My Example Service") * `version` - (optional) and arbitrary string representing the version of the project @@ -106,7 +106,7 @@ checksum = "a28a0d7772df1f918da2b1102da4ff35" ### `io.buildpacks` (optional) -This is the Cloud Native Buildpacks' section of the project descriptor. It contains a different API version from [`_`](#_). The TOML schema is the following: +This is the Cloud Native Buildpacks' section of the project descriptor. The TOML schema is the following: ``` [io.buildpacks] @@ -126,8 +126,6 @@ name = "" value = "" ``` -* `api` - version identifier for the schema of the `io.buildpacks` table. - #### `io.buildpacks.build.builder` (optional) This is the builder image to use (ex. "cnbs/sample-builder:bionic"). From 26f59bb4107234021bb4dcd401e7bef7f738aae9 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Thu, 6 May 2021 17:37:10 -0500 Subject: [PATCH 06/53] for consistency use - over _ Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 660a9654..77d7900c 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -36,7 +36,7 @@ The API version format follows the form of [Buildpack API Version](https://githu ### Non-`_` Tables -All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `schema_version` field. All these tables are optional. +All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `schema-version` field. All these tables are optional. ### `_` @@ -44,7 +44,7 @@ The TOML schema of the project section of the project descriptor: ```toml [_] -schema_version = "" +schema-version = "" id = "" # machine readable name = "" # human readable version = "" @@ -60,11 +60,11 @@ uri = "" # additional arbitrary keys allowed ``` -The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `schema_version` to denote which version of this API the descriptor is using. +The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `schema-version` to denote which version of this API the descriptor is using. ```toml [_] -schema_version = "" +schema-version = "" id = "" name = "" version = "" @@ -73,7 +73,7 @@ documentation-url = "" source-url = "" ``` -* `schema_version` - version identifier for the schema of the `_` table and structure of the project descriptor file. +* `schema-version` - version identifier for the schema of the `_` table and structure of the project descriptor file. * `id` - (optional) the machine readable identifier of the project (ex. "com.example.myservice") * `name` - (optional) the human readable name of the project (ex. "My Example Service") * `version` - (optional) and arbitrary string representing the version of the project From 0231e6e22d896070b68082999f544487d0720520 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 12 May 2021 15:49:42 -0500 Subject: [PATCH 07/53] Update extensions/project-descriptor.md Co-authored-by: Emily Casey Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 77d7900c..7783f805 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -29,7 +29,7 @@ The API version format follows the form of [Buildpack API Version](https://githu ## Special Value Types -* `api` - A string that follows the format of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). +* `schema-version` - A string that follows the format of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). * `uri` - A string that follows the format of [RFC3986](https://tools.ietf.org/html/rfc3986). ## Top Level Tables @@ -214,4 +214,4 @@ version = "1.0" [[io.buildpacks.build.buildpacks]] id = "io.buildpacks/nodejs" version = "1.0" -``` \ No newline at end of file +``` From 2f6e5bce5e5783d6fecffb12748cc603efd29f1f Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 12 May 2021 15:49:53 -0500 Subject: [PATCH 08/53] Update extensions/project-descriptor.md Co-authored-by: Emily Casey Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 7783f805..6a687ad1 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -44,7 +44,7 @@ The TOML schema of the project section of the project descriptor: ```toml [_] -schema-version = "" +schema-version = "" id = "" # machine readable name = "" # human readable version = "" From f238e0f14b05c4898f107f982e485f36b4d2dd2e Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 26 May 2021 12:59:00 -0500 Subject: [PATCH 09/53] drop the `build` key per @jkutner's suggestion Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 34 +++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 6a687ad1..f98b7f8e 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -15,10 +15,10 @@ A project descriptor is a file that MAY contain configuration for apps, services - [`_.licenses` (optional)](#_licenses-optional) - [`_.metadata` (optional)](#_metadata-optional) - [`io.buildpacks` (optional)](#iobuildpacks-optional) - - [`io.buildpacks.build.builder` (optional)](#iobuildpacksbuildbuilder-optional) - - [`io.buildpacks.build.include` (optional) and `io.buildpacks.build.exclude` (optional)](#iobuildpacksbuildinclude-optional-and-iobuildpacksbuildexclude-optional) - - [`io.buildpacks.build.buildpacks` (optional)](#iobuildpacksbuildbuildpacks-optional) - - [`io.buildpacks.build.env` (optional)](#iobuildpacksbuildenv-optional) + - [`io.buildpacks.builder` (optional)](#iobuildpacksbuilder-optional) + - [`io.buildpacks.include` (optional) and `io.buildpacks.exclude` (optional)](#iobuildpacksinclude-optional-and-iobuildpacksexclude-optional) + - [`io.buildpacks.group` (optional)](#iobuildpacksgroup-optional) + - [`io.buildpacks.env.build` (optional)](#iobuildpacksenvbuild-optional) - [Example](#example) ## Schema Version API Version @@ -110,13 +110,11 @@ This is the Cloud Native Buildpacks' section of the project descriptor. The TOML ``` [io.buildpacks] - -[io.buildpacks.build] builder = "" include = [""] exclude = [""] -[[io.buildpacks.build.buildpacks]] +[[io.buildpacks.group]] id = "" version = "" uri = "" @@ -126,17 +124,17 @@ name = "" value = "" ``` -#### `io.buildpacks.build.builder` (optional) +#### `io.buildpacks.builder` (optional) This is the builder image to use (ex. "cnbs/sample-builder:bionic"). -#### `io.buildpacks.build.include` (optional) and `io.buildpacks.build.exclude` (optional) +#### `io.buildpacks.include` (optional) and `io.buildpacks.exclude` (optional) An optional list of files to include in the build (while excluding everything else): This MAY contain a list of files to include in the build (while excluding everything else): ```toml -[io.buildpacks.build] +[io.buildpacks] include = [ "cmd/", "go.mod", @@ -148,7 +146,7 @@ include = [ A list of files to exclude from the build (while including everything else): ```toml -[io.buildpacks.build] +[io.buildpacks] exclude = [ "spec/" ] @@ -160,12 +158,12 @@ Any files that are excluded (either via `include` or `exclude`) MUST BE excluded If both `exclude` and `include` are defined, the build process MUST result in an error. -#### `io.buildpacks.build.buildpacks` (optional) +#### `io.buildpacks.group` (optional) This table MAY contain an array of buildpacks. The schema for this table is: ```toml -[[io.buildpacks.build.buildpacks]] +[[io.buildpacks.group]] id = "" version = "" uri = ")" @@ -175,12 +173,12 @@ This defines the buildpacks that a platform should use on the repo. Either an `id` or a `uri` MUST be included, but MUST NOT include both. If `uri` is provided, `version` MUST NOT be allowed. -#### `io.buildpacks.build.env` (optional) +#### `io.buildpacks.env.build` (optional) This table MAY be used to set environment variables at build time, for example: ```toml -[[io.buildpacks.build.env]] +[[io.buildpacks.env.build]] name = "JAVA_OPTS" value = "-Xmx1g" ``` @@ -198,7 +196,7 @@ foo = "bar" [_.metadata.fizz] buzz = ["a", "b", "c"] -[io.buildpacks.build] +[io.buildpacks] builder = "cnbs/sample-builder:bionic" include = [ "cmd/", @@ -207,11 +205,11 @@ include = [ "*.go" ] -[[io.buildpacks.build.buildpacks]] +[[io.buildpacks.group]] id = "io.buildpacks/java" version = "1.0" -[[io.buildpacks.build.buildpacks]] +[[io.buildpacks.gruop]] id = "io.buildpacks/nodejs" version = "1.0" ``` From 0f6a82b7393c89e883175e7ccbae08c5c7c675a7 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 26 May 2021 20:05:28 -0500 Subject: [PATCH 10/53] copy the API Version rules per @ekcasey's suggestion. Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index f98b7f8e..42394fb6 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -25,7 +25,10 @@ A project descriptor is a file that MAY contain configuration for apps, services This document specifies Project Descriptor Schema API Version `0.2`. -The API version format follows the form of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). +The Schema API version format follows the form of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version): + +* MUST be in form . or , where is equivalent to .0 +* When is greater than 0 increments to SHALL exclusively indicate additive changes ## Special Value Types From f665688f4226ae11a59dd9086215c6748fc99a56 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 26 May 2021 20:08:17 -0500 Subject: [PATCH 11/53] change Schema Version API to just Schema Versian Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 42394fb6..822aa4ab 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -7,7 +7,7 @@ A project descriptor is a file that MAY contain configuration for apps, services - [Project Descriptor](#project-descriptor) - [Table of Contents](#table-of-contents) - - [Schema Version API Version](#schema-version-api-version) + - [Schema Version](#schema-version) - [Special Value Types](#special-value-types) - [Top Level Tables](#top-level-tables) - [Non-`_` Tables](#non-_-tables) @@ -21,11 +21,11 @@ A project descriptor is a file that MAY contain configuration for apps, services - [`io.buildpacks.env.build` (optional)](#iobuildpacksenvbuild-optional) - [Example](#example) -## Schema Version API Version +## Schema Version -This document specifies Project Descriptor Schema API Version `0.2`. +This document specifies Project Descriptor Schema Version `0.2`. -The Schema API version format follows the form of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version): +The Schema Version format follows the form of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version): * MUST be in form . or , where is equivalent to .0 * When is greater than 0 increments to SHALL exclusively indicate additive changes @@ -39,7 +39,7 @@ The Schema API version format follows the form of the [Buildpack API Version](ht ### Non-`_` Tables -All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version API number using the `schema-version` field. All these tables are optional. +All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version number using the `schema-version` field. All these tables are optional. ### `_` @@ -63,7 +63,7 @@ uri = "" # additional arbitrary keys allowed ``` -The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `schema-version` to denote which version of this API the descriptor is using. +The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `schema-version` to denote which schema version the descriptor is using. ```toml [_] From 3d25ba05805a41e95083874f5fedf2da0bcd2538 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Wed, 26 May 2021 20:13:44 -0500 Subject: [PATCH 12/53] use more practical examples for metadata Signed-off-by: Terence Lee --- extensions/project-descriptor.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 822aa4ab..7afe8fcb 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -194,9 +194,12 @@ id = "io.buildpacks.my-app" version = "0.1" [_.metadata] -foo = "bar" +cdn = "https://cdn.example.com" + +[[_.metadata.assets]] +url = "https://cdn.example.com/assets/foo.jar" +checksum = "3b1b39893d8e34a6d0bd44095afcd5c4" -[_.metadata.fizz] buzz = ["a", "b", "c"] [io.buildpacks] From 7fa0df91433ad7d95475e7633e43ac1bcff91ad7 Mon Sep 17 00:00:00 2001 From: Joe Kutner Date: Fri, 28 May 2021 22:15:32 -0500 Subject: [PATCH 13/53] Added inline buildpack spec to project-descriptor Signed-off-by: Joe Kutner --- extensions/project-descriptor.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 7afe8fcb..270f13bb 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -122,6 +122,11 @@ id = "" version = "" uri = "" + [io.buildpacks.group.script] + api = "" + shell = "" + inline = "