From ffc38274d29f5480019b99a8f88abf663ce3e878 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Tue, 3 Nov 2020 07:24:06 +0200 Subject: [PATCH] Added multicore build support --- CONTRIBUTING.md | 12 ++++- composer.json | 4 +- composer.lock | 60 +++++++++++++------------ docker/environments/README.md | 10 ++++- docker/environments/build.sh | 19 ++++++++ docker/environments/deno-1.2/build.sh | 7 --- docker/environments/deno-1.5/Dockerfile | 11 +++++ docker/environments/node-14.5/build.sh | 7 --- docker/environments/php-7.4/build.sh | 7 --- docker/environments/python-3.8/build.sh | 7 --- docker/environments/ruby-2.7/build.sh | 7 --- 11 files changed, 82 insertions(+), 69 deletions(-) create mode 100644 docker/environments/build.sh delete mode 100644 docker/environments/deno-1.2/build.sh create mode 100644 docker/environments/deno-1.5/Dockerfile delete mode 100644 docker/environments/node-14.5/build.sh delete mode 100644 docker/environments/php-7.4/build.sh delete mode 100644 docker/environments/python-3.8/build.sh delete mode 100644 docker/environments/ruby-2.7/build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81d4e87bc..f31c9d460 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -224,10 +224,18 @@ bash ./build.sh X.X.X Before running the command, make sure you have proper write permissions to the Appwrite docker hub team. -**Build for multicore** +**Build for Multicore** ```bash -docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t appwrite/multicore:0.0.0 --push +docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t appwrite/multicore:0.0.0 --push . +``` + +**Build Functions Envs** + +Build envs for all supported cloud functions (multicore builds) + +```bash +bash ./docker/environments/build.sh ``` ## Tests diff --git a/composer.json b/composer.json index 1a60237d4..1d43f7e44 100644 --- a/composer.json +++ b/composer.json @@ -34,11 +34,11 @@ "appwrite/php-clamav": "1.0.*", - "utopia-php/framework": "0.9.6", + "utopia-php/framework": "0.9.7", "utopia-php/abuse": "0.2.*", "utopia-php/audit": "0.3.*", "utopia-php/cache": "0.2.*", - "utopia-php/cli": "0.7.2", + "utopia-php/cli": "0.7.3", "utopia-php/config": "0.2.*", "utopia-php/locale": "0.3.*", "utopia-php/registry": "0.2.*", diff --git a/composer.lock b/composer.lock index e3e38788b..36f60a818 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f86de102bb47a43e41895a78ed3ab991", + "content-hash": "17cb743e6efae97f01129b2a4a5239cd", "packages": [ { "name": "appwrite/php-clamav", @@ -1186,16 +1186,16 @@ }, { "name": "utopia-php/cli", - "version": "0.7.2", + "version": "0.7.3", "source": { "type": "git", "url": "https://github.com/utopia-php/cli.git", - "reference": "0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04" + "reference": "0337918242278e0cf98f8dcab2e75b5a3153b856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cli/zipball/0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04", - "reference": "0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04", + "url": "https://api.github.com/repos/utopia-php/cli/zipball/0337918242278e0cf98f8dcab2e75b5a3153b856", + "reference": "0337918242278e0cf98f8dcab2e75b5a3153b856", "shasum": "" }, "require": { @@ -1231,7 +1231,7 @@ "upf", "utopia" ], - "time": "2020-10-23T13:34:41+00:00" + "time": "2020-11-02T07:50:18+00:00" }, { "name": "utopia-php/config", @@ -1333,16 +1333,16 @@ }, { "name": "utopia-php/framework", - "version": "0.9.6", + "version": "0.9.7", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "959767e401c0497f0ddf31446d8d4dfa125aa5dc" + "reference": "20568f1325b4e38a43ef422a00e2271d5695a561" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/959767e401c0497f0ddf31446d8d4dfa125aa5dc", - "reference": "959767e401c0497f0ddf31446d8d4dfa125aa5dc", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/20568f1325b4e38a43ef422a00e2271d5695a561", + "reference": "20568f1325b4e38a43ef422a00e2271d5695a561", "shasum": "" }, "require": { @@ -1374,7 +1374,7 @@ "php", "upf" ], - "time": "2020-10-26T00:20:11+00:00" + "time": "2020-10-29T12:25:16+00:00" }, { "name": "utopia-php/locale", @@ -1522,25 +1522,27 @@ }, { "name": "utopia-php/swoole", - "version": "0.1.0", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/utopia-php/swoole.git", - "reference": "26965d8122cb42769a5543c3be1677321cdaebdb" + "reference": "bc9dd3e113e9b8cbbf54468524637f39b2deb861" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/swoole/zipball/26965d8122cb42769a5543c3be1677321cdaebdb", - "reference": "26965d8122cb42769a5543c3be1677321cdaebdb", + "url": "https://api.github.com/repos/utopia-php/swoole/zipball/bc9dd3e113e9b8cbbf54468524637f39b2deb861", + "reference": "bc9dd3e113e9b8cbbf54468524637f39b2deb861", "shasum": "" }, "require": { - "php": ">=7.1", + "ext-swoole": "*", + "php": ">=7.3", "utopia-php/framework": "0.*.*" }, "require-dev": { - "phpunit/phpunit": "^7.0", - "swoole/ide-helper": "4.5.2" + "phpunit/phpunit": "^9.3", + "swoole/ide-helper": "4.5.5", + "vimeo/psalm": "4.0.1" }, "type": "library", "autoload": { @@ -1568,7 +1570,7 @@ "upf", "utopia" ], - "time": "2020-08-14T22:44:34+00:00" + "time": "2020-10-29T12:42:38+00:00" } ], "packages-dev": [ @@ -1734,7 +1736,7 @@ "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator", - "reference": "ad1ee55f61967546c0889d377b628e244182311e" + "reference": "11789d2169109f182dbc9d7cca91aba925582cf3" }, "require": { "ext-curl": "*", @@ -1764,7 +1766,7 @@ } ], "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", - "time": "2020-10-20T10:23:43+00:00" + "time": "2020-10-31T19:31:23+00:00" }, { "name": "composer/package-versions-deprecated", @@ -3394,12 +3396,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "237324bd32872e15f51bc2eadac2a9e43e28409d" + "reference": "169f358f64962df247708bb7a2974f04cd44f836" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/237324bd32872e15f51bc2eadac2a9e43e28409d", - "reference": "237324bd32872e15f51bc2eadac2a9e43e28409d", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/169f358f64962df247708bb7a2974f04cd44f836", + "reference": "169f358f64962df247708bb7a2974f04cd44f836", "shasum": "" }, "require": { @@ -3456,7 +3458,7 @@ "type": "github" } ], - "time": "2020-10-30T14:10:53+00:00" + "time": "2020-10-31T09:38:51+00:00" }, { "name": "sebastian/complexity", @@ -4173,12 +4175,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f372360d0dfa520b23b91fc70e2bba6a232ac62d" + "reference": "5164210f240d580ce0f490a7f24827c6fbc7bc36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f372360d0dfa520b23b91fc70e2bba6a232ac62d", - "reference": "f372360d0dfa520b23b91fc70e2bba6a232ac62d", + "url": "https://api.github.com/repos/symfony/console/zipball/5164210f240d580ce0f490a7f24827c6fbc7bc36", + "reference": "5164210f240d580ce0f490a7f24827c6fbc7bc36", "shasum": "" }, "require": { @@ -4259,7 +4261,7 @@ "type": "tidelift" } ], - "time": "2020-10-29T07:35:47+00:00" + "time": "2020-11-01T17:40:07+00:00" }, { "name": "symfony/polyfill-ctype", diff --git a/docker/environments/README.md b/docker/environments/README.md index 6ffaf1d4f..771375530 100644 --- a/docker/environments/README.md +++ b/docker/environments/README.md @@ -2,4 +2,12 @@ Docker based enviornments for Appwrite Functions. You can use this Docker images to locally tests your functions by executing them on your local desktop or server. -All the supported enviornments are based on Docker Alpine images. \ No newline at end of file +All the supported enviornments are based on Docker Alpine images. + +## Build + +Build envs for all supported cloud functions (multicore builds) + +```bash +bash ./docker/environments/build.sh +``` \ No newline at end of file diff --git a/docker/environments/build.sh b/docker/environments/build.sh new file mode 100644 index 000000000..9cefcea67 --- /dev/null +++ b/docker/environments/build.sh @@ -0,0 +1,19 @@ +echo 'Starting build...' + +echo 'Deno 1.2...' +docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-deno:1.2 ./docker/environments/deno-1.2/ --push + +echo 'Deno 1.5...' +docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-deno:1.5 ./docker/environments/deno-1.5/ --push + +echo 'Node 14.5...' +docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-node:14.5 ./docker/environments/node-14.5/ --push + +echo 'PHP 7.4...' +docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-php:7.4 ./docker/environments/php-7.4/ --push + +echo 'Python 3.8...' +docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-python:2.7 ./docker/environments/python-3.8/ --push + +echo 'Ruby 2.7...' +docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-ruby:2.7 ./docker/environments/ruby-2.7/ --push diff --git a/docker/environments/deno-1.2/build.sh b/docker/environments/deno-1.2/build.sh deleted file mode 100644 index 5eaaffb49..000000000 --- a/docker/environments/deno-1.2/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Deno 1.2 build...' - -docker build --tag appwrite/env-deno:1.2 . - -echo 'Pushing Deno 1.2 build to registry...' - -docker push appwrite/env-deno:1.2 \ No newline at end of file diff --git a/docker/environments/deno-1.5/Dockerfile b/docker/environments/deno-1.5/Dockerfile new file mode 100644 index 000000000..4d48179ba --- /dev/null +++ b/docker/environments/deno-1.5/Dockerfile @@ -0,0 +1,11 @@ +FROM hayd/deno:alpine-1.5.0 + +LABEL maintainer="team@appwrite.io" + +RUN apk add tar + +RUN mkdir /usr/local/src + +WORKDIR /usr/local/src/ + +ENV DENO_DIR=/usr/local/src/.appwrite \ No newline at end of file diff --git a/docker/environments/node-14.5/build.sh b/docker/environments/node-14.5/build.sh deleted file mode 100644 index d81449f26..000000000 --- a/docker/environments/node-14.5/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Node 14.5 build...' - -docker build --tag appwrite/env-node:14.5 . - -echo 'Pushing Node 14.5 build to registry...' - -docker push appwrite/env-node:14.5 \ No newline at end of file diff --git a/docker/environments/php-7.4/build.sh b/docker/environments/php-7.4/build.sh deleted file mode 100644 index 84b20e4d4..000000000 --- a/docker/environments/php-7.4/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting PHP 7.4 build...' - -docker build --tag appwrite/env-php:7.4 . - -echo 'Pushing PHP 7.4 build to registry...' - -docker push appwrite/env-php:7.4 \ No newline at end of file diff --git a/docker/environments/python-3.8/build.sh b/docker/environments/python-3.8/build.sh deleted file mode 100644 index 2dc97b783..000000000 --- a/docker/environments/python-3.8/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Python 3.8 build...' - -docker build --tag appwrite/env-python:3.8 . - -echo 'Pushing Python 3.8 build to registry...' - -docker push appwrite/env-python:3.8 \ No newline at end of file diff --git a/docker/environments/ruby-2.7/build.sh b/docker/environments/ruby-2.7/build.sh deleted file mode 100644 index 377d62a23..000000000 --- a/docker/environments/ruby-2.7/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Ruby 2.7 build...' - -docker build --tag appwrite/env-ruby:2.7 . - -echo 'Pushing Ruby 2.7 build to registry...' - -docker push appwrite/env-ruby:2.7 \ No newline at end of file