Skip to content

Commit

Permalink
Change default engine type to GlobusComputeEngine
Browse files Browse the repository at this point in the history
We will soon mark the `HighThroughputEngine` for deprecation.
  • Loading branch information
rjmello committed Jan 22, 2024
1 parent c9ca3b6 commit 0ed4a5e
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Changed
^^^^^^^

- Changed the default engine type for new endpoints to `GlobusComputeEngine`, which
utilizes the Parsl `HighThroughputExecutor` under the hood.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import pathlib
import warnings

from globus_compute_endpoint.engines import HighThroughputEngine
from globus_compute_endpoint.engines import GlobusComputeEngine
from parsl.utils import RepresentationMixin

_DEFAULT_EXECUTORS = [HighThroughputEngine()]
_DEFAULT_EXECUTORS = [GlobusComputeEngine()]


class Config(RepresentationMixin):
Expand All @@ -20,7 +20,7 @@ class Config(RepresentationMixin):
executors : list of Executors
A list of executors which serve as the backend for function execution.
As of 0.2.2, this list should contain only one executor.
Default: [HighThroughputEngine()]
Default: [GlobusComputeEngine()]
environment: str
Environment the endpoint should connect to. Sets funcx_service_address and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from globus_compute_endpoint.endpoint.config import Config
from globus_compute_endpoint.engines import HighThroughputEngine
from globus_compute_endpoint.engines import GlobusComputeEngine
from parsl.providers import LocalProvider

config = Config(
display_name=None, # If None, defaults to the endpoint name
executors=[
HighThroughputEngine(
GlobusComputeEngine(
provider=LocalProvider(
init_blocks=1,
min_blocks=0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
amqp_port: 443
display_name: null
engine:
type: HighThroughputEngine
type: GlobusComputeEngine
provider:
type: LocalProvider
init_blocks: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
endpoint_setup: {{ endpoint_setup|default() }}

engine:
type: HighThroughputEngine
type: GlobusComputeEngine
max_workers_per_node: 1

provider:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ def test_stop_remote_endpoint(mock_get_id, mock_get_gcc, mock_stop_endpoint):
[
(
"from funcx_endpoint.endpoint.utils.config import Config\n"
"from funcx_endpoint.engines import HighThroughputEngine\n"
"from funcx_endpoint.engines import GlobusComputeEngine\n"
"from funcx_endpoint.executors import HighThroughputExecutor\n"
"from parsl.providers import LocalProvider\n"
"\n"
"config = Config(\n"
" executors=[\n"
" HighThroughputEngine(\n"
" GlobusComputeEngine(\n"
" provider=LocalProvider(\n"
" init_blocks=1,\n"
" min_blocks=0,\n"
Expand All @@ -228,7 +228,7 @@ def test_stop_remote_endpoint(mock_get_id, mock_get_gcc, mock_stop_endpoint):
[
(
"from funcx_endpoint.endpoint.utils.config import Config\n"
"from funcx_endpoint.engines import HighThroughputEngine\n"
"from funcx_endpoint.engines import GlobusComputeEngine\n"
"from funcx_endpoint.executors import HighThroughputExecutor\n"
"from parsl.providers import LocalProvider\n"
),
Expand All @@ -239,7 +239,7 @@ def test_stop_remote_endpoint(mock_get_id, mock_get_gcc, mock_stop_endpoint):
[
(
"from funcx_endpoint.endpoint.utils.config import Config\n"
"from funcx_endpoint.engines import HighThroughputEngine\n"
"from funcx_endpoint.engines import GlobusComputeEngine\n"
"from funcx_endpoint.executors import HighThroughputExecutor\n"
"from parsl.providers import LocalProvider\n"
),
Expand All @@ -251,7 +251,7 @@ def test_stop_remote_endpoint(mock_get_id, mock_get_gcc, mock_stop_endpoint):
(
"def abc():"
" from funcx_endpoint.endpoint.utils.config import Config\n"
" from funcx_endpoint.engines import HighThroughputEngine\n"
" from funcx_endpoint.engines import GlobusComputeEngine\n"
" from funcx_endpoint.executors import HighThroughputExecutor\n"
" from parsl.providers import LocalProvider\n"
" return 'hello'\n"
Expand Down
4 changes: 2 additions & 2 deletions compute_endpoint/tests/unit/test_cli_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def func(name=ep_name):
"""
display_name: null
engine:
type: HighThroughputEngine
type: GlobusComputeEngine
provider:
type: LocalProvider
init_blocks: 1
Expand All @@ -79,7 +79,7 @@ def func(name=ep_name):
"""
heartbeat_period: {{ heartbeat }}
engine:
type: HighThroughputEngine
type: GlobusComputeEngine
provider:
type: LocalProvider
init_blocks: 1
Expand Down
6 changes: 3 additions & 3 deletions compute_endpoint/tests/unit/test_endpoint_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@pytest.fixture
def config_dict():
return {"engine": {"type": "HighThroughputEngine"}}
return {"engine": {"type": "GlobusComputeEngine"}}


@pytest.fixture
Expand All @@ -34,11 +34,11 @@ def test_config_model_tuple_conversions(config_dict: dict, data: t.Tuple[str, t.

config_dict["engine"][field] = expected_val
model = ConfigModel(**config_dict)
assert getattr(model.engine, field) == expected_val
assert getattr(model.engine.executor, field) == expected_val

config_dict["engine"][field] = list(expected_val)
model = ConfigModel(**config_dict)
assert getattr(model.engine, field) == expected_val
assert getattr(model.engine.executor, field) == expected_val

config_dict["engine"][field] = 50000
with pytest.raises(ValueError):
Expand Down
6 changes: 3 additions & 3 deletions compute_endpoint/tests/unit/test_endpoint_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ def test_endpoint_get_metadata(mocker):
config = meta["config"]
assert "funcx_service_address" in config
assert len(config["executors"]) == 1
assert config["executors"][0]["type"] == "HighThroughputEngine"
assert config["executors"][0]["provider"]["type"] == "LocalProvider"
assert config["executors"][0]["type"] == "GlobusComputeEngine"
assert config["executors"][0]["executor"]["provider"]["type"] == "LocalProvider"


@pytest.mark.parametrize("env", [None, "blar", "local", "production"])
Expand Down Expand Up @@ -711,7 +711,7 @@ def foo(self):
result = serialize_config(ep_config)

# Objects with a __dict__ attr are expanded
assert "type" in result["executors"][0]["provider"]
assert "type" in result["executors"][0]["executor"]["provider"]

# Only constructor parameters should be included
assert "_hidden_attr" not in result
Expand Down
2 changes: 1 addition & 1 deletion compute_endpoint/tests/unit/test_endpointmanager_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def user_conf_template(conf_dir):
"""
heartbeat_period: {{ heartbeat }}
engine:
type: HighThroughputEngine
type: GlobusComputeEngine
provider:
type: LocalProvider
init_blocks: 1
Expand Down

0 comments on commit 0ed4a5e

Please sign in to comment.