Skip to content

Commit

Permalink
Merge branch 'dev' into fix/dark-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tcp authored Oct 11, 2023
2 parents 27913d5 + c1c4875 commit f81d714
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/hagrid/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.76
current_version = 0.3.77
tag = False
tag_name = {new_version}
commit = True
Expand Down
69 changes: 55 additions & 14 deletions packages/hagrid/hagrid/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ def get_compose_src_path(
**kwargs: TypeDict[str, Any],
) -> str:
grid_path = GRID_SRC_PATH()
tag = kwargs.get("tag", None)
if EDITABLE_MODE and template_location is None or tag == "0.7.0": # type: ignore
tag = kwargs["tag"]
# Use local compose files if in editable mode and
# template_location is None and (kwargs["dev"] is True or tag is local)
if EDITABLE_MODE and template_location is None and (kwargs["dev"] is True or tag == "local"): # type: ignore
path = grid_path
else:
path = deployment_dir(node_name)
Expand Down Expand Up @@ -1356,25 +1358,64 @@ def create_launch_cmd(
if (
parsed_kwargs["tag"] is not None
and parsed_kwargs["template"] is None
and parsed_kwargs["tag"] not in ["local", "0.7.0"]
and parsed_kwargs["tag"] not in ["local"]
):
# third party
from packaging import version

pattern = r"[0-9].[0-9].[0-9]"
input_tag = parsed_kwargs["tag"]
if (
not re.match(pattern, input_tag)
and input_tag != "latest"
and input_tag != "beta"
and "b" not in input_tag
):
raise Exception(
f"Not a valid tag: {parsed_kwargs['tag']}"
+ "\nValid tags: latest, beta, beta version(ex: 0.8.2b35),[0-9].[0-9].[0-9]"
)

# TODO: we need to redo this so that pypi and docker mappings are in a single
# file inside dev
if parsed_kwargs["tag"] == "latest":
parsed_kwargs["template"] = LATEST_STABLE_SYFT
parsed_kwargs["tag"] = LATEST_STABLE_SYFT
elif parsed_kwargs["tag"] == "beta":
parsed_kwargs["template"] = "dev"
parsed_kwargs["tag"] = LATEST_BETA_SYFT
elif parsed_kwargs["tag"] == "beta" or "b" in parsed_kwargs["tag"]:
tag = (
LATEST_BETA_SYFT
if parsed_kwargs["tag"] == "beta"
else parsed_kwargs["tag"]
)

# Currently, manifest_template.yml is only supported for beta versions >= 0.8.2b34
beta_version = version.parse(tag)
MINIMUM_BETA_VERSION = "0.8.2b34"
if beta_version < version.parse(MINIMUM_BETA_VERSION):
raise Exception(
f"Minimum beta version tag supported is {MINIMUM_BETA_VERSION}"
)

# Check if the beta version is available
template_url = f"https://github.com/OpenMined/PySyft/releases/download/v{str(beta_version)}/manifest_template.yml"
response = requests.get(template_url) # nosec
if response.status_code != 200:
raise Exception(
f"Tag {parsed_kwargs['tag']} is not available"
+ " \n for download. Please check the available tags at: "
+ "\n https://github.com/OpenMined/PySyft/releases"
)

parsed_kwargs["template"] = template_url
parsed_kwargs["tag"] = tag
else:
template = parsed_kwargs["tag"]
# 🟡 TODO: Revert to use tags once, we have tag branches with beta
# versions also.
if "b" in template:
template = "dev"
# if template == "beta":
# template = "dev"
parsed_kwargs["template"] = template
MINIMUM_TAG_VERSION = version.parse("0.8.0")
tag = version.parse(parsed_kwargs["tag"])
if tag < MINIMUM_TAG_VERSION:
raise Exception(
f"Minimum supported stable tag version is {MINIMUM_TAG_VERSION}"
)
parsed_kwargs["template"] = parsed_kwargs["tag"]

if host in ["docker"] and parsed_kwargs["template"] and host is not None:
# Setup the files from the manifest_template.yml
Expand Down
4 changes: 2 additions & 2 deletions packages/hagrid/hagrid/manifest_template.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
manifestVersion: 0.1
hagrid_version: 0.3.76
hagrid_version: 0.3.77
syft_version: 0.8.2-beta.35
dockerTag: 0.8.2-beta.35
baseUrl: https://raw.githubusercontent.com/OpenMined/PySyft/
hash: 816fedf28e3636e12a6093e6c4be39f4dc000b10
hash: 7cc9072e300872e02ae8bfcecf7bb000cdea6a17
target_dir: ~/.hagrid/PySyft/
files:
grid:
Expand Down
2 changes: 1 addition & 1 deletion packages/hagrid/hagrid/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# HAGrid Version
__version__ = "0.3.76"
__version__ = "0.3.77"

if __name__ == "__main__":
print(__version__)
2 changes: 1 addition & 1 deletion packages/hagrid/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import find_packages
from setuptools import setup

__version__ = "0.3.76"
__version__ = "0.3.77"

DATA_FILES = {"img": ["hagrid/img/*.png"], "hagrid": ["*.yml"]}

Expand Down
1 change: 1 addition & 0 deletions packages/syft/src/syft/util/notebook_ui/notebook_addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@
resetById${uid}('table${uid}');
resetById${uid}('pag${uid}');
result = paginate${uid}(result, page_size${uid})
paginatedElements${uid} = result
buildGrid${uid}(result,pageIndex${uid});
buildPaginationContainer${uid}(result);
}
Expand Down
18 changes: 9 additions & 9 deletions packages/syft/tests/syft/stores/mongo_document_store_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def _kv_cbk(tid: int) -> None:


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
def test_mongo_store_partition_permissions_collection(
mongo_store_partition: MongoStorePartition,
Expand All @@ -638,7 +638,7 @@ def test_mongo_store_partition_permissions_collection(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
def test_mongo_store_partition_add_remove_permission(
root_verify_key: SyftVerifyKey, mongo_store_partition: MongoStorePartition
Expand Down Expand Up @@ -729,7 +729,7 @@ def test_mongo_store_partition_add_remove_permission(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
def test_mongo_store_partition_add_permissions(
root_verify_key: SyftVerifyKey,
Expand Down Expand Up @@ -781,7 +781,7 @@ def test_mongo_store_partition_add_permissions(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
@pytest.mark.parametrize("permission", PERMISSIONS)
def test_mongo_store_partition_has_permission(
Expand Down Expand Up @@ -830,7 +830,7 @@ def test_mongo_store_partition_has_permission(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
@pytest.mark.parametrize("permission", PERMISSIONS)
def test_mongo_store_partition_take_ownership(
Expand Down Expand Up @@ -885,7 +885,7 @@ def test_mongo_store_partition_take_ownership(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
def test_mongo_store_partition_permissions_set(
root_verify_key: SyftVerifyKey,
Expand Down Expand Up @@ -931,7 +931,7 @@ def test_mongo_store_partition_permissions_set(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
def test_mongo_store_partition_permissions_get_all(
root_verify_key: SyftVerifyKey,
Expand Down Expand Up @@ -964,7 +964,7 @@ def test_mongo_store_partition_permissions_get_all(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
def test_mongo_store_partition_permissions_delete(
root_verify_key: SyftVerifyKey,
Expand Down Expand Up @@ -1018,7 +1018,7 @@ def test_mongo_store_partition_permissions_delete(


@pytest.mark.skipif(
sys.platform == "win32", reason="pytest_mock_resources + docker issues on Windows"
sys.platform != "linux", reason="pytest_mock_resources + docker issues on Windows"
)
def test_mongo_store_partition_permissions_update(
root_verify_key: SyftVerifyKey,
Expand Down
2 changes: 1 addition & 1 deletion scripts/hagrid_hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e36222a225f8ce9ad3579d7c2805784c
88589c42b08774c056bb2578a4b6c26d

0 comments on commit f81d714

Please sign in to comment.