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

removed properties from score spec #45

Merged
merged 5 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions content/en/docs/dependencies/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,8 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
db:
type: postgres
properties:
host:
default: localhost
port:
rachfop marked this conversation as resolved.
Show resolved Hide resolved
default: 5432
name:
rachfop marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -70,10 +63,6 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
```

To prepare the Docker Compose configuration files, convert both Score files with `score-compose`.
Expand Down
7 changes: 0 additions & 7 deletions content/en/docs/dependencies/dependencies-humanitec.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ containers:
resources:
db:
type: postgres
properties:
host:
default: localhost
port:
rachfop marked this conversation as resolved.
Show resolved Hide resolved
default: 5432
name:
rachfop marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -56,12 +53,8 @@ resources:
secret: true
dns:
type: dns
properties:
domain:
backend:
type: workload
properties:
name:
```

This example also uses an extensions file, called `humanitec.yaml`, that contains additional hints for `score-humanitec` CLI tool. This information would help the CLI tool to resolve the resources properly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ The output of the command will be a delta file that contains the changes made to
}
```

Merging two workload deployments together using the `--delta` flag can simplify the deployment process by allowing you to deploy multiple Workloads as a single release. You can merge your Workload deployments seamlessly and manage your application deployments more effectively.
Merging two workload deployments together using the `--delta` flag can simplify the deployment process by allowing you to deploy multiple Workloads as a single release. You can merge your Workload deployments seamlessly and manage your application deployments more effectively.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
```

Use the `run` command to generate a Docker Compose file from Score.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
```

{{% alert %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
```

{{% alert %}}
Expand Down
4 changes: 0 additions & 4 deletions content/en/docs/extensions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,9 @@ containers:
resources:
dns:
type: dns
properties:
domain:
...
rachfop marked this conversation as resolved.
Show resolved Hide resolved
api-route:
type: route
properties:
prefix:
...
rachfop marked this conversation as resolved.
Show resolved Hide resolved
```

Expand Down
5 changes: 0 additions & 5 deletions content/en/docs/extensions/implement-ports-volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ containers:
resources:
env:
type: environment
properties:
MESSAGE:
type: string
DATADOG_ENV:
type: string
dns:
type: dns
```
Expand Down
4 changes: 0 additions & 4 deletions content/en/docs/get started/Transform/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ container:
resources:
database:
type: postgres
properties:
host:
required: true
default: localhost
port:
rachfop marked this conversation as resolved.
Show resolved Hide resolved
required: true
default: 5432
Expand Down
15 changes: 0 additions & 15 deletions content/en/docs/get started/Transform/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ db:
type: postgres
```

1. Add properties.

```yaml
properties:
host:
default: localhost
port:
default: 5432
name:
username:
secret: true
password:
secret: true
```

1. Declare your dependencies
2. Add environment variables.

rachfop marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
12 changes: 0 additions & 12 deletions content/en/docs/reference/score-cli/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
```

In the previous code snippet, the `variables` parameter is adjusted too far left. It should be aligned with the `image`, `command`, and `args` parameters.
Expand All @@ -113,10 +109,6 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
```

Alternatively, you could have the map of the variables set incorrectly.
Expand All @@ -140,10 +132,6 @@ containers:
resources:
env:
type: environment
properties:
NAME:
type: string
default: World
```

The `FRIEND` parameter is set to `resources.friend.NAME`, but that is not a valid path in the `resources` section.
45 changes: 8 additions & 37 deletions content/en/docs/reference/score-spec-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,12 @@ Resources can be anything and Score doesn't differentiate resources by types. Th

It is up to {{< glossary_tooltip text="Score implementation (CLI)" term_id="score" >}} to resolve the resource by name, type, or any other meta information available.

### Resource properties
### Resources

```yaml
resources:
[resource-name]:
type: [resource-type]
properties: # optional
[property-name]:
type: string # optional
default: interface{} # optional
required: [true | false] # false by default
secret: [true | false] # false by default
```

