Skip to content

Commit

Permalink
lib.registry restruct
Browse files Browse the repository at this point in the history
  • Loading branch information
antonymayi committed Oct 13, 2021
1 parent 1678f4e commit b1b6364
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Example ForML platform configuration::
provider = "virtual"

[REGISTRY.homedir]
provider = "filesystem"
provider = "posix"
#path = ~/.forml/registry


Expand Down
6 changes: 3 additions & 3 deletions docs/serving.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ event are:
* prediction result
* latency

Metrics DB
''''''''''
PerfDB
''''''

Another storage service for aggregating the performance metric as time series derived from both the metadata pushed via
*query logbus* as well as the main *feedback loop* and produced by the *offline agent* processing.

The Metric DB is a crucial source of information not only for any sorts of operational monitoring/reporting but
The PerfDB is a crucial source of information not only for any sorts of operational monitoring/reporting but
especially for the dynamic model generation selection performed by the online agent according to the rollout strategy
when serving the actual event queries.

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Now let's specify the actual ForML :doc:`platform <platform>` configuration. Add
default = "tutorial"

[REGISTRY.tutorial]
provider = "filesystem"
provider = "posix"
path = "/tmp/forml-tutorial"

[FEED]
Expand Down Expand Up @@ -192,7 +192,7 @@ before executing the commands.

4. Run the ``apply`` mode alternatively on the ``graphviz`` runner to explore its task graph::

$ forml -R visual apply forml-example-titanic
$ forml apply -R visual forml-example-titanic

.. image:: images/titanic-apply.png

Expand Down
2 changes: 1 addition & 1 deletion forml/conf/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ default = "homedir"
provider = "virtual"

[REGISTRY.homedir]
provider = "filesystem"
provider = "posix"
#path = ~/.forml/registry


Expand Down
2 changes: 1 addition & 1 deletion forml/lib/registry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
Registry implementations.
"""

__all__ = ['virtual', 'filesystem']
__all__ = ['filesystem']
22 changes: 22 additions & 0 deletions forml/lib/registry/filesystem/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

"""
Filesystem registry implementations.
"""

__all__ = ['virtual', 'posix']
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def tag(
return self.generation(project, lineage, generation) / self.TAGFILE


class Registry(asset.Registry, alias='filesystem'):
class Registry(asset.Registry, alias='posix'):
"""Filesystem registry is a locally-accessible file based hierarchy."""

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import tempfile
import typing

from forml.lib.registry import filesystem
from forml.lib.registry.filesystem import posix
from forml.runtime import asset

if typing.TYPE_CHECKING:
Expand All @@ -32,7 +32,7 @@
LOGGER = logging.getLogger(__name__)


class Registry(filesystem.Registry, alias='virtual'):
class Registry(posix.Registry, alias='virtual'):
"""Virtual registry implementation provided as a non-distributed global registry persistent only during its
lifetime.
"""
Expand Down
2 changes: 1 addition & 1 deletion forml/runtime/facility/_pseudo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from forml import project as prj
from forml.conf.parsed import provider as provcfg
from forml.io import dsl, layout
from forml.lib.registry import virtual
from forml.lib.registry.filesystem import virtual
from forml.runtime import asset

from . import _pad
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import pytest

from forml.lib.registry import filesystem
from forml.lib.registry.filesystem import posix
from forml.runtime import asset

from . import Registry
Expand All @@ -37,4 +37,4 @@ class TestRegistry(Registry):
@staticmethod
@pytest.fixture(scope='function')
def constructor(tmp_path: pathlib.Path) -> typing.Callable[[], asset.Registry]:
return lambda: filesystem.Registry(tempfile.mkdtemp(dir=tmp_path))
return lambda: posix.Registry(tempfile.mkdtemp(dir=tmp_path))
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import pytest

from forml.lib.registry import virtual
from forml.lib.registry.filesystem import virtual
from forml.runtime import asset

from . import Registry
Expand Down

0 comments on commit b1b6364

Please sign in to comment.