Commit c43247ec authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Define the default values for the input, tmp and output directories. Define the memory size.

parent cb9400e0
#!/bin/bash
# variables to bet set by the user
input_dir=""
tmp_dir=""
output_dir=""
input_dir="../demo/Data"
tmp_dir="../demo/Data"
output_dir="../demo/Data"
jupyter_notebook="TrUE"
......@@ -11,23 +11,6 @@ jupyter_notebook="TrUE"
# DO NOT CHANGE ANYTHING FROM HERE ON!!! #
##########################################
# HaSa configuration
demo_dir="$(realpath ../demo/)"
# Docker container related
container_name="hasa"
runner_os="ubuntu"
runner_iname="hasa_runner"
runner_version="latest"
runner_tag="${runner_os}_${runner_iname}:${runner_version}"
out_data_folder="/home/hasa/output"
in_data_folder="/home/hasa/input"
tmp_data_folder="/home/hasa/tmp"
demo_data_folder="/home/hasa/demo"
demo_data_foler="$(realpath ../demo/)"
jupyter_lab_port=8888
docker_jupyterlab_port=8888
if [ "$input_dir" == "" ]
then
echo "Please define the input_dir"
......@@ -46,6 +29,27 @@ then
exit
fi
input_dir_=MY_PATH=$(readlink -f $input_dir)
output_dir_=MY_PATH=$(readlink -f $output_dir)
tmp_dir_=MY_PATH=$(readlink -f $tmp_dir)
# HaSa configuration
demo_dir="$(realpath ../demo/)"
# Docker container related
container_name="hasa"
runner_os="ubuntu"
runner_iname="hasa_runner"
runner_version="latest"
runner_tag="${runner_os}_${runner_iname}:${runner_version}"
out_data_folder="/home/hasa/output"
in_data_folder="/home/hasa/input"
tmp_data_folder="/home/hasa/tmp"
demo_data_folder="/home/hasa/demo"
demo_data_foler="$(realpath ../demo/)"
jupyter_lab_port=8888
docker_jupyterlab_port=8888
sudo docker rm -f ${container_name}
......@@ -53,6 +57,7 @@ echo "Starting HaSa container, please add the input files to ${input_dir} and re
if [ "${jupyter_notebook,,}" = "true" ]
then
sudo docker run -it --name ${container_name} \
--memory="20g" --memory-swap="20g" --memory-swappiness=0 \
-p $jupyter_lab_port:$docker_jupyterlab_port \
-v ${input_dir}:${in_data_folder} \
-v ${tmp_dir}:${tmp_data_folder} \
......@@ -61,6 +66,7 @@ then
bash -i -c "cd /home/hasa; jupyter-lab --ip 0.0.0.0 --no-browser --allow-root demo/"
else
sudo docker run -it --name ${container_name} -u 1000:1000 \
--memory="20g" --memory-swap="20g" --memory-swappiness=0 \
-v ${input_dir}:${in_data_folder} \
-v ${tmp_dir}:${tmp_data_folder} \
-v ${output_dir}:${out_data_folder} \
......
Markdown is supported
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