Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions docs/source/generated/paasta_tools.check_spark_jobs.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/generated/paasta_tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Submodules
paasta_tools.check_kubernetes_services_replication
paasta_tools.check_oom_events
paasta_tools.check_services_replication_tools
paasta_tools.check_spark_jobs
paasta_tools.cleanup_expired_autoscaling_overrides
paasta_tools.cleanup_kubernetes_cr
paasta_tools.cleanup_kubernetes_crd
Expand Down
80 changes: 0 additions & 80 deletions general_itests/steps/paasta_execute_docker_command.py

This file was deleted.

1 change: 0 additions & 1 deletion paasta_tools/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def make_app(global_config=None):
)
config.include(profiling)

config.add_route("resources.utilization", "/v1/resources/utilization")
config.add_route(
"service.instance.status", "/v1/services/{service}/{instance}/status"
)
Expand Down
37 changes: 0 additions & 37 deletions paasta_tools/api/api_docs/oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1383,43 +1383,6 @@ paths:
description: Service instance not found
"500":
description: Failure
/resources/utilization:
get:
operationId: resources
parameters:
- description: comma separated list of keys to group by
in: query
name: groupings
required: false
schema:
items:
type: string
type: array
style: simple
- description: List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'.
Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4)
explode: true
in: query
name: filter
required: false
style: form
schema:
items:
pattern: (.*):(.*,)*(.*)
type: string
type: array
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Resource'
description: Resources in the cluster, filtered and grouped by parameters
"400":
description: Poorly formated query parameters
summary: Get resources in the cluster
tags:
- resources
/service_autoscaler/pause:
delete:
operationId: delete_service_autoscaler_pause
Expand Down
45 changes: 0 additions & 45 deletions paasta_tools/api/api_docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,51 +352,6 @@
]
}
},
"/resources/utilization": {
"get": {
"responses": {
"200": {
"description": "Resources in the cluster, filtered and grouped by parameters",
"schema": {
"$ref": "#/definitions/Resource"
}
},
"400": {
"description": "Poorly formated query parameters"
}
},
"summary": "Get resources in the cluster",
"operationId": "resources",
"tags": [
"resources"
],
"parameters": [
{
"in": "query",
"description": "comma separated list of keys to group by",
"name": "groupings",
"required": false,
"type": "array",
"collectionFormat": "csv",
"items": {
"type": "string"
}
},
{
"in": "query",
"description": "List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4)",
"name": "filter",
"required": false,
"type": "array",
"collectionFormat": "multi",
"items": {
"type": "string",
"pattern": "(.*):(.*,)*(.*)"
}
}
]
}
},
"/services": {
"get": {
"responses": {
Expand Down
2 changes: 0 additions & 2 deletions paasta_tools/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
class PaastaOApiClient:
autoscaler: paastaapis.AutoscalerApi
default: paastaapis.DefaultApi
resources: paastaapis.ResourcesApi
service: paastaapis.ServiceApi
remote_run: paastaapis.RemoteRunApi
api_error: Type[paastaapi.ApiException]
Expand Down Expand Up @@ -71,7 +70,6 @@ def get_paasta_oapi_client_by_url(
return PaastaOApiClient(
autoscaler=paastaapis.AutoscalerApi(client),
default=paastaapis.DefaultApi(client),
resources=paastaapis.ResourcesApi(client),
service=paastaapis.ServiceApi(client),
remote_run=paastaapis.RemoteRunApi(client),
api_error=paastaapi.ApiException,
Expand Down
36 changes: 2 additions & 34 deletions paasta_tools/api/views/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,21 @@
"""
import asyncio
import logging
import re
import traceback
from typing import Any
from typing import Dict
from typing import List
from typing import Mapping
from typing import Optional

import a_sync
from pyramid.response import Response
from pyramid.view import view_config

import paasta_tools.mesos.exceptions as mesos_exceptions
from paasta_tools import tron_tools
from paasta_tools.api import settings
from paasta_tools.api.views.exception import ApiFailure
from paasta_tools.cli.cmds.status import get_actual_deployments
from paasta_tools.instance import kubernetes as pik
from paasta_tools.mesos_tools import get_all_frameworks as get_all_mesos_frameworks
from paasta_tools.utils import compose_job_id
from paasta_tools.utils import DeploymentVersion
from paasta_tools.utils import NoConfigurationForServiceError
Expand Down Expand Up @@ -94,34 +90,10 @@ def tron_instance_status(
return status


def legacy_remote_run_filter_frameworks(service, instance, frameworks=None):
if frameworks is None:
frameworks = get_all_mesos_frameworks(active_only=True)

prefix = f"paasta-remote {service}.{instance}"
return [f for f in frameworks if f.name.startswith(prefix)]


def adhoc_instance_status(
instance_status: Mapping[str, Any], service: str, instance: str, verbose: int
) -> List[Dict[str, Any]]:
status = []
filtered = legacy_remote_run_filter_frameworks(service, instance)
filtered.sort(key=lambda x: x.name)
for f in filtered:
launch_time, run_id = re.match(
r"paasta-remote [^\s]+ (\w+) (\w+)", f.name
).groups()
status.append(
{"launch_time": launch_time, "run_id": run_id, "framework_id": f.id}
)
return status


async def _task_result_or_error(future):
try:
return {"value": await future}
except (AttributeError, mesos_exceptions.SlaveDoesNotExist):
except AttributeError:
return {"error_message": "None"}
except TimeoutError:
return {"error_message": "Timed Out"}
Expand Down Expand Up @@ -194,11 +166,7 @@ def instance_status(request):
instance_status["version"] = ""
instance_status["git_sha"] = ""
try:
if instance_type == "adhoc":
instance_status["adhoc"] = adhoc_instance_status(
instance_status, service, instance, verbose
)
elif pik.can_handle(instance_type):
if pik.can_handle(instance_type):
instance_status.update(
pik.instance_status(
service=service,
Expand Down
76 changes: 0 additions & 76 deletions paasta_tools/api/views/resources.py

This file was deleted.

9 changes: 1 addition & 8 deletions paasta_tools/broadcast_log_to_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import sys

from paasta_tools.kubernetes_tools import get_all_kubernetes_services_running_here
from paasta_tools.mesos_tools import MesosSlaveConnectionError
from paasta_tools.tron_tools import tron_jobs_running_here
from paasta_tools.utils import _log
from paasta_tools.utils import DEFAULT_SOA_DIR
from paasta_tools.utils import load_system_paasta_config
Expand All @@ -41,17 +39,12 @@ def broadcast_log_all_services_running_here(line: str, soa_dir=DEFAULT_SOA_DIR)


def get_all_services_running_here(cluster, soa_dir):
try:
tron_services = tron_jobs_running_here()
except MesosSlaveConnectionError:
tron_services = []

try:
kubernetes_services = get_all_kubernetes_services_running_here()
except Exception:
kubernetes_services = []

return tron_services + kubernetes_services
return kubernetes_services


def main() -> None:
Expand Down
Loading
Loading