Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy(compose): pass override cpu cores variable #79

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ running [Faasm](https://github.com/faasm/faasm) cluster.
To install `faasmctl` you need a working `pip` (virtual-)environment. Then:

```bash
pip install faasmctl==0.38.0
pip install faasmctl==0.39.0
```

## Usage
Expand Down
11 changes: 11 additions & 0 deletions faasmctl/util/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from subprocess import run
from time import sleep

DEFAULT_FAASM_OVERRIDE_CPU_COUNT = "8"


def get_compose_env_vars(faasm_checkout, mount_source, ini_file=None):
"""
Expand All @@ -29,6 +31,8 @@ def get_compose_env_vars(faasm_checkout, mount_source, ini_file=None):
- A dictionary with the necessary env. variables
"""
env = {}
env["FAASM_DEPLOYMENT_TYPE"] = "compose"

if mount_source:
env["FAASM_BUILD_DIR"] = join(faasm_checkout, "dev/faasm/build")
env["CONAN_CACHE_MOUNT_SOURCE"] = join(faasm_checkout, "dev/faasm/conan")
Expand Down Expand Up @@ -83,6 +87,9 @@ def get_compose_env_vars(faasm_checkout, mount_source, ini_file=None):
faasm_ver = faasm_ver.strip()

# Whitelist env. variables that we recognise
if "FAASM_DEPLOYMENT_TYPE" in environ:
env["FAASM_DEPLOYMENT_TYPE"] = environ["FAASM_DEPLOYMENT_TYPE"]

if "FAASM_WASM_VM" in environ:
wasm_vm = environ["FAASM_WASM_VM"]
if wasm_vm == "sgx-sim":
Expand All @@ -103,6 +110,10 @@ def get_compose_env_vars(faasm_checkout, mount_source, ini_file=None):
else:
env["FAASM_WASM_VM"] = wasm_vm

env["FAASM_OVERRIDE_CPU_COUNT"] = DEFAULT_FAASM_OVERRIDE_CPU_COUNT
if "FAASM_OVERRIDE_CPU_COUNT" in environ:
env["FAASM_OVERRIDE_CPU_COUNT"] = environ["FAASM_OVERRIDE_CPU_COUNT"]

if "FAASM_CLI_IMAGE" in environ:
env["FAASM_CLI_IMAGE"] = environ["FAASM_CLI_IMAGE"]

Expand Down
2 changes: 1 addition & 1 deletion faasmctl/util/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FAASMCTL_VERSION = "0.38.0"
FAASMCTL_VERSION = "0.39.0"


def get_version():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "faasmctl"
version = "0.38.0"
version = "0.39.0"
authors = [
{ name="Faasm Team", email="[email protected]" },
]
Expand Down