Skip to content

Commit

Permalink
refactor: rename pod to deployment (#4230)
Browse files Browse the repository at this point in the history
* refactor: rename pod to deployment

* style: fix overload and cli autocomplete

* fix: undo daemon mistake

* refactor: leftover cleanup

* fix: more test fixes

* fix: more fixes

* fix: more fixes

* fix: more fixes

* fix: more tests

* fix: fix more tests

* refactor: fix more tests

* refactor: more tests fixes

* refactor: rename pea to pod

* refactor: adjust docs

* refactor: complete pea renaming

* refactor: more fixes

* fix: pea_type in k8s yamls

* fix: adjust pod args name

* refactor: rename peapods parser folder

* fix: da init

Co-authored-by: Jina Dev Bot <dev-bot@jina.ai>
  • Loading branch information
jacobowitz and jina-bot committed Feb 4, 2022
1 parent 7cb8c34 commit 13edc16
Show file tree
Hide file tree
Showing 237 changed files with 5,293 additions and 5,057 deletions.
26 changes: 13 additions & 13 deletions cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
from argparse import Namespace


def pod(args: 'Namespace'):
def deployment(args: 'Namespace'):
"""
Start a Pod
Start a Deployment
:param args: arguments coming from the CLI.
"""
from jina.orchestrate.pods import Pod
from jina.orchestrate.deployments import Deployment

try:
with Pod(args) as p:
p.join()
with Deployment(args) as d:
d.join()
except KeyboardInterrupt:
pass


def pea(args: 'Namespace'):
def pod(args: 'Namespace'):
"""
Start a Pea
Start a Pod
:param args: arguments coming from the CLI.
"""
from jina.orchestrate.peas.factory import PeaFactory
from jina.orchestrate.pods.factory import PodFactory

try:
with PeaFactory.build_pea(args) as p:
with PodFactory.build_pod(args) as p:
p.join()
except KeyboardInterrupt:
pass
Expand Down Expand Up @@ -67,12 +67,12 @@ def executor(args: 'Namespace'):
:param args: arguments coming from the CLI.
:returns: return the same as `pea` or `worker_runtime`
:returns: return the same as `pod` or `worker_runtime`
"""
if args.native:
return executor_native(args)
else:
return pea(args)
return pod(args)


def worker_runtime(args: 'Namespace'):
Expand All @@ -92,7 +92,7 @@ def worker_runtime(args: 'Namespace'):

def gateway(args: 'Namespace'):
"""
Start a Gateway Pod
Start a Gateway Deployment
:param args: arguments coming from the CLI.
"""
Expand All @@ -115,7 +115,7 @@ def gateway(args: 'Namespace'):

def ping(args: 'Namespace'):
"""
Check the connectivity of a Pea
Check the connectivity of a Pod
:param args: arguments coming from the CLI.
"""
Expand Down
18 changes: 9 additions & 9 deletions cli/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
'gateway',
'hub',
'help',
'pea',
'pod',
'deployment',
'client',
'export-api',
],
Expand Down Expand Up @@ -87,7 +87,7 @@
'--expose-public',
'--shard-id',
'--replica-id',
'--pea-role',
'--pod-role',
'--noblock-on-start',
'--shards',
'--replicas',
Expand Down Expand Up @@ -155,7 +155,7 @@
'--proxy',
'--port-expose',
'--graph-description',
'--pods-addresses',
'--deployments-addresses',
'--daemon',
'--runtime-backend',
'--runtime',
Expand All @@ -165,7 +165,7 @@
'--expose-public',
'--shard-id',
'--replica-id',
'--pea-role',
'--pod-role',
'--noblock-on-start',
'--shards',
'--replicas',
Expand Down Expand Up @@ -203,7 +203,7 @@
],
'hub': ['--help', 'new', 'push', 'pull'],
'help': ['--help'],
'pea': [
'pod': [
'--help',
'--name',
'--workspace',
Expand Down Expand Up @@ -244,7 +244,7 @@
'--expose-public',
'--shard-id',
'--replica-id',
'--pea-role',
'--pod-role',
'--noblock-on-start',
'--shards',
'--replicas',
Expand All @@ -255,7 +255,7 @@
'--uses-after-address',
'--connection-list',
],
'pod': [
'deployment': [
'--help',
'--name',
'--workspace',
Expand Down Expand Up @@ -296,7 +296,7 @@
'--expose-public',
'--shard-id',
'--replica-id',
'--pea-role',
'--pod-role',
'--noblock-on-start',
'--shards',
'--replicas',
Expand All @@ -309,7 +309,7 @@
'--uses-before',
'--uses-after',
'--external',
'--pod-role',
'--deployment-role',
],
'client': [
'--help',
Expand Down
32 changes: 16 additions & 16 deletions daemon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def _get_app(mode=None):
app.add_exception_handler(RequestValidationError, validation_exception_handler)

if mode is None:
from daemon.api.endpoints import flows, pods, peas, logs, workspaces
from daemon.api.endpoints import flows, deployments, pods, logs, workspaces

app.include_router(logs.router)
app.include_router(peas.router)
app.include_router(pods.router)
app.include_router(deployments.router)
app.include_router(flows.router)
app.include_router(workspaces.router)
app.add_exception_handler(Runtime400Exception, daemon_runtime_exception_handler)
Expand All @@ -72,12 +72,12 @@ def _get_app(mode=None):
'description': 'API to manage Flows',
},
{
'name': 'pods',
'description': 'API to manage Pods',
'name': 'deployments',
'description': 'API to manage Deployments',
},
{
'name': 'peas',
'description': 'API to manage Peas',
'name': 'pods',
'description': 'API to manage Pods',
},
{
'name': 'logs',
Expand All @@ -89,30 +89,30 @@ def _get_app(mode=None):
},
]
)
elif mode == 'pod':
from daemon.api.endpoints.partial import pod
elif mode == 'deployment':
from daemon.api.endpoints.partial import deployment

app.include_router(pod.router)
app.include_router(deployment.router)
app.add_exception_handler(
PartialDaemon400Exception, partial_daemon_exception_handler
)
app.openapi_tags.append(
{
'name': 'pod',
'description': 'API to manage a Pod',
'name': 'deployment',
'description': 'API to manage a Deployment',
}
)
elif mode == 'pea':
from daemon.api.endpoints.partial import pea
elif mode == 'pod':
from daemon.api.endpoints.partial import pod

app.include_router(pea.router)
app.include_router(pod.router)
app.add_exception_handler(
PartialDaemon400Exception, partial_daemon_exception_handler
)
app.openapi_tags.append(
{
'name': 'pea',
'description': 'API to manage a Pea',
'name': 'pod',
'description': 'API to manage a Pod',
},
)
elif mode == 'flow':
Expand Down

0 comments on commit 13edc16

Please sign in to comment.