From 30fc7df975aeba531e32a4769d700f09d76e45c6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 29 Mar 2021 13:14:20 +0545 Subject: [PATCH] python functions env 3.9 --- app/config/environments.php | 9 +++++++++ docker/environments/build.sh | 3 +++ docker/environments/python-3.9/Dockerfile | 11 +++++++++++ .../Services/Functions/FunctionsCustomServerTest.php | 8 ++++++++ 4 files changed, 31 insertions(+) create mode 100644 docker/environments/python-3.9/Dockerfile diff --git a/app/config/environments.php b/app/config/environments.php index 9f1c5638e1..c74db6fd35 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -70,6 +70,15 @@ $environments = [ 'logo' => 'python.png', 'supports' => [System::X86, System::PPC, System::ARM], ], + 'python-3.9' => [ + 'name' => 'Python', + 'version' => '3.9', + 'base' => 'python:3.9-alpine', + 'image' => 'appwrite/env-python-3.9:1.0.0', + 'build' => '/usr/src/code/docker/environments/python-3.9', + 'logo' => 'python.png', + 'supports' => [System::X86, System::PPC, System::ARM], + ], 'deno-1.2' => [ 'name' => 'Deno', 'version' => '1.2', diff --git a/docker/environments/build.sh b/docker/environments/build.sh index 1543c5814d..175389847f 100644 --- a/docker/environments/build.sh +++ b/docker/environments/build.sh @@ -24,6 +24,9 @@ docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 echo 'Python 3.8...' docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-python-3.8:1.0.0 ./docker/environments/python-3.8/ --push +echo 'Python 3.9...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-python-3.9:1.0.0 ./docker/environments/python-3.9/ --push + echo 'Ruby 2.7...' docker buildx build --platform linux/amd64,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-ruby-2.7:1.0.2 ./docker/environments/ruby-2.7/ --push diff --git a/docker/environments/python-3.9/Dockerfile b/docker/environments/python-3.9/Dockerfile new file mode 100644 index 0000000000..94b7b8ceb8 --- /dev/null +++ b/docker/environments/python-3.9/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.9-alpine + +LABEL maintainer="team@appwrite.io" + +RUN apk add tar + +RUN mkdir /usr/local/src + +WORKDIR /usr/local/src/ + +ENV PYTHONPATH "${PYTHONPATH}:/usr/local/src/.appwrite" \ No newline at end of file diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index b04a635cf0..08f2f046dd 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -485,6 +485,14 @@ class FunctionsCustomServerTest extends Scope 'command' => 'python main.py', 'timeout' => 15, ], + [ + 'language' => 'Python', + 'version' => '3.9', + 'name' => 'python-3.9', + 'code' => $functions.'/python.tar.gz', + 'command' => 'python main.py', + 'timeout' => 15, + ], [ 'language' => 'Node.js', 'version' => '14.5',