diff --git a/__tests__/e2e/custom.debian11/python/code/.gitignore b/__tests__/e2e/custom.debian11/python/code/.gitignore deleted file mode 100644 index 0125409..0000000 --- a/__tests__/e2e/custom.debian11/python/code/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -python -__pycache__ diff --git a/__tests__/e2e/custom.debian11/python/code/gunicorn_conf.py b/__tests__/e2e/custom.debian11/python/code/gunicorn_conf.py deleted file mode 100644 index 8b6f7a9..0000000 --- a/__tests__/e2e/custom.debian11/python/code/gunicorn_conf.py +++ /dev/null @@ -1,6 +0,0 @@ -bind = "0.0.0.0:9000" -workers = 1 -threads = 2 -keepalive = 900 -accesslog = "-" -errorlog = "-" diff --git a/__tests__/e2e/custom.debian11/python/code/requirements.txt b/__tests__/e2e/custom.debian11/python/code/requirements.txt deleted file mode 100644 index 3fa017f..0000000 --- a/__tests__/e2e/custom.debian11/python/code/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -gunicorn -flask \ No newline at end of file diff --git a/__tests__/e2e/custom.debian11/python/code/server.py b/__tests__/e2e/custom.debian11/python/code/server.py deleted file mode 100644 index ebbd53a..0000000 --- a/__tests__/e2e/custom.debian11/python/code/server.py +++ /dev/null @@ -1,52 +0,0 @@ -from flask.logging import default_handler -import time -from flask import Flask -from flask import request -import json -import sys -import traceback -import logging - - -log = logging.getLogger("werkzeug") -log.setLevel(logging.ERROR) - - -app = Flask(__name__) - - -REQUEST_ID_HEADER = "x-fc-request-id" - - -@app.route("/invoke", methods=["POST"]) -def event_invoke(): - rid = request.headers.get(REQUEST_ID_HEADER) - print("FC Invoke Start RequestId: " + rid) - - data = request.stream.read() - print(data) - - try: - # do your things, for example: - evt = json.loads(data) - print(evt) - except Exception as e: - exc_info = sys.exc_info() - trace = traceback.format_tb(exc_info[2]) - errRet = {"message": str(e), "stack": trace} - print(errRet) - print("FC Invoke End RequestId: " + rid) - return errRet, 404, [("x-fc-status", "404")] - - print("FC Invoke End RequestId: " + rid) - - return data - - -@app.route("/", methods=["GET"]) -def home(): - return "hello world\n" - - -if __name__ == "__main__": - app.run(host="0.0.0.0", port=9000) diff --git a/__tests__/e2e/custom.debian11/python/s.yaml b/__tests__/e2e/custom.debian11/python/s.yaml deleted file mode 100644 index a12c537..0000000 --- a/__tests__/e2e/custom.debian11/python/s.yaml +++ /dev/null @@ -1,31 +0,0 @@ -edition: 3.0.0 -name: test-custom-debian11-python -access: "quanxi" - -vars: - region: ${env('REGION', 'cn-huhehaote')} - -resources: - helloworld: - component: ${env('fc_component_version', path('../../../../'))} - props: - region: ${vars.region} - functionName: fc3-event-debian11-${env('fc_component_function_name', 'python310')} - handler: index.handler - timeout: 60 - memorySize: 1536 - cpu: 1 - diskSize: 512 - runtime: custom.debian11 - code: ./code - instanceConcurrency: 10 - environmentVariables: - PYTHONPATH: /code/python - PATH: /code/python/bin:/usr/local/bin/apache-maven/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ruby/bin - customRuntimeConfig: - command: - - gunicorn - args: - - '-c' - - 'gunicorn_conf.py' - - 'server:app' diff --git a/__tests__/e2e/custom.debian11/run b/__tests__/e2e/custom.debian11/run index 552648e..b8d04c5 100755 --- a/__tests__/e2e/custom.debian11/run +++ b/__tests__/e2e/custom.debian11/run @@ -12,17 +12,3 @@ s info -t ./go/s.yaml s remove -y -t ./go/s.yaml rm -rf ./go/code/target -echo "test custom.debian11 python runtime ..." -rm -rf ./python/code/python -rm -rf ./python/code/__pycache__ -export fc_component_function_name=python311-$(uname)-$(uname -m) -s build -t ./python/s.yaml -s local invoke -e '{"hello":"fc custom.debian11 python"}' -t ./python/s.yaml -s deploy -y -t ./python/s.yaml -s invoke -e '{"hello":"fc custom.debian11 python"}' -t ./python/s.yaml -s info -t ./python/s.yaml -s remove -y -t ./python/s.yaml - -rm -rf ./go/code/target -rm -rf ./python/code/python -rm -rf ./python/code/__pycache__ diff --git a/__tests__/e2e/nodejs/code/package-lock.json b/__tests__/e2e/nodejs/code/package-lock.json deleted file mode 100644 index 0e6366b..0000000 --- a/__tests__/e2e/nodejs/code/package-lock.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "name": "code", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "code", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "chalk": "^4.1.0" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - } - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } - } -} diff --git a/__tests__/e2e/python/code/index.py b/__tests__/e2e/python/code/index.py index 03d9a97..84f7423 100644 --- a/__tests__/e2e/python/code/index.py +++ b/__tests__/e2e/python/code/index.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import subprocess -import fc2 from bs4 import BeautifulSoup import logging import flask diff --git a/example/readme copy.md b/example/readme copy.md deleted file mode 100644 index 08dfd82..0000000 --- a/example/readme copy.md +++ /dev/null @@ -1,85 +0,0 @@ -> 注:当前项目为 Serverless Devs 应用,由于应用中会存在需要初始化才可运行的变量(例如应用部署地区、函数名等等),所以**不推荐**直接 Clone 本仓库到本地进行部署或直接复制 s.yaml 使用,**强烈推荐**通过 `s init ${模版名称}` 的方法或应用中心进行初始化,详情可参考[部署 & 体验](#部署--体验) 。 - -# start-fc3-python 帮助文档 - -
- -
-
-| |
|
|
-| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
-|