From b5320e43afeb543f68482d88129afc1be20c4f26 Mon Sep 17 00:00:00 2001 From: Oksana Shadura Date: Thu, 15 Dec 2022 19:33:34 +0100 Subject: [PATCH] Try to make work BEARER token @ condor workers --- coffea_casa/coffea_casa.py | 4 +++- docker/Dockerfile.cc-analysis-ubuntu | 4 ++-- docker/prepare-env/prepare-env-cc-analysis.sh | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/coffea_casa/coffea_casa.py b/coffea_casa/coffea_casa.py index 776cb894..89b685b6 100644 --- a/coffea_casa/coffea_casa.py +++ b/coffea_casa/coffea_casa.py @@ -14,7 +14,9 @@ #DEFAULT_NANNY_PORT = 8001 # Security settings for Dask scheduler +# REMOVE ME (backward compatibity for now) SECRETS_DIR = Path("/etc/cmsaf-secrets") +SECRETS_DIR_CHOWN = Path("/etc/cmsaf-secrets-chown") # CEPH (Skyhook) CEPH_DIR = Path("/opt/ceph") CEPH_CONF = CEPH_DIR / "ceph.conf" @@ -25,7 +27,7 @@ # XCache # REMOVE ME (backward compatibity for now) XCACHE_FILE = SECRETS_DIR / "xcache_token" -XCACHE_SCITOKEN_FILE = SECRETS_DIR / "access_token" +XCACHE_SCITOKEN_FILE = SECRETS_DIR_CHOWN / "access_token" # pip PIP_REQUIREMENTS = HOME_DIR / "requirements.txt" # conda, with yml/yaml both supported diff --git a/docker/Dockerfile.cc-analysis-ubuntu b/docker/Dockerfile.cc-analysis-ubuntu index 490aadeb..ae6c4d74 100644 --- a/docker/Dockerfile.cc-analysis-ubuntu +++ b/docker/Dockerfile.cc-analysis-ubuntu @@ -9,10 +9,10 @@ ARG NB_GID="11265" ARG CERT_DIR="/etc/cmsaf-secrets" # Hack for GH Actions ARG GITHUB_ACTIONS="false" -ARG BEARER_TOKEN_FILE=$CERT_DIR"/xcache_token" +ARG BEARER_TOKEN_FILE # Configure environment -ENV CERT_DIR=$CERT_DIR +ENV CERT_DIR $CERT_DIR ENV BEARER_TOKEN_FILE $BEARER_TOKEN_FILE ENV CONDA_DIR /opt/conda ENV SHELL /bin/bash diff --git a/docker/prepare-env/prepare-env-cc-analysis.sh b/docker/prepare-env/prepare-env-cc-analysis.sh index 447392d2..eb674977 100644 --- a/docker/prepare-env/prepare-env-cc-analysis.sh +++ b/docker/prepare-env/prepare-env-cc-analysis.sh @@ -67,10 +67,7 @@ if [[ ! -v COFFEA_CASA_SIDECAR ]]; then mkdir -p /home/$NB_USER/.condor/tokens.d/ && cp $_CONDOR_JOB_IWD/condor_token /home/$NB_USER/.condor/tokens.d/condor_token fi - # REMOVE ME AFTER TEST: - # Bearer token (overwrite value preconfigured for k8s) if [[ -f "$_CONDOR_JOB_IWD/access_token" ]]; then - chmod 600 $_CONDOR_JOB_IWD/access_token export BEARER_TOKEN_FILE="$_CONDOR_JOB_IWD/access_token" fi