Skip to content

Commit

Permalink
♻️ Replace r clone ⚠️🚨 (ITISFoundation#6119)
Browse files Browse the repository at this point in the history
  • Loading branch information
matusdrobuliak66 authored Aug 5, 2024
1 parent b409bf2 commit a66a1ed
Show file tree
Hide file tree
Showing 32 changed files with 1,158 additions and 87 deletions.
2 changes: 2 additions & 0 deletions .env-devel
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ AUTOSCALING_NODES_MONITORING=null
AUTOSCALING_POLL_INTERVAL=10
AUTOSCALING_SSM_ACCESS=null

AWS_S3_CLI_S3='{"S3_ACCESS_KEY":"12345678", "S3_BUCKET_NAME":"simcore", "S3_ENDPOINT": "http://172.17.0.1:9001", "S3_SECRET_KEY": "12345678", "S3_REGION": "us-east-1"}'

CATALOG_BACKGROUND_TASK_REST_TIME=60
CATALOG_DEV_FEATURES_ENABLED=0
CATALOG_HOST=catalog
Expand Down
11 changes: 11 additions & 0 deletions packages/settings-library/src/settings_library/aws_s3_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pydantic import Field

from .base import BaseCustomSettings
from .s3 import S3Settings


class AwsS3CliSettings(BaseCustomSettings):
AWS_S3_CLI_S3: S3Settings = Field(
default=None,
description="These settings intentionally do not use auto_default_from_env=True because we might want to turn them off if RClone is enabled.",
)
10 changes: 10 additions & 0 deletions packages/simcore-sdk/src/simcore_sdk/node_data/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from servicelib.archiving_utils import unarchive_dir
from servicelib.logging_utils import log_context
from servicelib.progress_bar import ProgressBarData
from settings_library.aws_s3_cli import AwsS3CliSettings
from settings_library.r_clone import RCloneSettings

from ..node_ports_common import filemanager
Expand Down Expand Up @@ -41,6 +42,7 @@ async def _push_directory(
r_clone_settings: RCloneSettings,
exclude_patterns: set[str] | None = None,
progress_bar: ProgressBarData,
aws_s3_cli_settings: AwsS3CliSettings | None,
) -> None:
s3_object = __create_s3_object_key(project_id, node_uuid, source_path)
with log_context(
Expand All @@ -56,6 +58,7 @@ async def _push_directory(
io_log_redirect_cb=io_log_redirect_cb,
progress_bar=progress_bar,
exclude_patterns=exclude_patterns,
aws_s3_cli_settings=aws_s3_cli_settings,
)


Expand All @@ -68,6 +71,7 @@ async def _pull_directory(
io_log_redirect_cb: LogRedirectCB,
r_clone_settings: RCloneSettings,
progress_bar: ProgressBarData,
aws_s3_cli_settings: AwsS3CliSettings | None,
save_to: Path | None = None,
) -> None:
save_to_path = destination_path if save_to is None else save_to
Expand All @@ -84,6 +88,7 @@ async def _pull_directory(
io_log_redirect_cb=io_log_redirect_cb,
r_clone_settings=r_clone_settings,
progress_bar=progress_bar,
aws_s3_cli_settings=aws_s3_cli_settings,
)


Expand Down Expand Up @@ -116,6 +121,7 @@ async def _pull_legacy_archive(
io_log_redirect_cb=io_log_redirect_cb,
r_clone_settings=None,
progress_bar=sub_prog,
aws_s3_cli_settings=None,
)
_logger.info("completed pull of %s.", destination_path)

Expand Down Expand Up @@ -195,6 +201,7 @@ async def push(
r_clone_settings: RCloneSettings,
exclude_patterns: set[str] | None = None,
progress_bar: ProgressBarData,
aws_s3_cli_settings: AwsS3CliSettings | None,
) -> None:
"""pushes and removes the legacy archive if present"""

Expand All @@ -207,6 +214,7 @@ async def push(
exclude_patterns=exclude_patterns,
io_log_redirect_cb=io_log_redirect_cb,
progress_bar=progress_bar,
aws_s3_cli_settings=aws_s3_cli_settings,
)
archive_exists = await _state_metadata_entry_exists(
user_id=user_id,
Expand Down Expand Up @@ -236,6 +244,7 @@ async def pull(
io_log_redirect_cb: LogRedirectCB,
r_clone_settings: RCloneSettings,
progress_bar: ProgressBarData,
aws_s3_cli_settings: AwsS3CliSettings | None,
) -> None:
"""restores the state folder"""

Expand Down Expand Up @@ -274,6 +283,7 @@ async def pull(
io_log_redirect_cb=io_log_redirect_cb,
r_clone_settings=r_clone_settings,
progress_bar=progress_bar,
aws_s3_cli_settings=aws_s3_cli_settings,
)
return

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from abc import abstractmethod


class BaseLogParser:
@abstractmethod
async def __call__(self, logs: str) -> None:
...
Loading

0 comments on commit a66a1ed

Please sign in to comment.