Skip to content

Commit

Permalink
Merge pull request #1 from ITISFoundation/add_max_n_of_workers
Browse files Browse the repository at this point in the history
Add max n of workers
  • Loading branch information
wvangeit authored May 15, 2024
2 parents de51213 + 024a477 commit d67e1d1
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.9
current_version = 0.0.10
commit = False
message = service version: {current_version} → {new_version}
tag = False
Expand Down
4 changes: 2 additions & 2 deletions .osparc/osparc-meta-parallelrunner/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: ParallelRunnerService
description: "ParallelRunnerService"
key: simcore/services/dynamic/osparc-meta-parallelrunner
version: 0.0.9
integration-version: 0.0.9
version: 0.0.10
integration-version: 0.0.10
type: dynamic
authors:
- name: Werner Van Geit
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL = /bin/sh
MAKEFLAGS += -j2

export DOCKER_IMAGE_NAME ?= osparc-map
export DOCKER_IMAGE_TAG ?= 0.0.9
export DOCKER_IMAGE_TAG ?= 0.0.10

export MASTER_AWS_REGISTRY ?= registry.osparc-master-zmt.click
export MASTER_REGISTRY ?= registry.osparc-master.speag.com
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,33 @@ This service is part of the Metamodelling framework in
parallel on the platform.

Test
====
----

To run a local test:

```
make build
make run-local
```
Deploy to local **o<sup>2</sup>S<sup>2</sup>PARC** registry
-------------------------------------------------------

To run publish to the local registry:

```
make build
make publish-local
```

Deploy to main **o<sup>2</sup>S<sup>2</sup>PARC** registry
------------------------------------------------------

Create a PR request in this repository, and make sure to run
make version-patch to increase the version number.

Once the PR is merged into master, go to the internal gitlab repository:
sparc-external. Add the new version number to the relevant block in the
sync-workflow.yml file in that repository.

These steps should make the system deploy the new version automatically.

2 changes: 1 addition & 1 deletion docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:
osparc-meta-parallelrunner:
image: simcore/services/dynamic/osparc-meta-parallelrunner:0.0.9
image: simcore/services/dynamic/osparc-meta-parallelrunner:0.0.10
ports:
- "8888:8888"
environment:
Expand Down
9 changes: 9 additions & 0 deletions docker_scripts/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

HTTP_PORT = 8888

MAX_N_OF_WORKERS = 10

POLLING_INTERVAL = 1 # second
TEMPLATE_ID_KEY = "input_0"
N_OF_WORKERS_KEY = "input_1"
Expand Down Expand Up @@ -187,6 +189,13 @@ def start(self):
n_of_workers = key_values[N_OF_WORKERS_KEY]["value"]
if n_of_workers is None:
raise ValueError("Number of workers can't be None")
elif n_of_workers > MAX_N_OF_WORKERS:
logger.warning(
"Attempt to set number of workers to more than "
f"is allowed ({MAX_N_OF_WORKERS}), limiting value "
"to maximum amount"
)
n_of_workers = MAX_N_OF_WORKERS

waiter = 0
while not self.input_tasks_path.exists():
Expand Down

0 comments on commit d67e1d1

Please sign in to comment.