openmicroservices.org icon indicating copy to clipboard operation
openmicroservices.org copied to clipboard

Specification should include Microservice Artifact

Open williammartin opened this issue 6 years ago • 0 comments

Proposal

Currently, microservice specifications are not inherently linked to their artifacts (except by convention of existing next to the code). When submitting a microservice to the storyscript cloud one provides:

  • The repository in which the microservice.yml lives
  • The location of a docker image that can be used as the runnable artifact

This proposal suggests that the runnable artifact or buildable source should be found in the microservice.yml. There are really two flows that are supported today:

  • Running an image via storyscript cloud
  • Building and running an image via the omg utility

We may also in future want the ability to build from source using Cloud Native Buildpacks, but let’s forget about that for now. The rough proposed addition to the specification would be a top level field artifact.

This new field could be defined in the following ways:

artifact: 
  image: williammartin/boyohboy
  tag: 1.0.0
  from: <uri of registry>/<location of dockerfile>

Why?

Discoverability

Imagine today you find a microservice.yml in the wild that defines exactly the interface you want to consume (hooray), how do you find the artifact that implements it?

Versioning

Imagine today you find a microservice.yml in the wild that defines exactly the interface you want to consume (hooray), and you find the repository on dockerhub, how do you know which version of an image actually satisfied the specification?

Decoupling 1:1 Relationship between Microservices and Repositories

Currently, when you submit a microservice, you provide a docker pull URI for the microservice. Although we’d like to have microservice.yml files sitting alongside the code from a marketing point of view, I would anticipate that many projects will not want to do this, and in the same way helm charts are curated by kubernetes, repositories will exist solely to specify sets of microservices.

Reduces Redundant Functionality

Let’s face it, this functionality is necessary for all OMG compliant tooling so why make everyone reinvent the wheel of artifact discovery?

williammartin avatar Sep 17 '19 13:09 williammartin