From 5bece91cdd3e0b5858f7025f1d195396a39db533 Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Mon, 10 Jul 2023 11:04:27 +0000 Subject: [PATCH 1/7] use faasmctl --- requirements.txt | 5 +++-- tasks/cpython.py | 15 ++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8be08ed..cbb3d3f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ black==22.3.0 +faasmctl==0.2.3 flake8==3.9.2 -invoke==1.7.1 +invoke>=2.0.0 numpy==1.22.0 -requests==2.25.1 +requests>=2.31.0 diff --git a/tasks/cpython.py b/tasks/cpython.py index 61c8373..a1a0619 100644 --- a/tasks/cpython.py +++ b/tasks/cpython.py @@ -1,4 +1,5 @@ from copy import copy as deep_copy +from faasmctl.utils.upload import upload_wasm from faasmtools.build import ( FAASM_BUILD_ENV_DICT, WASM_HEADER_INSTALL, @@ -7,7 +8,6 @@ build_config_cmd, ) from faasmtools.compile_util import wasm_cmake, wasm_copy_upload -from faasmtools.endpoints import get_faasm_upload_host_port from faasmtools.env import WASM_DIR from invoke import task from os import environ, makedirs @@ -240,18 +240,7 @@ def upload(ctx): """ Upload the CPython function """ - host, port = get_faasm_upload_host_port() wasm_file = join( WASM_DIR, CPYTHON_FUNC_USER, CPYTHON_FUNC_NAME, "function.wasm" ) - url = "http://{}:{}/f/{}/{}".format( - host, port, CPYTHON_FUNC_USER, CPYTHON_FUNC_NAME - ) - print( - "Uploading {}/{} to {}".format( - CPYTHON_FUNC_USER, CPYTHON_FUNC_NAME, url - ) - ) - response = put(url, data=open(wasm_file, "rb")) - - print("Response ({}): {}".format(response.status_code, response.text)) + upload_wasm(CPYTHON_FUNC_USER, CPYTHON_FUNC_NAME, wasm_file) From 7317e60fe3673d085c7d6109770d26c03d1420aa Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Mon, 10 Jul 2023 11:06:58 +0000 Subject: [PATCH 2/7] gh: bump code version --- .github/workflows/tests.yml | 4 ++-- VERSION | 2 +- tasks/cpython.py | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1429717..1ff44b0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest container: - image: faasm.azurecr.io/cpython:0.2.5 + image: faasm.azurecr.io/cpython:0.2.6 credentials: username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }} password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }} @@ -44,7 +44,7 @@ jobs: REDIS_QUEUE_HOST: redis REDIS_STATE_HOST: redis container: - image: faasm.azurecr.io/cpython:0.2.5 + image: faasm.azurecr.io/cpython:0.2.6 credentials: username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }} password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }} diff --git a/VERSION b/VERSION index 3a4036f..53a75d6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.5 +0.2.6 diff --git a/tasks/cpython.py b/tasks/cpython.py index a1a0619..fa4b3f6 100644 --- a/tasks/cpython.py +++ b/tasks/cpython.py @@ -1,5 +1,5 @@ from copy import copy as deep_copy -from faasmctl.utils.upload import upload_wasm +from faasmctl.util.upload import upload_wasm from faasmtools.build import ( FAASM_BUILD_ENV_DICT, WASM_HEADER_INSTALL, @@ -13,7 +13,6 @@ from os import environ, makedirs from os.path import join, exists from re import compile -from requests import put from shutil import copy, copytree, rmtree from subprocess import run from tasks.env import ( From 18e9ea69c1125a3b3e9a40c7af2d88fac48118a4 Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Sun, 16 Jul 2023 09:05:22 +0000 Subject: [PATCH 3/7] fix build --- crossenv/tasks/modules.py | 5 +++-- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crossenv/tasks/modules.py b/crossenv/tasks/modules.py index 1e3ae21..561cc71 100644 --- a/crossenv/tasks/modules.py +++ b/crossenv/tasks/modules.py @@ -55,8 +55,9 @@ # "dulwich", "Genshi", "pyaes", - "pyperf", - "pyperformance", + # 16/07/2023 - pyperf and pyperformance installation suddendly broken + # "pyperf", + # "pyperformance", "six", ] diff --git a/requirements.txt b/requirements.txt index cbb3d3f..1124327 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ black==22.3.0 -faasmctl==0.2.3 +faasmctl==0.3.6 flake8==3.9.2 invoke>=2.0.0 numpy==1.22.0 From f106e863f3e7c27d7eaf87dfbae8ce64969e8fa8 Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Sun, 16 Jul 2023 09:31:31 +0000 Subject: [PATCH 4/7] cpp: bump to latest version --- third-party/cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/cpp b/third-party/cpp index b556c29..a72b3c1 160000 --- a/third-party/cpp +++ b/third-party/cpp @@ -1 +1 @@ -Subproject commit b556c29b46869d0f07d55c53b1b6819e6c4c72f1 +Subproject commit a72b3c10ea64814c7e530fab0641cc4709053a40 From ab9c9bc2619f46e2da203260e096be83c9f0c802 Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Mon, 17 Jul 2023 10:16:03 +0000 Subject: [PATCH 5/7] faasmctl: bump version and use task to upload --- requirements.txt | 2 +- tasks/func.py | 31 ++++++++----------------------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1124327..75c1a0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ black==22.3.0 -faasmctl==0.3.6 +faasmctl==0.4.2 flake8==3.9.2 invoke>=2.0.0 numpy==1.22.0 diff --git a/tasks/func.py b/tasks/func.py index 1077cd6..f309726 100644 --- a/tasks/func.py +++ b/tasks/func.py @@ -1,15 +1,10 @@ -from faasmtools.build import FAASM_LOCAL_DIR -from faasmtools.endpoints import ( - get_faasm_invoke_host_port, - get_faasm_upload_host_port, - get_knative_headers, -) - -import requests from base64 import b64encode -from os.path import join +from faasmctl.util.invoke import invoke_wasm +from faasmctl.util.upload import upload_python +from faasmtools.build import FAASM_LOCAL_DIR from invoke import task from os import makedirs, listdir +from os.path import join from shutil import copy from tasks.env import CPYTHON_FUNC_USER, CPYTHON_FUNC_NAME, PROJ_ROOT @@ -23,7 +18,6 @@ def uploadpy(ctx, func, local=False): """ Upload the given Python function """ - host, port = get_faasm_upload_host_port() src_file = join(PY_FUNC_DIR, "{}.py".format(func)) if local: @@ -35,10 +29,7 @@ def uploadpy(ctx, func, local=False): print("Copying function {} {} -> {}".format(func, src_file, dest_file)) copy(src_file, dest_file) else: - url = "http://{}:{}/p/{}/{}".format(host, port, "python", func) - response = requests.put(url, data=open(src_file, "rb")) - - print("Response ({}): {}".format(response.status_code, response.text)) + upload_python(func, src_file) @task @@ -59,8 +50,6 @@ def invoke(ctx, user, func, input_data=None): """ Invoke a python function on a Faasm cluster """ - host, port = get_faasm_invoke_host_port() - url = "http://{}:{}".format(host, port) data = { "user": CPYTHON_FUNC_USER, "function": CPYTHON_FUNC_NAME, @@ -74,11 +63,7 @@ def invoke(ctx, user, func, input_data=None): "utf-8" ) - headers = get_knative_headers() - response = requests.post(url, json=data, headers=headers) - - if response.status_code != 200: - print("Error ({}):\n{}".format(response.status_code, response.text)) - exit(1) + # Invoke message + response = invoke_wasm(data) - print("Success:\n{}".format(response.text)) + print("Success:\n{}".format(response.messageResults[0].outputData)) From 5b5f55ab015848b84d5d263133b5245a6a3165c7 Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Tue, 18 Jul 2023 09:57:51 +0000 Subject: [PATCH 6/7] cpp: bump after merge --- third-party/cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/cpp b/third-party/cpp index a72b3c1..3f2c574 160000 --- a/third-party/cpp +++ b/third-party/cpp @@ -1 +1 @@ -Subproject commit a72b3c10ea64814c7e530fab0641cc4709053a40 +Subproject commit 3f2c574ba3c09a37977f9dd696e84fc1e5777d4f From 2659013f403002fc44e21891e40f5ff82ebcd3cd Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Tue, 18 Jul 2023 11:10:24 +0000 Subject: [PATCH 7/7] gh: bump cpp and faasmctl --- requirements.txt | 2 +- third-party/cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 75c1a0c..62ac458 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ black==22.3.0 -faasmctl==0.4.2 +faasmctl==0.5.6 flake8==3.9.2 invoke>=2.0.0 numpy==1.22.0 diff --git a/third-party/cpp b/third-party/cpp index 3f2c574..16102b1 160000 --- a/third-party/cpp +++ b/third-party/cpp @@ -1 +1 @@ -Subproject commit 3f2c574ba3c09a37977f9dd696e84fc1e5777d4f +Subproject commit 16102b14075c61491bf4a46f79672ea687413d53