**`resources`**: defines dependencies needed by the Workload.
Expand All @@ -92,29 +86,16 @@ resources:
- **Type**: string.
- **Constraints**: alphanumeric string.

**`properties`**: specifies properties definition that are available to the resource. Set properties that can be referenced in other places in the Score Specification file. For more information, see [Referencing Resources](#referencing-resources).

**`property-name`**: used to reference the resource property in other places in Score file.

- **Type**: string.
- **Constraints**: alphanumeric string.

- `default`: specifies a value that can be defined for the property.
- `type`: specifies a property type.
- `required`: specifies a property as required. If specified, but the value is missing or empty, the deployment will fail.
- `secret`: specifies a property value as a case-sensitive secret. Values can be sourced from Vaults.

### Reserved resource types

In general, `resource-type` has no meaning for Score, but it can affect how the targeted Score implementation tool resolves the resource. The following conventions are _reserved_ resource types.

| Resource type | `score-compose` | `score-humanitec` |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `environment` | Translates to the environment variables references. For example: `${PROPERTY-NAME}`. | Translates to the application values references. For example: `${values.property-name}`. |
| `volume` | Translates into a reference to the external volume. This reference is usually used in a container’s volume mount specification. | Translates into a reference to the external volume. This reference is usually used in a container’s volume mount specification. |
| `service` | N/A | Translates to the module properties references. For example: `${modules.service-name.property-name}`. |
| `workload` | N/A | Reserved resource type. Its usage may lead to compatibility issues with future releases of [score-humanitec](https://github.com/score-spec/score-humanitec).|

| Resource type | `score-compose` | `score-humanitec` |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `environment` | Translates to the environment variables references. For example: `${PROPERTY-NAME}`. | Translates to the application values references. For example: `${values.property-name}`. |
| `volume` | Translates into a reference to the external volume. This reference is usually used in a container’s volume mount specification. | Translates into a reference to the external volume. This reference is usually used in a container’s volume mount specification. |
| `service` | N/A | Translates to the module properties references. For example: `${modules.service-name.property-name}`. |
| `workload` | N/A | Reserved resource type. Its usage may lead to compatibility issues with future releases of [score-humanitec](https://github.com/score-spec/score-humanitec). |

### Referencing resources
rachfop marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -142,7 +123,7 @@ resources:

It is up to the Score implementation (CLI) on how and when the resource reference is resolved, and when the referenced values' substitution occurs.

For example, `score-compose` would convert resource properties into environment variables references in a resulting `compose.yaml` configuration file, and produce a reference `.env` file that the user can then populate. For more information, see the [.env file](https://docs.docker.com/compose/environment-variables/#the-env-file).
For example, `score-compose` would convert resources into environment variables references in a resulting `compose.yaml` configuration file, and produce a reference `.env` file that the user can then populate. For more information, see the [.env file](https://docs.docker.com/compose/environment-variables/#the-env-file).
rachfop marked this conversation as resolved.
Show resolved Hide resolved

The following Score file contains a single resource.

Expand All @@ -163,15 +144,6 @@ containers:
resources:
db:
type: postgres
properties:
host:
port:
default: 5432
name:
username:
secret: true
password:
secret: true
```

## Service definition
Expand Down Expand Up @@ -368,4 +340,3 @@ containers:
- name: Custom-Header
value: Awesome
```

15 changes: 0 additions & 15 deletions content/en/docs/tutorials/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,6 @@ containers:
resources:
database:
type: postgres
properties:
host:
required: true
default: localhost
port:
required: true
default: 5432
name:
required: true
username:
secret: true
required: false
password:
secret: true
required: false
```

## Local environment setup with Docker-Compose
Expand Down
10 changes: 0 additions & 10 deletions content/en/docs/tutorials/score-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ container:
resources:
db:
type: postgres
properties:
host:
default: localhost
port:
default: 5432
name:
username:
secret: true
password:
secret: true
```

## Executing `score-compose`
Expand Down