Skip to content

Commit

Permalink
Release 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermef committed Dec 27, 2022
1 parent cdafb9d commit 5e238b3
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 5 deletions.
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,67 @@ remotecv --with-healthcheck --server-port=8888
make unit
```

## RemoveCV parameters
```sh
Usage: remotecv [OPTIONS]

Runs RemoteCV

Options:
Worker Backend:
-b, --backend [pyres|celery] Worker backend [env var: BACKEND]
Pyres Connection Arguments:
--host TEXT Redis host [env var: REDIS_HOST]
--port INTEGER Redis port [env var: REDIS_PORT]
--database INTEGER Redis database [env var: REDIS_DATABASE]
--password TEXT Redis password [env var: REDIS_PASSWORD]
--redis-mode [single_node|sentinel]
Redis mode [env var: REDIS_MODE]
--sentinel-instances TEXT Redis Sentinel instances e.g.
'localhost:26376,localhost:26377' [env var:
REDIS_SENTINEL_INSTANCES]
--sentinel-password TEXT Redis Sentinel password [env var:
REDIS_SENTINEL_PASSWORD]
--master-instance TEXT Redis Sentinel master instance [env var:
REDIS_MASTER_INSTANCE]
--master-password TEXT Redis Sentinel master password [env var:
REDIS_MASTER_PASSWORD]
--master-database INTEGER Redis Sentinel master database [env var:
REDIS_MASTER_DATABASE]
--socket-timeout FLOAT Redis Sentinel socket timeout [env var:
REDIS_SENTINEL_SOCKET_TIMEOUT]
Celery/SQS Connection Arguments:
--region TEXT AWS SQS Region [env var: AWS_REGION]
--key-id TEXT AWS access key id [env var:
AWS_ACCESS_KEY_ID]
--key-secret TEXT AWS access key secret [env var:
AWS_SECRET_ACCESS_KEY]
--polling-interval INTEGER AWS polling interval [env var:
SQS_POLLING_INTERVAL]
--celery-commands TEXT SQS command [env var: CELERY_COMMANDS]
Other arguments:
--server-port INTEGER HTTP server port [env var:
HTTP_SERVER_PORT]
--with-healthcheck Start a healthcheck http endpoint [env var:
WITH_HEALTHCHECK]
-l, --level [debug|info|warning|error|critical]
Logging level [env var: LOG_LEVEL]
-o, --loader TEXT Image loader [env var: IMAGE_LOADER]
-s, --store TEXT Detector result store [env var:
DETECTOR_STORAGE]
-t, --timeout INTEGER Timeout in seconds for image detection [env
var: DETECTOR_TIMEOUT]
--sentry-url TEXT Sentry URL [env var: SENTRY_URL]
--metrics TEXT Metrics client, should be the full name of a
python module [env var: METRICS_CLIENT]
Memcached store arguments:
--memcached-hosts TEXT Comma separated list of memcached hosts
[env var: MEMCACHED_HOSTS]
--help Show this message and exit.
```

RemoteCV can also be configured via environment variables

[thumbor]: https://github.com/thumbor/thumbor/wiki
[PyRes]: https://github.com/binarydud/pyres
[Celery]: https://www.celeryproject.org
Expand Down
2 changes: 1 addition & 1 deletion remotecv/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.0.1"
__version__ = "5.0.0"
46 changes: 42 additions & 4 deletions remotecv/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,94 +81,123 @@ def import_modules():
"-b",
"--backend",
envvar="BACKEND",
show_envvar=True,
default="pyres",
type=click.Choice(["pyres", "celery"]),
help="Worker backend",
)
@optgroup.group("Pyres Connection Arguments")
@optgroup.option(
"--host", envvar="REDIS_HOST", default="localhost", help="Redis host"
"--host",
envvar="REDIS_HOST",
show_envvar=True,
default="localhost",
help="Redis host",
)
@optgroup.option(
"--port", envvar="REDIS_PORT", default=6379, help="Redis port"
"--port",
envvar="REDIS_PORT",
show_envvar=True,
default=6379,
help="Redis port",
)
@optgroup.option(
"--database", envvar="REDIS_DATABASE", default=0, help="Redis database"
"--database",
envvar="REDIS_DATABASE",
show_envvar=True,
default=0,
help="Redis database",
)
@optgroup.option(
"--password", envvar="REDIS_PASSWORD", default=None, help="Redis password"
"--password",
envvar="REDIS_PASSWORD",
show_envvar=True,
default=None,
help="Redis password",
)
@optgroup.option(
"--redis-mode",
envvar="REDIS_MODE",
show_envvar=True,
default=SINGLE_NODE,
type=click.Choice([SINGLE_NODE, SENTINEL]),
help="Redis mode",
)
@optgroup.option(
"--sentinel-instances",
envvar="REDIS_SENTINEL_INSTANCES",
show_envvar=True,
default="localhost:26376",
help="Redis Sentinel instances e.g. 'localhost:26376,localhost:26377'",
)
@optgroup.option(
"--sentinel-password",
envvar="REDIS_SENTINEL_PASSWORD",
show_envvar=True,
default=None,
help="Redis Sentinel password",
)
@optgroup.option(
"--master-instance",
envvar="REDIS_MASTER_INSTANCE",
show_envvar=True,
default=None,
help="Redis Sentinel master instance",
)
@optgroup.option(
"--master-password",
envvar="REDIS_MASTER_PASSWORD",
show_envvar=True,
default=None,
help="Redis Sentinel master password",
)
@optgroup.option(
"--master-database",
envvar="REDIS_MASTER_DATABASE",
show_envvar=True,
default=0,
help="Redis Sentinel master database",
)
@optgroup.option(
"--socket-timeout",
envvar="REDIS_SENTINEL_SOCKET_TIMEOUT",
show_envvar=True,
default=10.0,
help="Redis Sentinel socket timeout",
)
@optgroup.group("Celery/SQS Connection Arguments")
@optgroup.option(
"--region",
envvar="AWS_REGION",
show_envvar=True,
default="us-east-1",
help="AWS SQS Region",
)
@optgroup.option(
"--key-id",
envvar="AWS_ACCESS_KEY_ID",
show_envvar=True,
default=None,
help="AWS access key id",
)
@optgroup.option(
"--key-secret",
envvar="AWS_SECRET_ACCESS_KEY",
show_envvar=True,
default=None,
help="AWS access key secret",
)
@optgroup.option(
"--polling-interval",
envvar="SQS_POLLING_INTERVAL",
show_envvar=True,
default=20,
help="AWS polling interval",
)
@optgroup.option(
"--celery-commands",
envvar="CELERY_COMMANDS",
show_envvar=True,
default=[],
multiple=True,
help="SQS command",
Expand All @@ -177,12 +206,14 @@ def import_modules():
@optgroup.option(
"--server-port",
envvar="HTTP_SERVER_PORT",
show_envvar=True,
default=8080,
help="HTTP server port",
)
@optgroup.option(
"--with-healthcheck",
envvar="WITH_HEALTHCHECK",
show_envvar=True,
is_flag=True,
default=False,
help="Start a healthcheck http endpoint",
Expand All @@ -191,6 +222,7 @@ def import_modules():
"-l",
"--level",
envvar="LOG_LEVEL",
show_envvar=True,
type=click.Choice(["debug", "info", "warning", "error", "critical"]),
default="debug",
help="Logging level",
Expand All @@ -199,40 +231,46 @@ def import_modules():
"-o",
"--loader",
envvar="IMAGE_LOADER",
show_envvar=True,
default="remotecv.http_loader",
help="Image loader",
)
@optgroup.option(
"-s",
"--store",
envvar="DETECTOR_STORAGE",
show_envvar=True,
default="remotecv.result_store.redis_store",
help="Detector result store",
)
@optgroup.option(
"-t",
"--timeout",
envvar="DETECTOR_TIMEOUT",
show_envvar=True,
default=None,
type=click.INT,
help="Timeout in seconds for image detection",
)
@optgroup.option(
"--sentry-url",
envvar="SENTRY_URL",
show_envvar=True,
default=None,
help="Sentry URL",
)
@optgroup.option(
"--metrics",
envvar="METRICS_CLIENT",
show_envvar=True,
default="remotecv.metrics.logger_metrics",
help="Metrics client, should be the full name of a python module",
)
@optgroup.group("Memcached store arguments")
@optgroup.option(
"--memcached-hosts",
envvar="MEMCACHED_HOSTS",
show_envvar=True,
default="localhost:11211",
help="Comma separated list of memcached hosts",
)
Expand Down

0 comments on commit 5e238b3

Please sign in to comment.