Sfoglia il codice sorgente

Add robyn framework (#7025)

Luca Repetti 3 anni fa
parent
commit
ce91f09bc6

+ 29 - 0
frameworks/Python/robyn/README.md

@@ -0,0 +1,29 @@
+# Robyn Benchmarking Test
+
+This is the Robyn portion of a [benchmarking tests suite](../../)
+comparing a variety of web development platforms.
+
+The information below is specific to Robyn. For further guidance,
+review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki).
+Also note that there is additional information provided in
+the [Python README](../).
+
+## Description
+
+[**Robyn**](https://github.com/sansyrox/robyn) is an async Python backend server with a runtime written in Rust, btw.
+
+The framework is in active development, therefore tests paths will be added after the framework will support them.
+
+## Test Paths & Sources
+
+All of the test implementations are located within a single file ([app.py](app.py)).
+
+### PLAINTEXT
+
+http://localhost:8080/plaintext
+
+
+## Resources
+
+* [Robyn source code on GitHub](https://github.com/sansyrox/robyn)
+* [Robyn website - documentation](https://sansyrox.github.io/robyn/#/)

+ 25 - 0
frameworks/Python/robyn/app.py

@@ -0,0 +1,25 @@
+import multiprocessing
+import os
+
+from robyn import Robyn
+
+app = Robyn(__file__)
+
+
[email protected]('/plaintext')
+async def plaintext() -> str:
+    return "Hello, world!"
+
+
+if __name__ == '__main__':
+    _is_travis = os.environ.get('TRAVIS') == 'true'
+
+    workers = multiprocessing.cpu_count() * 2 + 1
+    if _is_travis:
+        workers = 2
+
+    app.processes = workers
+    app.add_header("Server", "Robyn")
+    app.add_header("Content-Type", "text/plain")
+
+    app.start(url="0.0.0.0", port=8080)

+ 23 - 0
frameworks/Python/robyn/benchmark_config.json

@@ -0,0 +1,23 @@
+{
+  "framework": "robyn",
+  "tests": [
+    {
+      "default": {
+        "plaintext_url": "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "framework": "Robyn",
+        "language": "Python",
+        "flavor": "None",
+        "orm": "Raw",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "display_name": "Robyn",
+        "notes": "",
+        "versus": "None"
+      }
+    }
+  ]
+}

+ 12 - 0
frameworks/Python/robyn/config.toml

@@ -0,0 +1,12 @@
+[framework]
+name = "Robyn"
+
+[main]
+urls.plaintext = "/plaintext"
+approach = "Realistic"
+classification = "Micro"
+os = "Linux"
+orm = "Raw"
+platform = "None"
+webserver = "None"
+versus = "None"

+ 1 - 0
frameworks/Python/robyn/requirements.txt

@@ -0,0 +1 @@
+robyn==0.11.1

+ 11 - 0
frameworks/Python/robyn/robyn.dockerfile

@@ -0,0 +1,11 @@
+FROM python:3.9
+
+ADD ./ /robyn
+
+WORKDIR /robyn
+
+RUN pip3 install -r /robyn/requirements.txt
+
+EXPOSE 8080
+
+CMD ["python", "app.py"]