Creating, Configuring And Launching Your System
Last updated
Last updated
To create a Cillers system, run the following command in your terminal. You can change 'my-system' to whatever you would like to name your system. Windows users should run this command in their WSL2 terminal. Make sure you have good internet access when you run this command because it fetches the code for your system from Github.
This command creates a new directory, my-system
or whatever you named it, in the same directory as you ran the command.
Open the my-systems
directory in your favorite code editor and have a quick look at the directory structure and the polytope.yml
file in your system's root directory.
As you can see in the polytope.yml
file your system is preconfigured with a demo which consists of a web app, an API and a Couchbase Capella component. You can also see that these components are provided with the parameters they need to connect with your Couchbase Capella cluster.
Further down in the polytope.yml
file you can see how the web app and API components load their code from the code
directory.
Now, expand the directory with your API component's code to see the basic structure. As you can see this is a Python app with Poetry as package manager. This is where you will make changes to build your API. We have a whole separate documentation section on how to work with your API component that we will get to later.
If you look around you may notice that the API and the web app communicate using GraphQL. You can learn how to change to REST in the Reconfiguring Your Cillers System section.
Your system is configured a) in the polytope.yml
file, b) with Polytope secrets and c) in component-specific configuration files.
polytope.yml
File Cillers has a specific structure for the polytope.yml
file to make it easy to configure and maintain Cillers systems.
Polytope has a different terminology than Cillers for components. Cillers components are made up of Polytope 'modules' and 'templates'. The lowest-level Cillers components are Polytope modules. The higher-level Cillers components are Polytope templates. And, you might find it a bit confusing but, Polytope templates are a completely different concept than Cillers templates. Cillers also uses Polytope templates to encapsulate different configurations for different environments. We are discussing with Polytope how to resolve these differences.
The ENVIRONMENTS section contains a set of Polytope templates with environment specific configurations. Different environments may also run slightly different components. E.g. some dev tool components may run in the development environment but not in other environments.
The STACK VARIANTS section contains a set of Polytope templates. The reason we have variants of the stack is that you may want to run slightly different stacks in different environments, e.g. you may want to run a locally hosted database on your development machine, but a cloud-hosted database in production. Polytope will soon build support for template branching which will enable us to collapse all stacks variants into one stack template for all environments with conditional component variants.
The MODULES section contains the lowest level Cillers components which are implemented as Polytope modules. A Polytope module may extend another module to provide some specialization of the submodule, but cannot contain multiple submodules.
If a module mounts code to run within the container, you need to make sure that the code
parameter is correctly configured. Here is an example of a module that mounts the ./code/web-app
directory. This means that the web-app code should be located in this directory in your project.
So, if you add a template component that consists of a Polytope module that loads code, you need to add the module to the polytope.yml
file and copy the templates code directory to the specified directory (or change the configured location).
You can integrate your system with external services, including cloud-hosted databases. Let's configure our system to integrate with Couchbase Capella as an example for how to do this.
First, you need a Couchbase Capella cluster. Follow these instructions on how to set that up. If you already have a cluster you can just continue.
Go to your Capella admin web UI to look up the connection string to your cluster. Click on your cluster and enter the "Connect" view. Copy the "Public Connection String."
Run the following command in your terminal in your project directory (the my-system
directory if you didn't choose a different name).
Paste the connection string into thecouchbase-host
setting at the top of the polytope.yml
file. Strip the couchbases://
prefix. Here is an excerpt from the ENVIRONMENTS section example provided above.
Now, your system is ready to connect to your Couchbase Capella cluster.
By default your system comes with a demo stack which consists of a React web app, a Python GraphQL API, A GraphQL API web client and a Couchbase Capella connection. The React web app and the GraphQL API has some example code that will help you see how to structure your code.
By default the API and web app code is loaded from the samples/code
directory. We recommend that you create your own api and web app directories in the code directory and work on your code there. You need to change the api and web-app modules in the polytope.yml file and specify where their respective code should be loaded from.
We provide free support! You can book a free support call here if you run into any issues: https://calendly.com/cillers/free-support
You can also reach us at our Discord server or check out our Trouble Shooting Guide.