Commit c254675e authored by Carlos Juliano Viana's avatar Carlos Juliano Viana
Browse files

Adicionando seção com explicação para executar mútiplos SGAs a partir

de um mesmo diretório de instalação, compartilhando mesmos arquivos
sgad.sh e sgad.cfg.
 -  Proposta da solução apresentada para o grupo do BRSiOP.

[SOMA-4102]
[SOMA-2554]
parent 1fbc1d10
......@@ -66,6 +66,66 @@ host sandbox. The SSH data transfer configuration can be enable with posix drive
Add **csgrid_id_rsa** private key in /home/csgrid/.ssh CSGrid server directory and fill **csgrid_id_rsa.pub**
file content in SGA csgrid home directory _.ssh/authorized_keys_ file.
## Multiple SGAs with same instalation directory
Multiple SGAs can be run from the same installation directory. In this case, we
have a installation directory shared among all SGA machines via NFS.
All SGAs machines share the same script sgad.sh and configuration file sgad.cfg.
To run multiple SGAs in this environment, the following changes can be done:
sgad.sh
```bash
#!/bin/bash
export CSBASE_SERVER="http://localhost:40409"
export SGAD_HOST=$HOSTNAME
export SGAD_PORT=40100
export SGAD_NAME=$HOSTNAME
export SGAD_PLATFORM="Linux44_64"
export SERVER_DATA_DIR="/mnt/csgrid_data"
timestamp=$(date +%Y%m%d%H%M%S)
logsdir="logs"
[[ ! -e $logsdir ]] && echo "mkdir $logsdir" && mkdir $logsdir
logfile="logs/${HOSTNAME}_sgad_${timestamp}.log"
configfile=${1}
if [ -z ${configfile} ]; then
echo "Using default file configuration" > ${logfile};
configfile=sgad.cfg
fi
hostruntimedir="/tmp/${SGAD_NAME}"
sgadruntimedir="${hostruntimedir}/sgad"
runtimesandboxdir="${sgadruntimedir}/sandbox"
[[ ! -e $hostruntimedir ]] && echo "mkdir $hostruntimedir..." && mkdir $hostruntimedir
[[ ! -e $sgadruntimedir ]] && echo "mkdir $sgadruntimedir..." && mkdir $sgadruntimedir
[[ ! -e $runtimesandboxdir ]] && echo "mkdir $runtimesandboxdir..." && mkdir $runtimesandboxdir
eval $(luarocks path --bin)
sgad ${configfile} 2>&1 | tee -a "${logfile}"
```
sgad.cfg
```lua
csbase_server = os.getenv("CSBASE_SERVER")
platform = os.getenv("SGAD_PLATFORM") or "Linux44_64"
sgad_host = os.getenv("SGAD_HOST")
sgad_port = tonumber(os.getenv("SGAD_PORT"))
sga_name = os.getenv("SGAD_NAME")
status_interval_s = 10
exec_polling_interval_s = 5
register_retry_s = 3
project_root_dir = os.getenv("SERVER_DATA_DIR") .. "/projects"
algorithm_root_dir = os.getenv("SERVER_DATA_DIR") .. "/algorithms"
runtime_data_dir = "/tmp/" .. os.getenv("SGAD_NAME") .. "/sgad"
sandbox_root_dir = "/tmp/" .. os.getenv("SGAD_NAME") .. "/sgad/sandbox"
driver = "sga.driver.posix"
resources = {
"docker"
}
```
## Install
Requirements:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment