Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
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
12 changes: 6 additions & 6 deletions app/config/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ const services = {
bookkeeping: {
url: {
rct: 'http://rct-bookkeeping.cern.ch:4000/api/runs',
ali: ResProvider.endpointFor('BK_RUNS'),
ali: ResProvider.getServiceEndpoint('BK_RUNS'),
},
},
monalisa: {
url: {
dataPassesRaw: ResProvider.endpointFor('ML_DP_RAW'),
dataPassesDetailed: ResProvider.endpointFor('ML_DP_DET'),
dataPassesRaw: ResProvider.getServiceEndpoint('ML_DP_RAW'),
dataPassesDetailed: ResProvider.getServiceEndpoint('ML_DP_DET'),

mcRaw: ResProvider.endpointFor('ML_MC_RAW'),
mcDetailed: ResProvider.endpointFor('ML_MC_DET'),
mcDetTag: ResProvider.endpointFor('ML_MC_TAG'),
mcRaw: ResProvider.getServiceEndpoint('ML_MC_RAW'),
mcDetailed: ResProvider.getServiceEndpoint('ML_MC_DET'),
mcDetTag: ResProvider.getServiceEndpoint('ML_MC_TAG'),
},
},
};
Expand Down
21 changes: 19 additions & 2 deletions app/lib/ResProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,30 @@ class ResProvider {
varsDef[`RCT_EP_${serviceAbbr}_PORT`] = 'port';
varsDef[`RCT_EP_${serviceAbbr}_PATH`] = 'path';
const p = ResProvider.viaEnvVars(varsDef, null, 'warn');
const { host } = p;
let { host } = p;
let { path } = p;
// eslint-disable-next-line prefer-destructuring
let prot = p['prot'];
prot = prot ? prot : 'https';
prot = prot ? prot.trim().replace('://', '') : 'https';
// eslint-disable-next-line prefer-destructuring
let port = p['port'];
const hs = host.split(':');
if (hs.length === 2) {
// eslint-disable-next-line prefer-destructuring
port = hs[1];
// eslint-disable-next-line prefer-destructuring
host = hs[0];
} else if (hs.length != 1) {
const mess = `incorrect format of hostname: ${host}`;
logger.error(mess);
throw mess;
}

if (port && isNaN(port)) {
const mess = `incorrect port <${port}> for hostname: ${host}`;
logger.error(mess);
throw mess;
}
port = port ? `:${port}` : '';
path = path ? path.trim().replace(/^\/*/, '') : '';
return `${prot}://${host}${port}/${path}`;
Expand Down
7 changes: 0 additions & 7 deletions docker/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,36 @@ CERN_SOCKS=${CERN_SOCKS:-true}
### endpoints
_DEF_BK_HOST=ali-bookkeeping.cern.ch
_DEF_ML_HOST=alimonitor.cern.ch
_DEF_PORT=443
_DEF_ML_PROT=https

### bkp
RCT_EP_BK_RUNS_PROT=https
RCT_EP_BK_RUNS_HOST=${RCT_EP_BK_RUNS_HOST:-$_DEF_BK_HOST}
RCT_EP_BK_RUNS_PORT=${RCT_EP_BK_RUNS_PORT:-$_DEF_PORT}
RCT_EP_BK_RUNS_PATH=${RCT_EP_BK_RUNS_PATH:-/api/runs?filter[definitions]=PHYSICS}


### data passes
RCT_EP_ML_DP_RAW_PROT=$_DEF_ML_PROT
RCT_EP_ML_DP_RAW_HOST=${RCT_EP_ML_DP_RAW_HOST:-$_DEF_ML_HOST}
RCT_EP_ML_DP_RAW_PORT=${RCT_EP_ML_DP_RAW_PORT:-$_DEF_PORT}
RCT_EP_ML_DP_RAW_PATH=${RCT_EP_ML_DP_RAW_PATH:-/production/raw.jsp?res_path=json}


RCT_EP_ML_DP_DET_PROT=$_DEF_ML_PROT
RCT_EP_ML_DP_DET_HOST=${RCT_EP_ML_DP_DET_HOST:-$_DEF_ML_HOST}
RCT_EP_ML_DP_DET_PORT=${RCT_EP_ML_DP_DET_PORT:-$_DEF_PORT}
RCT_EP_ML_DP_DET_PATH=${RCT_EP_ML_DP_DET_PATH:-/raw/raw_details.jsp?timesel=0&res_path=json}


### simulation passes
RCT_EP_ML_MC_RAW_PROT=$_DEF_ML_PROT
RCT_EP_ML_MC_RAW_HOST=${RCT_EP_ML_MC_RAW_HOST:-$_DEF_ML_HOST}
RCT_EP_ML_MC_RAW_PORT=${RCT_EP_ML_MC_RAW_PORT:-$_DEF_PORT}
RCT_EP_ML_MC_RAW_PATH=${RCT_EP_ML_MC_RAW_PATH:-/MC/?res_path=json}

RCT_EP_ML_MC_DET_PROT=$_DEF_ML_PROT
RCT_EP_ML_MC_DET_HOST=${RCT_EP_ML_MC_DET_HOST:-$_DEF_ML_HOST}
RCT_EP_ML_MC_DET_PORT=${RCT_EP_ML_MC_DET_PORT:-$_DEF_PORT}
RCT_EP_ML_MC_DET_PATH=${RCT_EP_ML_MC_DET_PATH:-/job_events.jsp?timesel=0&res_path=json}

RCT_EP_ML_MC_TAG_PROT=$_DEF_ML_PROT
RCT_EP_ML_MC_TAG_HOST=${RCT_EP_ML_MC_TAG_HOST:-$_DEF_ML_HOST}
RCT_EP_ML_MC_TAG_PORT=${RCT_EP_ML_MC_TAG_PORT:-$_DEF_PORT}
RCT_EP_ML_MC_TAG_PATH=${RCT_EP_ML_MC_TAG_PATH:-/MC/prodDetails.jsp?res_path=json}


Expand Down