Skip to content

Examples, inspiration, and templates for your ideas. This repository also includes source code for the Examples section on https://cosmonic.com/docs/category/examples

License

Notifications You must be signed in to change notification settings

cosmonic/awesome-cosmonic

Repository files navigation

Awesome Cosmonic

Awesome projects and source code for the Things To Build section on Cosmonic.

Deployment Link Topology
Event Sourced Bank Account Deploy on Cosmonic This example will deploy the Bank Account Aggregate, Process Manager and Projector alongside the Concordance provider and Event Catalog UI Actor.
Hello World on Cosmonic Deploy on Cosmonic This example will deploy Hello World actor and HTTP Server Provider all on Cosmonic.
Hello World on Stargate Deploy on Cosmonic This example will deploy Hello World on a remote stargate node, and the HTTP Server Provider on Cosmonic. In order for this manifest to work you will need at least one stargate host deployed.
XKCD Generator on Cosmonic Deploy on Cosmonic This example will deploy the XKCD actor, HTTP Client Provider, and HTTP Server Provider all on Cosmonic.
XKCD Generator on Stargate Deploy on Cosmonic This example will deploy the XKCD actor & HTTP Client Provider on a remote stargate node, and the HTTP Server Provider on Cosmonic. In order for this manifest to work you will need at least one stargate host deployed.

How does it work?

One of the powerful things about Cosmonic is that your basic application architecture can be deployed to dramatically different application topologies all without changing or modifying your architecture. In the simple examples below we use Open Application Manifest WADM Manifests to automatically deploy applications to Cosmonic.

Some manifests require multiple Cosmonic hosts connected to your Constellation. Please follow the Cosmonic Getting Started Guide to deploy a host or simply:

bash -c "$(curl -fsSL https://cosmonic.sh/install.sh)"

Host Labels

Just like Kubernetes, Cosmonic can leverage labels as a mechanism for defining and configuring application topology and deployments. There are a handful of labels that are automatically defined by default for you depending on where the host is executing:

Label Hosts Definition
hostcore.arch=aarch64 ALL CPU Architecture
hostcore.os=linux ALL Host OS
hostcore.osfamily=unix ALL Host OS Family
cosmonic_managed=true Cosmonic Hosts managed by Cosmonic
stargate=true Remote Only A label automatically applied to hosts remotely attached to a Constellation

You can define your own labels and leverage them to manage your application. You can schedule an application to run on specific nodes and on specific node types. Component providers for things like databases can be scheduled to run near their provider or you can achieve higher reliability, availability, or performance simply by updating your application manifest. Constellations are self-forming, self-healing, and allow for the automatic discovery of capabilities.

Application Version Control

Using the above manifests you can deploy multiple versions of your application and easily switch between different deployment topologies. Many of the applications have the same name, such as xkcd and different versions. On Cosmonic, find the controls under Applications --> App --> Versions:

Cosmonic Applications Version Control Screen Shot

If you inspect two different versions of an application manifest you can see how the different tags change the application topology. In the above example for the xkcd Application you can see two different versions: v1-cosmonic and v1-stargate. As you can see below, the two key differences are the version: tag and then the tags under a components requirements:. You can see we direct WADM to deploy the components to the stargate hosts using the stargate: 'true' tag; it is commented out but I could further direct this component by using a tag such as hostcore.os: macos.

Cosmonic Applications Version Control Screen Shot