Skip to content

Commit

Permalink
Convert from bps to idds workflow in prepare.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleGower committed Jan 20, 2023
1 parent 5a932b5 commit 783723b
Show file tree
Hide file tree
Showing 7 changed files with 617 additions and 929 deletions.
1 change: 1 addition & 0 deletions doc/changes/DM-34915.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable saving of iDDS client workflow objects at prepare bps submission stage.
9 changes: 7 additions & 2 deletions python/lsst/ctrl/bps/panda/cmd_line_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import logging
import os
import re

_LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -119,8 +120,12 @@ def substitute_command_line(self, cmd_line, lazy_vars, job_name):
file_name: `str`
job pseudo input file name
"""
cmd_vals = set([m.group(1) for m in re.finditer(r"[^$]{([^}]+)}", cmd_line)])
actual_lazy_vars = {}
for key in cmd_vals:
actual_lazy_vars[key] = lazy_vars[key]

cmd_line = self.replace_static_parameters(cmd_line, lazy_vars)
cmd_line = self.replace_static_parameters(cmd_line, actual_lazy_vars)
cmd_line = self.resolve_submission_side_env_vars(cmd_line)
file_name = job_name + self.attach_pseudo_file_params(lazy_vars)
file_name = job_name + self.attach_pseudo_file_params(actual_lazy_vars)
return cmd_line, file_name
36 changes: 36 additions & 0 deletions python/lsst/ctrl/bps/panda/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is part of ctrl_bps_panda.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Symbolic constants
"""

PANDA_DEFAULT_PROD_SOURCE_LABEL = "managed"
PANDA_DEFAULT_PROCESSING_TYPE = None
PANDA_DEFAULT_TASK_TYPE = "test"
PANDA_DEFAULT_VO = "wlcg"
PANDA_DEFAULT_PRIORITY = 900
PANDA_DEFAULT_MAX_JOBS_PER_TASK = 30000
PANDA_DEFAULT_RSS = 1024
PANDA_DEFAULT_MAX_WALLTIME = 90000
PANDA_DEFAULT_MAX_ATTEMPTS = 3
PANDA_DEFAULT_CORE_COUNT = 1
PANDA_DEFAULT_CLOUD = "US"
PANDA_MAX_LEN_INPUT_FILE = 4000
2 changes: 2 additions & 0 deletions python/lsst/ctrl/bps/panda/edgenode/cmd_line_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def deliver_input_files(src_path, files, skip_copy):
dest = dest_base.join(file_to_copy.basename())
dest.transfer_from(file_to_copy, transfer="copy")
print(f"copied {file_to_copy.path} " f"to {dest.path}", file=sys.stderr)
if file_name_placeholder == "job_executable":
os.chmod(dest.path, 0o777)


deliver_input_files(sys.argv[3], sys.argv[4], sys.argv[5])
Expand Down

0 comments on commit 783723b

Please sign in to comment.