Skip to content

Commit 029b087

Browse files
committed
Added container section
1 parent e309c85 commit 029b087

File tree

8 files changed

+110
-37
lines changed

8 files changed

+110
-37
lines changed

content/_index.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@ layout: hextra-home
55

66
<div class="hx-mt-6 hx-mb-6" style="background: #277A9F; background: linear-gradient(180deg, #277A9F, #359ece); color: transparent; background-clip: text; -webkit-background-clip: text;">
77
{{< hextra/hero-headline >}}
8-
Web app deployment platform
8+
Container-Native Application Server
99
{{< /hextra/hero-headline >}}
1010
</div>
1111

1212
<div class="hx-mb-12">
1313
{{< hextra/hero-subtitle >}}
14-
Easy, light-weight web app &nbsp;<br class="sm:hx-block hx-hidden"/> management for internal tools
14+
AppServer for containerized deployment of web apps.&nbsp;<br class="sm:hx-block hx-hidden"/>
15+
Cross platform across Linux, Windows and OSX.
1516
{{< /hextra/hero-subtitle >}}
17+
1618
</div>
1719

1820
<br>
1921
<div class="hx-mb-6">
2022
{{< hextra/hero-button text="Get Started" link="docs/quickstart" >}}
2123
</div>
22-
<br>
2324

2425
{{< hextra/feature-grid >}}
2526

