Skip to content
Snippets Groups Projects
Commit 644adfb8 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

Final Condor Environment Changes

parent 0bec4d4a
No related branches found
No related tags found
1 merge request!263Final Condor Environment Changes
Pipeline #1792 passed
......@@ -40,16 +40,16 @@ class CalibrationLauncher(CasaLauncherIF):
def run(self):
logger.info("RUNNING CASA!")
os.chdir("./working")
result = subprocess.Popen("PYTHONPATH='' xvfb-run -e ${PWD}/xvfb-run.err.txt -d -s \"-screen 0 800x600x16\" "
"${CASA_HOME}/bin/casa --pipeline --nogui --nologger -c "
"${CASA_HOME}/pipeline/pipeline/runvlapipeline.py ${PPR_FILENAME} || true",
shell=True, executable="/bin/bash", stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = subprocess.Popen("${CASA_HOME}/bin/casa --pipeline --nogui --nologger -c "
"${CASA_HOME}/pipeline/pipeline/runvlapipeline.py ${PPR_FILENAME} || true",
shell=True, executable="/bin/bash", stdout=sys.stdout, stderr=sys.stderr)
return result.communicate()
def setup_environment(self, parameters: dict):
os.environ['SCIPIPE_ROOTDIR'] = parameters["rootDirectory"]
os.environ['CASA_HOME'] = parameters["homeForReprocessing"]
os.environ['PPR_FILENAME'] = str(self.ppr)
os.environ['LANG'] = "en_US.UTF-8"
logger.info("Checking processing environment:")
env1 = os.environ.get('SCIPIPE_ROOTDIR')
......@@ -58,7 +58,9 @@ class CalibrationLauncher(CasaLauncherIF):
logger.info(f"CASA_HOME: {env2}")
env3 = os.environ.get('PPR_FILENAME')
logger.info(f"PPR_FILENAME: {env3}")
if 'None' in [env1, env2, env3]:
env4 = os.environ.get('LANG')
logger.info(f"LANG: {env4}")
if 'None' in [env1, env2, env3, env4]:
logger.info("Environment setup Failed!")
sys.exit(1)
else:
......
......@@ -11,6 +11,8 @@ README = Path("README.md").read_text()
requires = [
"ssa-workspaces",
"ssa-messaging",
"sqlalchemy",
"pycapo"
]
setup(
......
......@@ -275,7 +275,7 @@ class WorkflowMonitor:
event_type = self._parse_event_type(int(event_match.group("eventnum")))
if event_type == "workflow-terminated":
if event_type == "workflow-terminated" or event_type == "workflow-aborted":
retval = get_retval(event_match.group("body"))
event_type = self._get_job_result(retval)
else:
......@@ -311,6 +311,7 @@ class WorkflowMonitor:
event_meanings = {
0: "workflow-executing",
5: "workflow-terminated",
9: "workflow-aborted"
}
return event_meanings.get(condor_event_num, "unknown")
......
"""fix std_calibration env
Revision ID: 69c10adfb322
Revises: b9945cdb3b1e
Create Date: 2021-06-02 14:56:07.681712
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '69c10adfb322'
down_revision = 'b9945cdb3b1e'
branch_labels = None
depends_on = None
def upgrade():
op.execute(
"""
UPDATE workflow_templates
SET content=E'executable = std_calibration.sh
arguments = {{product_locator}} {{request_id}} metadata.json PPR.xml
output = calibration.out
error = calibration.err
log = condor.log
SBIN_PATH = /lustre/aoc/cluster/pipeline/$ENV(CAPO_PROFILE)/workspaces/sbin
should_transfer_files = yes
transfer_input_files = $(SBIN_PATH)/pycapo, $(SBIN_PATH)/framework.sh, $(SBIN_PATH)/productfetcher, $(SBIN_PATH)/casa_envoy, $(SBIN_PATH)/deliver-cipl.sh, ./PPR.xml, ./metadata.json
transfer_output_files = working, rawdata, products
request_memory = 48G
getenv = True
environment = "CAPO_PATH=/home/casa/capo HOME=/users/vlapipe"
queue
'
WHERE filename='std_calibration.condor' and workflow_name='std_calibration'
"""
)
def downgrade():
op.execute(
"""
UPDATE workflow_templates
SET content=E'executable = std_calibration.sh
arguments = {{product_locator}} {{request_id}} metadata.json PPR.xml
output = calibration.out
error = calibration.err
log = condor.log
SBIN_PATH = /lustre/aoc/cluster/pipeline/$ENV(CAPO_PROFILE)/workspaces/sbin
should_transfer_files = yes
transfer_input_files = $(SBIN_PATH)/pycapo, $(SBIN_PATH)/framework.sh, $(SBIN_PATH)/productfetcher, $(SBIN_PATH)/casa_envoy, $(SBIN_PATH)/deliver-cipl.sh, ./PPR.xml, ./metadata.json
transfer_output_files = working, rawdata, products
getenv = True
environment = "CAPO_PATH=/home/casa/capo"
queue
'
WHERE filename='std_calibration.condor' and workflow_name='std_calibration'
"""
)
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