Skip to content

Commit

Permalink
compose: pass override cpu cores variable
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Apr 8, 2024
1 parent 0d14e23 commit 160c6af
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
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
8 changes: 8 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 @@ -103,6 +107,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

0 comments on commit 160c6af

Please sign in to comment.