Skip to content
Snippets Groups Projects
Commit 9a4c04e6 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Fixing the collector and ingest script paths to use the sbin path defined in...

Fixing the collector and ingest script paths to use the sbin path defined in capo since they're no longer copied into the container
parent 8833de56
No related branches found
No related tags found
1 merge request!1480Ingest obs run on lustre
Pipeline #12294 passed
...@@ -177,10 +177,11 @@ class ObservationCollector(CollectorIF): ...@@ -177,10 +177,11 @@ class ObservationCollector(CollectorIF):
source_path = self.parameters["sourcePath"] source_path = self.parameters["sourcePath"]
workflow_dir = self.parameters["workflowDir"] workflow_dir = self.parameters["workflowDir"]
staging_dir = self.parameters["staging_area"] staging_dir = self.parameters["staging_area"]
sbin_dir = self.parameters["script_location"]
# run script # run script
collector = subprocess.run( collector = subprocess.run(
["./observation-product-collector.sh", source_path, workflow_dir, staging_dir], [f".{sbin_dir}/observation-product-collector.sh", source_path, workflow_dir, staging_dir],
stdout=sys.stdout, stdout=sys.stdout,
stderr=sys.stderr, stderr=sys.stderr,
) )
......
...@@ -56,6 +56,7 @@ def _get_settings( ...@@ -56,6 +56,7 @@ def _get_settings(
:return: a dict containing required settings to run the provided ingestion type :return: a dict containing required settings to run the provided ingestion type
""" """
ingestion_settings = CapoConfig().settings("edu.nrao.workspaces.IngestionSettings") ingestion_settings = CapoConfig().settings("edu.nrao.workspaces.IngestionSettings")
script_location = CapoConfig().settings("edu.nrao.workspaces.ProcessingSettings").scriptLocation
capability_url = CapoConfig().settings("edu.nrao.workspaces.CapabilitySettings").externalServiceUrl capability_url = CapoConfig().settings("edu.nrao.workspaces.CapabilitySettings").externalServiceUrl
workflow_url = CapoConfig().settings("edu.nrao.workspaces.WorkflowSettings").serviceUrl workflow_url = CapoConfig().settings("edu.nrao.workspaces.WorkflowSettings").serviceUrl
...@@ -70,6 +71,7 @@ def _get_settings( ...@@ -70,6 +71,7 @@ def _get_settings(
parameters["staging_area"] = ingestion_settings.stagingDirectory parameters["staging_area"] = ingestion_settings.stagingDirectory
parameters["storage_area"] = ingestion_settings.storageDirectory parameters["storage_area"] = ingestion_settings.storageDirectory
parameters["useIngest"] = strtobool(ingestion_settings.useIngest) parameters["useIngest"] = strtobool(ingestion_settings.useIngest)
parameters["script_location"] = script_location
parameters["workflowUrl"] = workflow_url parameters["workflowUrl"] = workflow_url
return parameters return parameters
......
...@@ -33,17 +33,19 @@ from ingest_envoy.schema import AbstractTextFile ...@@ -33,17 +33,19 @@ from ingest_envoy.schema import AbstractTextFile
from ingest_envoy.utilities import IngestType, VLASSIngestType from ingest_envoy.utilities import IngestType, VLASSIngestType
def trigger_ingest(real_ingest: bool, staging_dir: str) -> int: def trigger_ingest(real_ingest: bool, staging_dir: str, bin_dir: str = "") -> int:
""" """
Run ingest Run ingest
:param real_ingest: real ingestion vs. testing flag :param real_ingest: real ingestion vs. testing flag
:param staging_dir: staging directory to ingest from :param staging_dir: staging directory to ingest from
:param bin_dir: directory containing the ingestion script
:return: return code :return: return code
""" """
if real_ingest: if real_ingest:
# TODO: This should be cleaned up when cal and image ingests don't transfer files into condor and use sbin
ingest_process = subprocess.run( ingest_process = subprocess.run(
["./ingest", "--json", "-p", staging_dir], [f".{bin_dir}/ingest", "--json", "-p", staging_dir],
stdout=sys.stdout, stdout=sys.stdout,
stderr=sys.stderr, stderr=sys.stderr,
) )
...@@ -229,7 +231,7 @@ class IngestObservationLauncher(IngestLauncherIF): ...@@ -229,7 +231,7 @@ class IngestObservationLauncher(IngestLauncherIF):
self.prepare_for_ingest() self.prepare_for_ingest()
self.logger.info("Running ingest!") self.logger.info("Running ingest!")
return trigger_ingest(self.parameters["useIngest"], self.staging_source_dir) return trigger_ingest(self.parameters["useIngest"], self.staging_source_dir, self.parameters["script_location"])
def prepare_for_ingest(self): def prepare_for_ingest(self):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment