Skip to content

Commit

Permalink
Merge pull request #9537 from akclace/master
Browse files Browse the repository at this point in the history
Add Clace framework
  • Loading branch information
msmith-techempower authored Jan 16, 2025
2 parents 11b03e4 + e23312d commit 7b5a501
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frameworks/Python/clace/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.venv
README.md
11 changes: 11 additions & 0 deletions frameworks/Python/clace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Introduction

[Clace](https://github.com/claceio/clace) is a platform for developing and deploying internal tools.

Clace is implemented in Go. Clace apps are written in [Starlark](https://starlark-lang.org/). Starlark is a thread-safe language with Python syntax, designed for embedding. Clace uses the [Starlark Go](https://github.com/google/starlark-go) implementation. Since apps are developed using a python like syntax, the benchmark is added under the Python category.

# Benchmarking

The JSON and plaintext tests are implemented. Clace supports SQLite database only currently, so the database tests are not implemented.

The Dockerfile starts the Clace server and creates a single app which implements the benchmark apis (app.star).
6 changes: 6 additions & 0 deletions frameworks/Python/clace/app.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app = ace.app("testapp",
routes = [
ace.api("/json", lambda req: {'message': 'Hello, world!'}, type=ace.JSON),
ace.api("/plaintext", lambda req: 'Hello, world!', type=ace.TEXT)
]
)
23 changes: 23 additions & 0 deletions frameworks/Python/clace/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"framework": "clace",
"tests": [
{
"default": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"framework": "Clace",
"language": "python",
"flavor": "Starlark",
"platform": "None",
"webserver": "Clace",
"os": "Linux",
"display_name": "Clace",
"notes": "",
"versus": "None"
}
}
]
}
11 changes: 11 additions & 0 deletions frameworks/Python/clace/clace.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.11
WORKDIR /clace/

RUN curl -L https://clace.io/install.sh | bash
ENV CL_HOME="/root/clhome"
ENV PATH="/root/clhome/bin:$PATH"

COPY . .

EXPOSE 8080
CMD /clace/run.sh
19 changes: 19 additions & 0 deletions frameworks/Python/clace/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
cd /root

cat <<EOF > /root/clhome/clace.toml
[logging]
console = false
file = false
access_logging = false
[http]
host = "0.0.0.0"
port = 8080
EOF


clace server start &
sleep 2
clace app create --auth=none --approve /clace tfb-server:/
tail -f /dev/null

0 comments on commit 7b5a501

Please sign in to comment.