Skip to content

Commit

Permalink
Automatically cleanup archives and uploads in streams pod
Browse files Browse the repository at this point in the history
  • Loading branch information
polyaxon-ci committed Nov 14, 2024
1 parent b2bfa3a commit f6e77e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions haupt/haupt/streams/endpoints/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Dict, List, Optional, Union

from clipped.utils.bools import to_bool
from clipped.utils.paths import delete_path
from rest_framework import status

from django.core.handlers.asgi import ASGIRequest
Expand Down Expand Up @@ -51,6 +52,13 @@ async def collect_agent_data(
fs = await AppFS.get_fs()
store_path = AppFS.get_fs_root_path()

# Cleanup archives
if store_path != settings.AGENT_CONFIG.local_root:
delete_path(settings.AGENT_CONFIG.local_root)
if store_path != settings.CLIENT_CONFIG.archives_root:
delete_path(settings.CLIENT_CONFIG.archives_root)

# Collect agent data
async def collect_and_archive_agent_services_logs(pods: List[V1Pod]):
for pod in pods:
logs = await collect_agent_service_logs(k8s_manager=k8s_manager, pod=pod)
Expand Down

0 comments on commit f6e77e9

Please sign in to comment.