File size: 1,091 Bytes
dd4da36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash

set -e
trap cleanup_on_error ERR SIGINT SIGTERM

cleanup_on_error() {
  echo "Error: $0:$LINENO: command \`$BASH_COMMAND\` failed with exit code $?"
  exit 1
}

while [[ $# -gt 0 ]]; do
  key="$1"
  case $key in
  --config)
    CONFIG_FILE="$2"
    shift
    shift
    ;;
  --input_base_uri)
    INPUT_BASE_URI="$2"
    shift
    shift
    ;;
  --output_dir)
    OUTPUT_DIR="$2"
    shift
    shift
    ;;
  --similarity)
    SIMILARITY="$2"
    shift
    shift
    ;;
  --listings)
    LISTINGS="$2"
    shift
    shift
    ;;
  --max_docs)
    MAX_DOCS="$2"
    shift
    shift
    ;;
  *)
    echo "Invalid option: -$OPTARG" >&2
    ;;
  esac
done

# make environment variables available to downstream scripts
set -a
# shellcheck source=configs/base.conf
. "$CONFIG_FILE"
set +a

# run pipeline
apptainer run --memory 480g "${DOCKER_REPO}" \
  python3 src/run_lsh.py \
  --listings "${LISTINGS}" \
  --input_base_uri "${INPUT_BASE_URI}" \
  --output_dir "${OUTPUT_DIR}" \
  --similarity "${SIMILARITY}" \
  --num_perm "${MINHASH_NUM_PERMUTATIONS}" \
  --max_docs ${MAX_DOCS}