Skip to content

Commit

Permalink
Update container docs
Browse files Browse the repository at this point in the history
  • Loading branch information
akclace committed Sep 3, 2024
1 parent ea2b5a4 commit a47c3a0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ layout: hextra-home

<!-- prettier-ignore --> {{< hextra/feature-card title="Comparison with other tools" subtitle="Open source PaaS solutions are built on top of reverse proxies (Traefik/Nginx) and work on Linux only. They support prod deployment only, not use in dev. They aim to be a simplified Kubernetes, providing pre-packaged apps, including support for deploying stateful applications like databases. <br><br>Clace is simpler because it does not aim to be a PaaS solution. Compared to other AppServers, Clace supports all languages and does not require any code changes in the app. Running in containers gives better isolation across apps. Clace is a single binary and runs natively on all platforms." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}

<!-- prettier-ignore --> {{< hextra/feature-card title="Comparison with cloud services" subtitle=" Google Cloud Run/AWS AppRunner allow easy deployment of containerized web apps. They run outside your existing infrastructure, making it difficult to talk to your existing systems. When deploying multiple small apps, cost can become a factor, especially when larger instances are required.<br><br>Clace provides a similar easy to use interface, including scale down to zero, on your own hardware. Hundred of apps can be hosted on a single Clace serve. Apps are lazy-initialized and scale down to zero when idle. Costs are fixed, there are no unexpected bills when API volume increases." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
<!-- prettier-ignore --> {{< hextra/feature-card title="Comparison with cloud services" subtitle=" Google Cloud Run/AWS AppRunner allow easy deployment of containerized web apps. They run outside your infrastructure, making it difficult to talk to your existing systems. When deploying multiple small apps, cost can become a factor, especially when larger instances are required.<br><br>Clace provides a similar easy to use interface, including scale down to zero, on your own hardware. Hundred of apps can be hosted on a single Clace serve. Apps are lazy-initialized and scale down to zero when idle. Costs are fixed, there are no unexpected bills when API volume increases." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}

<!-- prettier-ignore --> {{< hextra/feature-card title="How is Clace different?" subtitle="Clace provides a Cloud Run type experience on your hardware. Code and config changes are blue-green staged for deployment. Multiple apps can be updated atomically (all-or-nothing), no broken state after deployment failures. <br><br>Clace is built for the application management lifecycle across a team, not just the initial installation. Clace has OAuth support and security sand-boxing features which allow operations teams to easily manage applications through GitOps while allowing development teams to freely make code changes." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}

Expand Down
22 changes: 19 additions & 3 deletions content/docs/Container/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,31 @@ summary: "Overview of Clace containerized apps"

## Containerized App

A containerized app runs the backend APIs in a container. Clace builds the image and manages the container lifecycle. It is also possible to specific an image to use.
Clace builds the image and manages the container lifecycle for containerized apps. It is also possible to specific an image to use.

## App Specs

Clace app specs are defined at https://github.com/claceio/appspecs. Most specs use containers, the `proxy` spec is an exception.

The `image` spec specifies the image to use. for example

```shell
clace app create --spec image --approve --param image=nginx --param port=80 - nginxapp.localhost:/
```

downloads the nginx image, starts it and proxies any request to `nginxapp.localhost` (on the Clace server port, 25223 default) to the nginx containers port 80. The container is started on the first API call, and it is stopped automatically when there are no API calls.

For all other specs, the `Containerfile` is defined in the spec. For example, for the `python-streamlit` spec, the Containerfile is [here](https://github.com/claceio/appspecs/blob/main/python-streamlit/Containerfile). Running

```shell
clace app create --spec python-streamlit --branch master --approve github.com/streamlit/streamlit-example /streamlit_app
```

will create an app at https://localhost:25223/streamlit_app. On the first API call to the app, the image is built from the defined spec and the container is started.

## App Config

needs to have a `Containerfile` (or `Dockerfile`) to define how the image is built. The app definition can have
The app needs to have a `Containerfile` (or `Dockerfile`) to define how the image is built. The app Starlark config is usually like:

<!-- prettier-ignore -->
```html {filename="app.star"}
Expand All @@ -33,6 +49,6 @@ app = ace.app("My App",
)
```

which completely specifies the app. This is saying that the app is using the container plugin to configure the container and the proxy plugin to proxy all API calls (`/` route) to the container url. On the first API call to the app, Clace will build the image, start the container and proxy the API traffic to the appropriate port. No other configuration is required in Starlark. If the container spec does not define the port being exposed, then the container config needs to specify the port number to use. The port number can be parameterized.
which completely specifies the app. This is saying that the app is using the container plugin to configure the container and the proxy plugin to proxy all API calls (`/` route) to the container url. On the first API call to the app, Clace will build the image, start the container and proxy the API traffic to the appropriate port. No other configuration is required in Starlark. If the container spec does not define the port being exposed, then the container config needs to specify the port number to EXPOSE. The port number can be parameterized.

<!-- prettier-ignore-end -->

0 comments on commit a47c3a0

Please sign in to comment.