Skip to content

Commit d68763a

Browse files
authored
Merge pull request #149 from kbase/dev-service
Remove scratch sharing and JAWS --quiet flag
2 parents 69a2a0b + 8ecdac4 commit d68763a

File tree

5 files changed

+4
-20
lines changed

5 files changed

+4
-20
lines changed

cdmtaskservice/app_state.py

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ async def build_app(
7474
nerscman = await NERSCManager.create(
7575
sfapi_client.get_client,
7676
Path(cfg.nersc_remote_code_dir) / VERSION,
77-
cfg.nersc_file_group,
7877
cfg.jaws_token,
7978
cfg.jaws_group,
8079
)

cdmtaskservice/config.py

-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class CDMTaskServiceConfig:
3232
as the remaining lines.
3333
sfapi_user: str - the user name of the user accociated with the credentials.
3434
nersc_remote_code_dir: str - the location at NERSC to upload remote code.
35-
nersc_file_group: str - the NERSC group with which downloaded files must be shared.
3635
jaws_token: str - the JAWS token used to run jobs.
3736
jaws_group: str - the JAWS group used to run jobs.
3837
s3_url: str - the URL of the S3 instance to use for data storage.
@@ -79,7 +78,6 @@ def __init__(self, config_file: BinaryIO):
7978
self.sfapi_cred_path = _get_string_required(config, _SEC_NERSC, "sfapi_cred_path")
8079
self.sfapi_user = _get_string_required(config, _SEC_NERSC, "sfapi_user")
8180
self.nersc_remote_code_dir = _get_string_required(config, _SEC_NERSC, "remote_code_dir")
82-
self.nersc_file_group = _get_string_required(config, _SEC_NERSC, "file_group")
8381
self.jaws_token = _get_string_required(config, _SEC_JAWS, "token")
8482
self.jaws_group = _get_string_required(config, _SEC_JAWS, "group")
8583
self.s3_url = _get_string_required(config, _SEC_S3, "url")
@@ -118,7 +116,6 @@ def print_config(self, output: TextIO):
118116
f"NERSC client credential path: {self.sfapi_cred_path}",
119117
f"NERSC client user: {self.sfapi_user}",
120118
f"NERSC remote code dir: {self.nersc_remote_code_dir}",
121-
f"NERSC file group: {self.nersc_file_group}",
122119
"JAWS token: REDACTED FOR THE NATIONAL SECURITY OF GONDWANALAND",
123120
f"JAWS group: {self.jaws_group}",
124121
f"S3 URL: {self.s3_url}",

cdmtaskservice/nersc/manager.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
module use /global/cfs/projectdirs/kbase/jaws/modulefiles
6363
module load jaws
6464
export JAWS_USER_CONFIG=~/{_JAWS_CONF_FILENAME}
65-
jaws submit --quiet --tag {{job_id}} {{wdlpath}} {{inputjsonpath}} {{site}}
65+
jaws submit --tag {{job_id}} {{wdlpath}} {{inputjsonpath}} {{site}}
6666
"""
6767
_JAWS_SITE_PERLMUTTER = "kbase" # add lawrencium later, maybe
6868
_JAWS_INPUT_WDL = "input.wdl"
@@ -127,7 +127,6 @@ async def create(
127127
cls,
128128
client_provider: Callable[[], AsyncClient],
129129
nersc_code_path: Path,
130-
file_group: str,
131130
jaws_token: str,
132131
jaws_group: str,
133132
) -> Self:
@@ -138,13 +137,11 @@ async def create(
138137
the user associated with the client does not change.
139138
nersc_code_path - the path in which to store remote code at NERSC. It is advised to
140139
include version information in the path to avoid code conflicts.
141-
file_group - the group with which to share downloaded files at NERSC.
142140
jaws_token - a token for the JGI JAWS system.
143141
jaws_group - the group to use for running JAWS jobs.
144142
"""
145143
nm = NERSCManager(client_provider, nersc_code_path)
146144
await nm._setup_remote_code(
147-
_require_string(file_group, "file_group"),
148145
_require_string(jaws_token, "jaws_token"),
149146
_require_string(jaws_group, "jaws_group"),
150147
)
@@ -165,7 +162,7 @@ def _check_path(self, path: Path, name: str):
165162
raise ValueError(f"{name} must be absolute to the NERSC root dir")
166163
return path
167164

168-
async def _setup_remote_code(self, file_group: str, jaws_token: str, jaws_group: str):
165+
async def _setup_remote_code(self, jaws_token: str, jaws_group: str):
169166
# TODO RELIABILITY atomically write files. For these small ones probably doesn't matter?
170167
cli = self._client_provider()
171168
perlmutter = await cli.compute(Machine.perlmutter)
@@ -195,7 +192,7 @@ async def _setup_remote_code(self, file_group: str, jaws_token: str, jaws_group:
195192
chmod = "600"
196193
))
197194
pm_scratch = tg.create_task(perlmutter.run("echo $SCRATCH"))
198-
dtn_scratch = tg.create_task(self._set_up_dtn_scratch(cli, file_group))
195+
dtn_scratch = tg.create_task(self._set_up_dtn_scratch(cli))
199196
if _PIP_DEPENDENCIES:
200197
deps = " ".join(
201198
# may need to do something else if module doesn't have __version__
@@ -215,16 +212,13 @@ async def _setup_remote_code(self, file_group: str, jaws_token: str, jaws_group:
215212
f"NERSC perlmutter scratch path: {self._perlmutter_scratch}"
216213
)
217214

218-
async def _set_up_dtn_scratch(self, client: AsyncClient, file_group: str) -> Path:
215+
async def _set_up_dtn_scratch(self, client: AsyncClient) -> Path:
219216
dt = await client.compute(_DT_TARGET)
220217
scratch = await dt.run(f"{_DT_WORKAROUND}; echo $SCRATCH")
221218
scratch = scratch.strip()
222219
if not scratch:
223220
raise ValueError("Unable to determine $SCRATCH variable for NERSC dtns")
224221
logging.getLogger(__name__).info(f"NERSC DTN scratch path: {scratch}")
225-
await dt.run(
226-
f"{_DT_WORKAROUND}; set -e; chgrp {file_group} {scratch}; chmod g+rsx {scratch}"
227-
)
228222
return Path(scratch)
229223

230224
async def _run_command(self, client: AsyncClient, machine: Machine, exe: str):

cdmtaskservice_config.toml.jinja

-5
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,13 @@ sfapi_cred_path = "{{ KBCTS_SFAPI_CRED_PATH or "" }}"
3030
# The user associated with the client credentials. The user's default shell must be bash.
3131
# If the client credentials are updated but the user doesn't match they will not be accepted.
3232
# It is advised to create a collaboration user for the service.
33-
# The user's scratch directory will be shared with the file_group below.
3433
# The jaws.conf file will be created in the user's home directory on service startup, overwriting
3534
# any extant file.
3635
sfapi_user = "{{ KBCTS_SFAPI_USER or "" }}"
3736

3837
# Where to store remote code at NERSC. This must be writeable by the service account.
3938
remote_code_dir = "{{ KBCTS_NERSC_REMOTE_CODE_DIR or "/global/cfs/cdirs/kbase/cdm_task_service" }}"
4039

41-
# The group with which to share downloaded data files. The JAWS user that will run jobs must
42-
# be in the same group so it can read the input files.
43-
file_group = "{{ KBCTS_NERSC_FILE_GROUP or "kbase" }}"
44-
4540
[JAWS]
4641

4742
# The JGI JAWS token to use to run jobs. This can be obtained from a JAWS representative.

docker-compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ services:
2727
- KBCTS_SFAPI_CRED_PATH=/creds/sfapi_creds
2828
- KBCTS_SFAPI_USER=cdm_ts
2929
- KBCTS_NERSC_REMOTE_CODE_DIR=/global/cfs/cdirs/kbase/cdm_task_service
30-
- KBCTS_NERSC_FILE_GROUP=kbase
3130
# Don't commit your token to github please
3231
- KBCTS_JAWS_TOKEN=tokengoeshere
3332
- KBCTS_JAWS_GROUP=kbase

0 commit comments

Comments
 (0)