Setup
After you have signed up and enrolled your cloud account as mentioned here, you can start building your SaaS.
There are different ways to build SaaS with Omnistrate. We discussed about the different ways that we support today here. Many projects already have a compose specification defined for developers to run it locally. We can use the same specification to build your SaaS.
These are your options when building your SaaS using Omnistrate:
Setup using API
For APIs, please see the API docs here
Setup using UI/CLI
For UI/CLI, please visit our cloud dashboard page and follow the instructions here
For any feedback, please reach out to us at support@omnistrate.com
Setup using Compose
What is Compose standard?
Compose is a powerful tool for defining and running multi-container applications and is used widely by many-many open source projects as a goto mechanism to deploy projects locally. With Compose, you can specify all the services, networks, volumes, and their relationships in a single, easy-to-read YAML file. Here are some of the key features of the Compose standard:
-
Service Definitions: Compose spec allows you to define individual services as containers within your application stack. Each service can be configured with specific settings like the Docker image to use, environment variables, and container dependencies.
-
Orchestration: You can define how different containers interact with each other, specifying dependencies and order of startup, ensuring that your application components start and stop in the desired sequence.
-
Network Configuration: It allows you to create and manage a network for your application containers to communicate with each other using service names instead of IP addresses.
-
Volume Management: You can define named volumes in your Compose file, making it easy to persist data between container restarts or share data between services.
-
Environment Variables: It supports setting environment variables for your containers, simplifying configuration management and customization.
-
Scaling: You can easily scale services up or down, running multiple instances of a container for load balancing or high availability.
Compose usage
Getting Started
To start using Compose, you'll need to define a docker-compose.yml file that describes your application's services and their configurations. Then, you can use simple commands like docker-compose up
to start your application stack and docker-compose down
to stop and remove it.
Steps to build and validate your compose config
Before you submit your compose spec, here are some of the steps to keep in mind:
Step 1: Render their docker-compose
Clone your repo and run:
This will dump the rendered version of the compose specification into a file.
Step 2: Check the rendered.yaml spec
We have a few limitations today, explained in details here.
If the spec contains any of these, we need to work together to prepare a docker image that has these baked directly into your image as one of the layers or set up a different mechanism to achieve the same functionality.
Fun exercise: After adapting your compose, if you are interested in generating an architecture diagram from the rendered spec, you can try this
Step 3: Validate by running locally
Validate the compose specification by running it locally on your laptop
Extending compose specification for your SaaS
As discussed above, SaaS is much more involved than running it locally. We have defined several compose tags to allow you to extend your compose specification to build your SaaS:
- Configure your cloud provider account using
x-omnistrate-my-account
andx-omnistrate-byoa
tags - Make a service component distributed with multiple replicas using
x-omnistrate-compute
- Add a reverse proxy to HTTP-based services or other capabilities using
x-omnistrate-capabilities
- Customize visibility, logging, metering of a service using:
x-omnistrate-integrations
- Customize API parameters for launching the service using
x-omnistrate-api-params
andx-omnistrate-mode-internal
- Inject custom code at different phases of your SaaS using
x-omnistrate-actionhooks
- Customize the compute / network / storage parameters of a service via
x-omnistrate-compute
and other corresponding tags
For more details on all the compose tags, please visit here
Example compose config
Additional resources
- Compose Documentation: The official documentation provides comprehensive information on using Compose effectively.
- Compose File Reference: A detailed guide to the Compose file format and its options.
- Docker Hub: Explore a vast repository of Docker images for various services and applications to use with Compose specification.