Commit 8918c293 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Merge branch 'newfeature/SOMA-3993_GenerateTagAutomaticDirs' into 'master'

[SOMA-3993] Adicionando validação para criação dos diretórios de runtime do sgad.

See merge request !39
Showing with 77 additions and 5 deletions
+77 -5
......@@ -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:
......
#!/bin/sh
timestamp=$(date +%Y%m%d%H%M%S)
logsdir="logs"
[ ! -e $logsdir ] && echo "mkdir $logsdir" && mkdir $logsdir
logfile="logs/sgad_${timestamp}.log"
confgfile=${1}
if [ -z ${confgfile} ]; then
echo "Using default file configuration" > ${logfile};
confgfile=sgad.cfg
configfile=${1}
if [ -z ${configfile} ]; then
echo "Using default file configuration" > ${logfile};
configfile=sgad.cfg
fi
hostruntimedir="/tmp/chuva"
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 ${confgfile} 2>&1 | tee -a "${logfile}"
sgad ${configfile} 2>&1 | tee -a "${logfile}"
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