diff --git a/cassandra4slurm/scripts/initialize_hecuba.sh b/cassandra4slurm/scripts/initialize_hecuba.sh index 181f3e33..e946b367 100755 --- a/cassandra4slurm/scripts/initialize_hecuba.sh +++ b/cassandra4slurm/scripts/initialize_hecuba.sh @@ -7,10 +7,10 @@ echo " CQLSH at ${1}" #if [ "x$CQLSH_HOST" == "x" ] ; then # export CQLSH_HOST=localhost #fi - +CQLSH_CMD=${2} #second parameter cqlsh location. To support execution with singularity (currently only supported for pycompss applications launched by enqueue_compss) commands="CREATE KEYSPACE IF NOT EXISTS hecuba_locks WITH replication= {'class': 'SimpleStrategy', 'replication_factor': 1}; CREATE TABLE IF NOT EXISTS hecuba_locks.table_lock (table_name text, PRIMARY KEY (table_name)); TRUNCATE table hecuba_locks.table_lock;" -echo $commands | $CASS_HOME/bin/cqlsh ${1} || { echo "EXECUTING CQLSH [$commands] FAILED!!!" && exit; } +echo $commands | ${CQLSH_CMD} ${1} || { echo "[ERROR]: Executing CQLSH [$commands] FAILED!!!" && exit; } echo " Keyspace hecuba_locks created" echo " Table table_lock created" @@ -19,7 +19,7 @@ echo " Table table_lock created" commands="CREATE KEYSPACE IF NOT EXISTS hecuba WITH replication= {'class': 'SimpleStrategy', 'replication_factor': 1}; CREATE TYPE IF NOT EXISTS hecuba.q_meta( mem_filter text, from_point frozen>, to_point frozen>, precision float); CREATE TYPE IF NOT EXISTS hecuba.np_meta (flags int, elem_size int, partition_type tinyint, dims list, strides list, typekind text, byteorder text); CREATE TABLE IF NOT EXISTS hecuba.istorage (storage_id uuid, class_name text,name text, istorage_props map, tokens list>>, indexed_on list, qbeast_random text, qbeast_meta frozen, numpy_meta frozen, saved_numpy_meta frozen, block_id int, base_numpy uuid, view_serialization blob, primary_keys list>>, columns list>>, PRIMARY KEY(storage_id));" -echo $commands | $CASS_HOME/bin/cqlsh ${1} || { echo "EXECUTING CQLSH [$commands] FAILED!!!" && exit; } +echo $commands | ${CQLSH_CMD} ${1} || { echo "EXECUTING CQLSH [$commands] FAILED!!!" && exit; } echo " Keyspace hecuba created" echo " Table istorage created" @@ -36,14 +36,14 @@ commands="CREATE KEYSPACE IF NOT EXISTS ${EXECUTION_NAME} WITH replication= {'c fi -echo $commands | $CASS_HOME/bin/cqlsh ${1} || { echo "EXECUTING CQLSH [$commands] FAILED!!!" && exit; } +echo $commands | ${CQLSH_CMD} ${1} || { echo "EXECUTING CQLSH [$commands] FAILED!!!" && exit; } echo " Keyspace ${EXECUTION_NAME} created" [ "0${HECUBA_SN_SINGLE_TABLE}" == "0" ] && HECUBA_SN_SINGLE_TABLE="true" if [[ ${HECUBA_SN_SINGLE_TABLE} != "no" && ${HECUBA_SN_SINGLE_TABLE} != "false" ]]; then commands="CREATE TABLE IF NOT EXISTS ${EXECUTION_NAME}.hecuba_storagenumpy (storage_id uuid, cluster_id int, block_id int, payload blob, PRIMARY KEY ((storage_id, cluster_id), block_id));" - echo $commands | $CASS_HOME/bin/cqlsh ${1} || { echo "EXECUTING CQLSH [$commands] FAILED!!!" && exit; } + echo $commands | ${CQLSH_CMD} ${1} || { echo "EXECUTING CQLSH [$commands] FAILED!!!" && exit; } echo " Table hecuba_storagenumpy created" fi diff --git a/cassandra4slurm/scripts/job.sh b/cassandra4slurm/scripts/job.sh index 28da19e4..1cc80f3c 100755 --- a/cassandra4slurm/scripts/job.sh +++ b/cassandra4slurm/scripts/job.sh @@ -327,7 +327,7 @@ echo $CNAMES | tr , '\n' > $PYCOMPSS_STORAGE # Set list of nodes (with interface check_cassandra_is_available $firstnode -source $MODULE_PATH/initialize_hecuba.sh $firstnode +source $MODULE_PATH/initialize_hecuba.sh $firstnode ${CASS_HOME}/bin/cqlsh if [ "0$SCHEMA" != "0" ]; then echo "Connecting to $firstnode for tables creation. Schema $SCHEMA." @@ -389,7 +389,7 @@ then # Looping over the assigned hosts until the snapshots are confirmed DBG " Launching snapshot tasks on nodes $CASSANDRA_NODELIST" - source $MODULE_PATH/snapshot.sh $SNAP_NAME $ROOT_PATH $CLUSTER $UNIQ_ID + source $MODULE_PATH/snapshot.sh $SNAP_NAME $ROOT_PATH $CLUSTER $UNIQ_ID ${CASSHOME}/bin/nodetool SNAP_CONT=0 while [ "$SNAP_CONT" != "$N_NODES" ]