Giter Club home page Giter Club logo

schema's Introduction

JSON schemas for Score files

version file
v1-beta1 score-v1b1.json

Embed schemas into project

Add Score schemas into projects with git subtree add command:

git subtree add \
  --prefix schemas \
  [email protected]:score-spec/schema.git main \
  --squash

Note: To avoid storing the entire history of the sub-project in the main repository, make sure to include --squash flag.

Update schemas from upstream

Get the latest versions of the schemas git subtree pull command:

git subtree pull \
  --prefix schemas \
  [email protected]:score-spec/schema.git main \
  --squash

Contribute changes to upstream

All changes to score-spec/schema should be done via pull requests and comply with the review and sign-off policies.

schema's People

Contributors

astromechza avatar delca85 avatar ghen avatar

Watchers

 avatar

Forkers

astromechza

schema's Issues

Add specification for metadata.annotations map

Just like resources have metadata.annotations today, there is need to support the same concept formally on the workload metadata as well. This will allow us to pass kubernetes-style annotations through to the destination runtime.

For score-compose, these would be labels, while for score-helm and score-humanitec these would be annotations on the final deployment objects. Since this is just metadata it can also be ignored without affecting the functionality of the workload.

metadata:
  name: my workload
  annotations:
    example.com/my-annotation: value

This should carry the same specification as resource.metadata.annotations.

Json schema indicates ports as `number`

There are a number of locations in the schema where 'number' is used rather than 'integer' in the port bindings:

  • service.ports.port
  • service.ports.targetPort
  • $defs.httpProbe.port

This usually doesn't show up as a problem but it might when validation allows port numbers like 33.3333 to pass validation, but may cause failures when converted into docker compose, helm, or other destination container types.

I'd like to propose that we change these to integers!

Spec describes targetPort as required and port as optional which is backwards

All implementations of score Service assume the port is required, and will default the targetPort if not provided. This is the same as both Humanitec and the underlying K8s implementation. Score-compose and score-humanitec do the same.

The score documentation also lists port as required and target port as optional.

However the spec lists this the other way around. To avoid breaking customers that have workloads defined with just port right now, we need to fix this in the spec.

Json schema is missing protocol and hostIP from service.ports

The score website indicates

image

However the API spec does not support these fields.

"ports": {
  "description": "List of network ports published by the service.",
  "type": "object",
  "minProperties": 1,
  "additionalProperties": {
    "description": "The network port description.",
    "type": "object",
    "required": [
      "targetPort"
    ],
    "additionalProperties": false,
    "properties": {
      "port": {
        "description": "The public service port.",
        "type": "number"
      },
      <--- missing --->
      "targetPort": {
        "description": "The internal service port.",
        "type": "number"
      }
    }
  }
}

This means validators may reject these fields if provided, and implementation behavior or failure may be unpredictable. However hostIP is also not a real field used by any score implementations just yet so that should be removed.

I'd like to propose we fix this by adding protocol to the spec, and removing hostIP from the docs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.