Skip to content

Add Clace framework #9537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading