Skip to content
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
19 changes: 13 additions & 6 deletions projects/online/online/subprocesses/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@

logger = logging.getLogger("authenticate-subprocess")

AFRAME_KEYTAB = os.getenv(
"AFRAME_KEYTAB",
"/home/aframe.online/robot/aframe-online_robot_aframe.ldas.cit.keytab",
)

AFRAME_CREDKEY = os.getenv(
"AFRAME_CREDKEY", "aframe-online/robot/aframe.ldas.cit"
)


def authenticate(minsecs: float = 1000, debug: bool = False):
args = [
"kinit",
"aframe-1-scitoken/robot/ldas-pcdev12.ligo.caltech.edu@LIGO.ORG",
AFRAME_CREDKEY + "@LIGO.ORG",
"-k",
"-t",
os.path.expanduser(
"~/robot/aframe-1-scitoken_robot_ldas-pcdev12.ligo.caltech.edu.keytab" # noqa
),
AFRAME_KEYTAB,
]
run_subprocess_with_logging(
args, logger=logger, log_stderr_on_success=False
Expand All @@ -28,9 +35,9 @@ def authenticate(minsecs: float = 1000, debug: bool = False):
"-i",
"igwn",
"-r",
"aframe-1-scitoken",
AFRAME_CREDKEY.split("/")[0],
"--scopes=gracedb.read",
"--credkey=aframe-1-scitoken/robot/ldas-pcdev12.ligo.caltech.edu",
f"--credkey={AFRAME_CREDKEY}",
f"--minsecs={minsecs}",
"--nooidc",
]
Expand Down
5 changes: 4 additions & 1 deletion scripts/aframe_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ def create_online_runfile(path: Path):
export BEARER_TOKEN_FILE=
export SCITOKEN_FILE=

export AFRAME_KEYTAB=/home/aframe.online/robot/aframe-online_robot_aframe.ldas.cit.keytab
export AFRAME_CREDKEY=aframe-online/robot/aframe.ldas.cit

# trained model weights
export AMPLFI_HL_WEIGHTS=
export AMPLFI_HLV_WEIGHTS=
Expand Down Expand Up @@ -184,7 +187,7 @@ def create_online_runfile(path: Path):
crash count = $crash_count" >> monitoring.log
sleep 1
done
"""
""" # noqa E501
runfile = path / "run.sh"
write_content(content, runfile)

Expand Down