Skip to content

Commit 7b5a501

Browse files
Merge pull request #9537 from akclace/master
Add Clace framework
2 parents 11b03e4 + e23312d commit 7b5a501

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

frameworks/Python/clace/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.venv
2+
README.md

frameworks/Python/clace/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Introduction
2+
3+
[Clace](https://github.com/claceio/clace) is a platform for developing and deploying internal tools.
4+
5+
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.
6+
7+
# Benchmarking
8+
9+
The JSON and plaintext tests are implemented. Clace supports SQLite database only currently, so the database tests are not implemented.
10+
11+
The Dockerfile starts the Clace server and creates a single app which implements the benchmark apis (app.star).

frameworks/Python/clace/app.star

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
app = ace.app("testapp",
2+
routes = [
3+
ace.api("/json", lambda req: {'message': 'Hello, world!'}, type=ace.JSON),
4+
ace.api("/plaintext", lambda req: 'Hello, world!', type=ace.TEXT)
5+
]
6+
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"framework": "clace",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"port": 8080,
9+
"approach": "Realistic",
10+
"classification": "Micro",
11+
"framework": "Clace",
12+
"language": "python",
13+
"flavor": "Starlark",
14+
"platform": "None",
15+
"webserver": "Clace",
16+
"os": "Linux",
17+
"display_name": "Clace",
18+
"notes": "",
19+
"versus": "None"
20+
}
21+
}
22+
]
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.11
2+
WORKDIR /clace/
3+
4+
RUN curl -L https://clace.io/install.sh | bash
5+
ENV CL_HOME="/root/clhome"
6+
ENV PATH="/root/clhome/bin:$PATH"
7+
8+
COPY . .
9+
10+
EXPOSE 8080
11+
CMD /clace/run.sh

frameworks/Python/clace/run.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
cd /root
3+
4+
cat <<EOF > /root/clhome/clace.toml
5+
[logging]
6+
console = false
7+
file = false
8+
access_logging = false
9+
10+
[http]
11+
host = "0.0.0.0"
12+
port = 8080
13+
EOF
14+
15+
16+
clace server start &
17+
sleep 2
18+
clace app create --auth=none --approve /clace tfb-server:/
19+
tail -f /dev/null

0 commit comments

Comments
 (0)