How to build reusable patterns and compose them? #1704
Unanswered
raphael-beck
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I rather recently discovered CALM and I find it is a beautiful and promising project.
I've been hacking around last two weeks with the repository and I'm stuck with some questions.
Full disclosure: I plan to implement it as a standard for teams in my company.
First issue: Reuse patterns for the same target architecture
I want to define patterns, implement them for portion of architectures and reuse it multiple times in a global architecture. With a microservice pattern, I expect to have it multiple times in my target architecture.
For example: 2 microservices each talking to their own database and the two services linked (the first one calls the second one)
I've defined a pattern for Java microservices
microservice-java-calm.pattern.jsonwhich is composed ofNodes:
Relationships
Java micro service => postgresql database with
kubernetes cluster which contains [Java micro service, postgresql database]
So far so good.
Now I generate a first architecture file with the calm-cli
calm generate -p patterns/microservice-java.pattern.json -s calm/schemas/ -o ems.arch.jsonand a second
calm generate -p patterns/microservice-java.pattern.json -s calm/schemas/ -o sme.arch.jsonFrom there I'm lost. I cannot merge the two files to create a single architecture as ids are uniques (unique-id). I cannot change unique-id as it will not validate.
I'm pretty sure I'm missing something on how to use patterns.
Second issue: How to reference a custom JSON schema?
I liked
port-interfaceandcontainer-image-interfacefrom the first versions of calm schemas. In RC1 they have been removed and it's ok but I'd like to extend with my own schemas and from there I'm lost again.I've created
interface_mycompany.jsonschemaand tried to use it in a pattern
I can generate the architecture
calm generate -p patterns/microservice-java.pattern.json -s calm/schemas/ -o ems-api-mycompany2.arch.jsoncalm/schemas/ contains
interface_mycompany.jsonThen I try to validate and it doesn't work
calm validate -p patterns/microservice-java-mycompany.pattern.json -s calm/schemas/ -a ems-api-mycompany2.arch.jsonThere is the suggestion to use the CALM Hub. I've loaded the schema in a local CALM Hub instance but I don't know how to reference the schema from the Hub when validating. By the way I can't load two schema files with the same name
Sorry for the long message but I'm really interested to use CALM!
Thank you for your help
Beta Was this translation helpful? Give feedback.
All reactions