Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove legacy ObjectMetadata table references #488

Merged
merged 4 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 1 addition & 7 deletions sdlf-datalakeLibrary/python/datalake_library/sdlf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def __init__(
log_level=None,
ssm_interface=None,
instance=None,
object_metadata_table_instance=None,
peh_table_instance=None,
manifests_table_instance=None,
):
Expand All @@ -84,7 +83,6 @@ def __init__(
"""
self.log_level = log_level or os.getenv("LOG_LEVEL", "INFO")
self._logger = init_logger(__name__, self.log_level)
self.object_metadata_table_instance = object_metadata_table_instance or instance
self.peh_table_instance = peh_table_instance or instance
self.manifests_table_instance = manifests_table_instance or instance

Expand All @@ -95,13 +93,9 @@ def __init__(

def _fetch_from_ssm(self):
self._logger.info(
f"Reading configuration from SSM Parameter Store with configuration instances: {self.object_metadata_table_instance} {self.peh_table_instance} {self.manifests_table_instance}"
f"Reading configuration from SSM Parameter Store with configuration instances: {self.peh_table_instance} {self.manifests_table_instance}"
)
try:
object_metadata_table_ssm = f"/sdlf/storage/rDynamoObjectMetadata/{self.object_metadata_table_instance}"
self._logger.debug(f"Obtaining SSM Parameter: {object_metadata_table_ssm}")
self.object_metadata_table = self._ssm.get_parameter(Name=object_metadata_table_ssm)["Parameter"]["Value"]

peh_table_ssm = f"/sdlf/dataset/rDynamoPipelineExecutionHistory/{self.peh_table_instance}"
self._logger.debug(f"Obtaining SSM Parameter: {peh_table_ssm}")
self.peh_table = self._ssm.get_parameter(Name=peh_table_ssm)["Parameter"]["Value"]
Expand Down
2 changes: 0 additions & 2 deletions sdlf-datalakeLibrary/python/datalake_library/sdlf/peh.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ def __init__(
region: str = "us-east-1",
profile: str = "default",
# instance: str = "dev",
object_metadata_table_instance=None,
peh_table_instance=None,
manifests_table_instance=None,
sns_topic: str = None,
):
self.dynamodb = boto3.client("dynamodb")
dynamo_config = DynamoConfiguration(
object_metadata_table_instance=object_metadata_table_instance,
peh_table_instance=peh_table_instance,
manifests_table_instance=manifests_table_instance,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
pipeline = os.environ["PIPELINE"]
pipeline_stage = os.environ["PIPELINE_STAGE"]
deployment_instance = os.environ["DEPLOYMENT_INSTANCE"]
object_metadata_table_instance = os.environ["STORAGE_DEPLOYMENT_INSTANCE"]
peh_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]
manifests_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]

Expand All @@ -29,7 +28,6 @@ def lambda_handler(event, context):
pipeline_execution = PipelineExecutionHistoryAPI(
run_in_context="LAMBDA",
region=os.getenv("AWS_REGION"),
object_metadata_table_instance=object_metadata_table_instance,
peh_table_instance=peh_table_instance,
manifests_table_instance=manifests_table_instance,
)
Expand Down
3 changes: 2 additions & 1 deletion sdlf-stage-glue/src/lambda/redrive/src/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
from datalake_library.interfaces.sqs_interface import SQSInterface

logger = init_logger(__name__)
deployment_instance = os.environ["DEPLOYMENT_INSTANCE"]


def lambda_handler(event, context):
try:
sqs_config = SQSConfiguration(os.environ["TEAM"], os.environ["PIPELINE"], os.environ["STAGE"])
sqs_config = SQSConfiguration(instance=deployment_instance)
dlq_interface = SQSInterface(sqs_config.get_stage_dlq_name)
messages = dlq_interface.receive_messages(1)
if not messages:
Expand Down
2 changes: 0 additions & 2 deletions sdlf-stage-glue/src/lambda/routing/src/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
pipeline = os.environ["PIPELINE"]
pipeline_stage = os.environ["PIPELINE_STAGE"]
deployment_instance = os.environ["DEPLOYMENT_INSTANCE"]
object_metadata_table_instance = os.environ["STORAGE_DEPLOYMENT_INSTANCE"]
peh_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]
manifests_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]

Expand Down Expand Up @@ -97,7 +96,6 @@ def lambda_handler(event, context):
pipeline_execution = PipelineExecutionHistoryAPI(
run_in_context="LAMBDA",
region=os.getenv("AWS_REGION"),
object_metadata_table_instance=object_metadata_table_instance,
peh_table_instance=peh_table_instance,
manifests_table_instance=manifests_table_instance,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
pipeline = os.environ["PIPELINE"]
pipeline_stage = os.environ["PIPELINE_STAGE"]
deployment_instance = os.environ["DEPLOYMENT_INSTANCE"]
object_metadata_table_instance = os.environ["STORAGE_DEPLOYMENT_INSTANCE"]
peh_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]
manifests_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]

Expand All @@ -29,7 +28,6 @@ def lambda_handler(event, context):
pipeline_execution = PipelineExecutionHistoryAPI(
run_in_context="LAMBDA",
region=os.getenv("AWS_REGION"),
object_metadata_table_instance=object_metadata_table_instance,
peh_table_instance=peh_table_instance,
manifests_table_instance=manifests_table_instance,
)
Expand Down
2 changes: 0 additions & 2 deletions sdlf-stage-lambda/src/lambda/routing/src/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
pipeline = os.environ["PIPELINE"]
pipeline_stage = os.environ["PIPELINE_STAGE"]
deployment_instance = os.environ["DEPLOYMENT_INSTANCE"]
object_metadata_table_instance = os.environ["STORAGE_DEPLOYMENT_INSTANCE"]
peh_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]
manifests_table_instance = os.environ["DATASET_DEPLOYMENT_INSTANCE"]

Expand Down Expand Up @@ -97,7 +96,6 @@ def lambda_handler(event, context):
pipeline_execution = PipelineExecutionHistoryAPI(
run_in_context="LAMBDA",
region=os.getenv("AWS_REGION"),
object_metadata_table_instance=object_metadata_table_instance,
peh_table_instance=peh_table_instance,
manifests_table_instance=manifests_table_instance,
)
Expand Down