Skip to content

Commit

Permalink
DEFAULT_BACK_COMPATIBLES environment variable (#1264)
Browse files Browse the repository at this point in the history
* DEFAULT_BACK_COMPATIBLES

* test_default_data_provider

* Black reformatting

* Additonal logger.info() call on server start

* Black reformating
  • Loading branch information
koropets authored Jul 29, 2022
1 parent 15ab9b3 commit 829450c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
8 changes: 8 additions & 0 deletions gordo/cli/workflow_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
from gordo.cli.exceptions_reporter import ReportLevel
from gordo.util.version import parse_version
from gordo_dataset.back_compatibles import DEFAULT_BACK_COMPATIBLES


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -393,6 +394,11 @@ def workflow_cli(gordo_ctx):
help="ModelBuilder class",
envvar="MODEL_BUILDER_CLASS",
)
@click.option(
"--default-data-provider",
help="Default data_provider.type for dataset",
envvar=f"{PREFIX}_DEFAULT_DATA_PROVIDER",
)
@click.pass_context
def workflow_generator_cli(gordo_ctx, **ctx):
"""
Expand Down Expand Up @@ -435,6 +441,8 @@ def workflow_generator_cli(gordo_ctx, **ctx):
yaml_content,
project_name=context["project_name"],
model_builder_env=model_builder_env,
back_compatibles=DEFAULT_BACK_COMPATIBLES,
default_data_provider=context["default_data_provider"],
)

version = parse_version(context["gordo_version"])
Expand Down
1 change: 1 addition & 0 deletions gordo/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def build_app(
"""
Build app and any associated routes
"""
logger.info("Starting Flask('%s') server", __name__)
app = Flask(__name__)
app.config.from_object(Config())
if config is not None:
Expand Down
2 changes: 1 addition & 1 deletion requirements/full_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ google-pasta==0.2.0
# via tensorflow
gordo-client==5.2.0rc2
# via -r requirements.in
gordo-dataset==5.0.0rc6
gordo-dataset==5.0.0rc7
# via
# -r requirements.in
# gordo-client
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ catboost~=0.26.1
prometheus_client~=0.7.1
jeepney>=0.6
packaging~=20.7
gordo-dataset~=5.0.0rc6
gordo-dataset~=5.0.0rc7
gordo-client~=5.2.0rc2
# At the bottom are optional dependencies
scipy~=1.5.4
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
machines:
- name: machine
dataset:
tags:
- Tag 1
- Tag 2
- Tag 3
train_start_date: 2016-11-07T08:10:30+00:00
train_end_date: 2017-11-07T10:10:01+00:00

globals:
model:
sklearn.pipeline.Pipeline:
steps:
- sklearn.preprocessing.MinMaxScaler
- gordo.machine.model.models.KerasAutoEncoder:
kind: feedforward_hourglass
Original file line number Diff line number Diff line change
Expand Up @@ -748,3 +748,11 @@ def test_with_resources_labels(path_to_config_files: str):
assert workflow_str.find(
expected_str
), 'Unable to find label "some_custom_label" in the generated argo-workflow'


def test_default_data_provider(path_to_config_files: str):
args = ["--default-data-provider", "RandomDataProvider"]
workflow_str = _generate_test_workflow_str(
path_to_config_files, "config-empty-default-data-provider.yml", args=args
)
assert "gordo_dataset.data_providers.providers.RandomDataProvider" in workflow_str

0 comments on commit 829450c

Please sign in to comment.