Skip to content

Commit

Permalink
Feature/rkic move gordo client cli (#1110)
Browse files Browse the repository at this point in the history
* 30882 Feat: Move gordo client cli

* 30882 Feat: Move gordo client cli

* 30882 Feat: Move gordo client cli

* 30882 Feat: Move gordo client cli

* 30881 Feat: Move gordo client code

* 30882 Feat: Move gordo client cli

* Revert "30881 Feat: Move gordo client code"

This reverts commit 3797d42.

* Revert "Revert "30881 Feat: Move gordo client code""

This reverts commit ff1ec0a.

* Remove 'gordo client cli'

* gordo client ... -> gordo-client ...

* gordo.client~=0.2.3

* Fixing gordo-client command argo-workflow.yml.template

* black reformating

* Fixing unit-test

Co-authored-by: Radoslaw Kiczko <[email protected]>
Co-authored-by: Serhii Koropets <[email protected]>
  • Loading branch information
3 people authored Jan 11, 2021
1 parent ec7dc37 commit e768ddf
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 354 deletions.
3 changes: 1 addition & 2 deletions gordo/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from gordo import __version__
from gordo.machine import Machine
from gordo.cli.workflow_generator import workflow_cli
from gordo.cli.client import client as gordo_client
from gordo.cli.custom_types import key_value_par, HostIP
from gordo.reporters.exceptions import ReporterException

Expand Down Expand Up @@ -376,7 +375,7 @@ def run_server_cli(
gordo.add_command(workflow_cli)
gordo.add_command(build)
gordo.add_command(run_server_cli)
gordo.add_command(gordo_client)


if __name__ == "__main__":
gordo()
237 changes: 0 additions & 237 deletions gordo/cli/client.py

This file was deleted.

45 changes: 0 additions & 45 deletions gordo/cli/custom_types.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,8 @@
# -*- coding: utf-8 -*-

import ipaddress
import os
import typing

import yaml
import click
from dateutil import parser

from gordo_dataset.data_provider import providers


class DataProviderParam(click.ParamType):
"""
Load a DataProvider from JSON/YAML representation or from a JSON/YAML file
"""

name = "data-provider"

def convert(self, value, param, ctx):
if os.path.isfile(value):
with open(value) as f:
kwargs = yaml.safe_load(f)
else:
kwargs = yaml.safe_load(value)

if "type" not in kwargs:
self.fail(f"Cannot create DataProvider without 'type' key defined")

kind = kwargs.pop("type")

Provider = getattr(providers, kind, None)
if Provider is None:
self.fail(f"No DataProvider named '{kind}'")
return Provider(**kwargs)


class IsoFormatDateTime(click.ParamType):
"""
Parse a string into an ISO formatted datetime object
"""

name = "iso-datetime"

def convert(self, value, param, ctx):
try:
return parser.isoparse(value)
except ValueError:
self.fail(f"Failed to parse date '{value}' as ISO formatted date'")


class HostIP(click.ParamType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ spec:
command: [bash]
source: |
echo "Starting client prediction for machine $GORDO_CLIENT_TARGET" \
&& gordo client --project $GORDO_CLIENT_PROJECT --parallelism 2 --host $GORDO_CLIENT_HOST --port $GORDO_CLIENT_PORT --scheme $GORDO_CLIENT_SCHEME --metadata $GORDO_CLIENT_METADATA predict --target $GORDO_CLIENT_TARGET --influx-uri $GORDO_CLIENT_PREDICT_INFLUX_URI "$GORDO_TRAIN_START_DATE" $(date --iso-8601=second) --forward-resampled-sensors
&& gordo-client --project $GORDO_CLIENT_PROJECT --parallelism 2 --host $GORDO_CLIENT_HOST --port $GORDO_CLIENT_PORT --scheme $GORDO_CLIENT_SCHEME --metadata $GORDO_CLIENT_METADATA predict --target $GORDO_CLIENT_TARGET --influx-uri $GORDO_CLIENT_PREDICT_INFLUX_URI "$GORDO_TRAIN_START_DATE" $(date --iso-8601=second) --forward-resampled-sensors
resources:
requests:
memory: "{{ client_resources_requests_memory }}M"
Expand Down
6 changes: 3 additions & 3 deletions requirements/full_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cchardet==2.1.5 # via -r requirements.in
certifi==2019.11.28 # via msrest, requests
cffi==1.13.2 # via azure-datalake-store, cryptography
chardet==3.0.4 # via requests
click==7.0 # via -r requirements.in, databricks-cli, flask, mlflow
click==7.1.2 # via -r requirements.in, databricks-cli, flask, gordo.client, mlflow
cloudpickle==1.2.2 # via mlflow
configparser==4.0.2 # via databricks-cli
contextlib2==0.6.0.post1 # via azureml-core
Expand All @@ -53,7 +53,7 @@ google-auth-oauthlib==0.4.1 # via tensorboard
google-auth==1.10.1 # via google-auth-oauthlib, tensorboard
google-pasta==0.1.8 # via tensorflow
gordo-dataset==2.3.6 # via -r requirements.in, gordo.client
gordo.client==0.2.0 # via -r requirements.in
gordo.client==0.2.3 # via -r requirements.in
gorilla==0.3.0 # via mlflow
graphviz==0.13.2 # via catboost
grpcio==1.26.0 # via tensorboard, tensorflow
Expand Down Expand Up @@ -124,7 +124,7 @@ ruamel.yaml==0.15.89 # via azureml-core
scikit-learn==0.23.2 # via -r requirements.in, gordo-dataset, gordo.client
scipy==1.4.1 # via catboost, scikit-learn
secretstorage==3.1.2 # via azureml-core
simplejson==3.17.0 # via -r requirements.in, mlflow
simplejson==3.17.2 # via -r requirements.in, gordo.client, mlflow
six==1.14.0 # via absl-py, azure-core, azure-identity, azureml-core, catboost, cryptography, cycler, databricks-cli, docker, flask-restplus, google-auth, google-pasta, grpcio, h5py, influxdb, isodate, jsonschema, keras-preprocessing, mlflow, plotly, protobuf, pyopenssl, pyrsistent, python-dateutil, querystring-parser, retrying, tensorboard, tensorflow, websocket-client
smmap2==2.0.5 # via gitdb2
sqlalchemy==1.3.13 # via alembic, mlflow
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ gordo-dataset~=2.3.6
jeepney>=0.6
packaging~=20.7
pydantic~=1.7.3
gordo.client~=0.2.0
gordo.client~=0.2.3
Loading

0 comments on commit e768ddf

Please sign in to comment.