26-
<!-- prettier-ignore --> {{< hextra/feature-card title="What is Clace?" subtitle="Clace™ is an Apache-2.0 licensed project building a web app development and deployment platform for internal tools. Clace allows easy and secure hosting of multiple web apps, in any language/framework, on a single machine. Clace is cross-platform (Linux/Windows/OSX) and provides a GitOps workflow for managing web apps." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
27+
<!-- prettier-ignore --> {{< hextra/feature-card title="What is Clace?" subtitle="Clace™ is an Apache-2.0 licensed application server for web apps. Clace enables easy and secure hosting and management of multiple web apps written in any language/framework. Clace is cross-platform (Linux/Windows/OSX) and provides a GitOps workflow for managing web apps." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
2728

28-
<!-- prettier-ignore --> {{< hextra/feature-card title="How does it work?" subtitle="Clace combines the functionality of a reverse proxy (programmable in Starlark) and a container orchestrator (using Docker or Podman) in a single lightweight binary. Start Clace server and ensure Docker or Podman is running. Apps can be installed directly from GitHub source repo. Clace builds the image and starts the container lazily, on the first API call." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
29+
<!-- prettier-ignore --> {{< hextra/feature-card title="How does it work?" subtitle=" Clace implements a language/framework agnostic application server. Clace combines the functionality of a reverse proxy and a container orchestrator (using Docker or Podman) in a single lightweight binary. Clace builds images and runs containers directly from GitHub source repo." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
2930

30-
<!-- prettier-ignore --> {{< hextra/feature-card title="What can it be used for?" subtitle="Clace can be used on a dev machine during web app development. The app can then be deployed on a shared Clace server, adding OAuth authentication as required. Apps are deployed directly from the git repo, no build step required. For example, Clace can be used to deploy multiple Streamlit apps on a server shared across a team, using GitOps for managing CI/CD." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
31+
<!-- prettier-ignore --> {{< hextra/feature-card title="What can it be used for?" subtitle="Clace can be used during app development, handling all env setup with live reload. Apps can then be deployed on a Clace server, adding OAuth authentication. For example, Clace can be used to deploy multiple Flask/Streamlit/FastAPI apps on a server shared across a team, using GitOps for managing CI/CD." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
3132

3233
{{< /hextra/feature-grid >}}
3334
<br>
@@ -53,28 +54,28 @@ layout: hextra-home
5354

5455
{{< hextra/feature-grid >}}
5556

56-
<!-- prettier-ignore --> {{< hextra/feature-card title="Container management" link="docs/quickstart/#containerized-applications" subtitle="Automatically build and and deploy containers, with Docker or Podman." icon="docker" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
57+
<!-- prettier-ignore --> {{< hextra/feature-card title="Container management" link="docs/quickstart/#containerized-applications" subtitle="Automatically build and deploy containers, with Docker or Podman." icon="docker" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
5758

5859
<!-- prettier-ignore --> {{< hextra/feature-card title="GitOps Workflow" link="docs/quickstart/#lifecycle-with-git" subtitle="Blue-green (staged) deployments, versioning and preview environments with no infra to manage." icon="github" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
5960

6061
<!-- prettier-ignore --> {{< hextra/feature-card title="Hypermedia web apps" link="docs/app/routing/#html-route" subtitle="Fast and lightweight backend driven apps, minimal frontend complexity." icon="html5" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
6162

6263
<!-- prettier-ignore --> {{< hextra/feature-card title="No build step" link="docs/app/overview/#app-lifecycle" subtitle="Backend and frontend development with no build artifacts to manage, deploy directly from the source repo." icon="binary-off" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
6364

64-
<!-- prettier-ignore --> {{< hextra/feature-card title="Lazy App Initialization" link="docs/quickstart/#containerized-applications" subtitle="Apps are initialized lazily, on demand: scale down to zero automatically." icon="pause" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
65+
<!-- prettier-ignore --> {{< hextra/feature-card title="Scale down to zero" link="docs/quickstart/#containerized-applications" subtitle="Apps are initialized lazily, on demand: scale down to zero automatically." icon="pause" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
6566

66-
<!-- prettier-ignore --> {{< hextra/feature-card title="Cross-platform support" link="docs/quickstart/#installation" subtitle="Clace runs on Linux, Windows and OSX, works with Docker and Podman" icon="globe-alt" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
67+
<!-- prettier-ignore --> {{< hextra/feature-card title="Cross-platform" link="docs/quickstart/#installation" subtitle="Clace runs natively on Linux, Windows and OSX and works with Docker or Podman" icon="globe-alt" style="background: radial-gradient(ellipse at 50% 80%,rgba(102, 89, 186, 0.25),hsla(0,0%,100%,0));" >}}
6768

6869
{{< /hextra/feature-grid >}}
6970

7071
<br>
7172

7273
{{< hextra/feature-grid >}}
7374

74-
<!-- prettier-ignore --> {{< hextra/feature-card title="Comparison with other tools" subtitle="Other tools for simplifying containerized deployment are Linux specific. They are built on top of reverse proxies (Traefik/Nginx), using container labels for routing. They are built for prod deployment only, not for dev. Adding OAuth or access control are not easy with other solutions." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
75+
<!-- 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));" >}}
7576

76-
<!-- prettier-ignore --> {{< hextra/feature-card title="Comparison with cloud services" subtitle="Cloud services like Cloud Run simplify the deployment of containerized web apps. They run outside your existing infrastructure, making it difficult to talk to your existing systems. Clace provides a similar easy to use interface. Instead of doing this as a cloud service, Clace does this on your hardware." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
77+
<!-- 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));" >}}
7778

78-
<!-- prettier-ignore --> {{< hextra/feature-card title="How is Clace different?" subtitle="Clace is a single binary, cross-platform and can be used during development. Adding OAuth and access control and atomic updates across multiple apps is easy. Clace is built for the internal tools use-case, allowing for services to be deployed and shared across a team securely." style="background: radial-gradient(ellipse at 50% 80%,rgba(89, 67, 7, 0.15),hsla(0,0%,100%,0));" >}}
79+
<!-- 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));" >}}
7980

8081
{{< /hextra/feature-grid >}}

content/docs/App/Overview.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ summary: "Overview of the Clace application development model"
77

88
Clace supports deploying any type of app, in any language/framework, using containerized apps. Apps can also be built where the backend API is in the container but the UI is built using Clace. Clace UI applications implement a [Hypermedia driven approach](https://hypermedia.systems/hypermedia-reintroduction/) for developing web applications. Applications return HTML fragments as API response using [Go html templates](https://pkg.go.dev/html/template). The UI uses HTML enhanced with hypermedia controls using the [HTMX library](https://htmx.org/) to implement user interactions.
99

10-
The backend API routes and dependencies like CSS library, JavaScript modules etc are configured using [Starlark](https://github.com/google/starlark-go/blob/master/doc/spec.md) configuration. Any custom API handling required is implemented in handler functions also written in Starlark. Starlark is a subset of python, optimized for application configuration usecases.
10+
The backend API routes and dependencies like CSS library, JavaScript modules etc are configured using [Starlark](https://github.com/google/starlark-go/blob/master/doc/spec.md) configuration. Any custom API handling required is implemented in handler functions also written in Starlark. Starlark is a subset of python, optimized for application configuration use-cases.
1111

1212
## App Types
1313

1414
Clace apps can be of three types:
1515

16+
- **Containerized apps**: The whole app is implemented in a container, Clace proxies the container results. This uses the container and proxy plugins. No Starlark code is required for this.
1617
- **Starlark apps**: These use the Clace plugins to implement the whole app. No containers are required for such apps.
17-
- **Containerized apps**: The whole app is implemented in a container, Clace proxies the container results. This uses the container and proxy plugins.
1818
- **Hybrid apps**: The backend APIs are implemented in a container. Clace is used to implement the Hypermedia based UI using Starlark handlers. This uses the http plugin to talk to the backend API and the container plugin to configure the backend.
1919

20+
This section of the docs covers Starlark and Hybrid apps. For a containerized app, the `--spec` definition includes all the app definition. There is no need to do any custom Starlark config for a regular containerized app.
21+
2022
## Structure
2123

2224
The structure of a Clace application is:
@@ -115,7 +117,7 @@ and an `~/myapp3/app.go.html` file containing
115117

116118
Run `clace app create --auth=none --dev ~/myapp3 /hello3 `. After that, the app is available at `/hello3`. Note that the `--dev` option is required for the `index_gen.go.html` file to be generated.
117119

118-
The name of the app is hello3. There is only one route defined, for page /, which shows a HTML page with the name of the app. The body is generated from the contents of the app.go.html file. A more verbose way to write the same app config would be
120+
There is only one route defined, for page /, which shows a HTML page with the name of the app. The body is generated from the contents of the app.go.html file. A more verbose way to write the same app config would be
119121

120122
```python {filename="app.star"}
121123
app = ace.app(name="hello3",
@@ -226,7 +228,7 @@ ensures that the specs are updated to the latest version. Periodically doing a g
226228

227229
## App Parameters
228230

229-
Having a file `params.star` in the app source code causes Clace to load the parameters definitions from that file. Parameters are environment value which can be specified during app creation. A sample param definition is
231+
Having a file `params.star` in the app source code causes Clace to load the parameters definitions from that file. Parameters are environment values which can be specified during app creation. A sample param definition is
230232

231233
```python {filename="params.star"}
232234
param("port", type=INT,
@@ -251,7 +253,7 @@ The parameters are available in the app Starlark code, through the `param` names
251253

252254
Params are set, during app creation using `app create --param port=9000` or using `param update port 9000 /myapp`. Set value to `-` to delete the param. Use `param list /myapp` to list the params.
253255

254-
For containerized apps, all params specified for the app (including ones not specified in `params.star` spec) are passed to the container at runtime as environment parameters. `CL_APP_PATH` is a special param passed to the container with the app installation path (without the domain name).
256+
For containerized apps, all params specified for the app (including ones not specified in `params.star` spec) are passed to the container at runtime as environment parameters. `CL_APP_PATH` is a special param passed to the container with the app installation path (without the domain name). `PORT` is also set with the value of the port number the app is expected to bind to within the container.
255257

256258
## Automatic Error Handling
257259

content/docs/App/_index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: "Developing Apps"
2+
title: "Hypermedia Apps"
33
weight: 400
44
date: 2023-10-05
5-
summary: "Developing Clace applications, managing API routes and HTML templates"
5+
summary: "Developing Hypermedia driven applications, managing API routes and HTML templates"
66
---
77

8-
Details about developing Clace applications, managing API routes and HTML templates.
8+
Details about developing Hypermedia driven Clace applications, managing API routes and HTML templates.
99

1010
{{< cards >}}
1111
{{< card link="overview" title="Overview" subtitle="Overview of a Clace app, sample apps" icon="zoom-in" >}}

content/docs/Container/Overview.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "Container Overview"
3+
weight: 100
4+
summary: "Overview of Clace containerized apps"
5+
---
6+
7+
## Containerized App
8+
9+
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.
10+
11+
## App Specs
12+
13+
Clace app specs are defined at https://github.com/claceio/appspecs. Most specs use containers, the `proxy` spec is an exception.
14+
15+
## App Config
16+
17+
needs to have a `Containerfile` (or `Dockerfile`) to define how the image is built. The app definition can have
18+
19+
<!-- prettier-ignore -->
20+
```html {filename="app.star"}
21+
load("proxy.in", "proxy")
22+
load("container.in", "container")
23+
24+
app = ace.app("My App",
25+
routes=[
26+
ace.proxy("/", proxy.config(container.URL))
27+
],
28+
container=container.config(container.AUTO),
29+
permissions=[
30+
ace.permission("proxy.in", "config", [container.URL]),
31+
ace.permission("container.in", "config", [container.AUTO])
32+
]
33+
)
34+
```
35+
36+
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.
37+
38+
<!-- prettier-ignore-end -->

content/docs/Container/_index.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: "Containerized Apps"
3+
weight: 350
4+
summary: "Developing containerized applications with Clace"
5+
---
6+
7+
Details about developing containerized Clace applications.
8+
9+
{{< cards >}}
10+
{{< card link="overview" title="Overview" subtitle="Overview of a containerized Clace app" icon="zoom-in" >}}
11+
{{< card link="state" title="Container State" subtitle="Details about the container state management" icon="inbox-in" >}}
12+
{{< /cards >}}

go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ module github.com/claceio/docs
22

33
go 1.19
44

5-
require (
6-
github.com/imfing/hextra v0.7.3 // indirect
7-
)
5+
require github.com/imfing/hextra v0.8.2 // indirect

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github.com/imfing/hextra v0.7.3 h1:dVGA1NTcWe+FaUMdrawEypPfrrmulq5NoK0we3nC330=
2-
github.com/imfing/hextra v0.7.3/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI=
1+
github.com/imfing/hextra v0.8.2 h1:/IykSIAywgKfhKUBgAW+dCCjrJWJNny4jr9qvdXfch0=
2+
github.com/imfing/hextra v0.8.2/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI=

0 commit comments

Comments
 (0)