Skip to content

Commit

Permalink
Support uninstalled commands
Browse files Browse the repository at this point in the history
  • Loading branch information
yizhengx committed Jun 19, 2024
1 parent 6affc37 commit 3966c50
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/serverless/ir_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ def prepare_scripts_for_serverless_exec(ir: IR, shell_vars: dict, args: argparse
mk_dirs = "mkdir -p "+config.PASH_TMP_PREFIX+" \n"
for dir in dir_set:
mk_dirs += "mkdir -p "+dir+" \n"
script = mk_dirs+to_shell(subgraph, args)
# rust_debug = "export RUST_BACKTRACE=full\n"
export_path = "export PATH=$PATH:runtime\n"
export_lib_path = "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:runtime/lib\n"
script = export_path+export_lib_path+mk_dirs+to_shell(subgraph, args)
# generate scripts
script_name = os.path.join(config.PASH_TMP_PREFIX, str(id_))
script_id_to_script[str(id_)] = script
Expand Down
33 changes: 33 additions & 0 deletions runtime/serverless/runtime/auto-split.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

cd "$(dirname $0)"

input="$1"
shift
outputs=("$@")
n_outputs="$#"

# generate a temp file
temp="$(mktemp -u /tmp/pash_XXXXXXXXXX)"

cat "$input" > "$temp"
total_lines=$(wc -l "$temp" | cut -f 1 -d ' ')
batch_size=$((total_lines / n_outputs))
# echo "Input: $input"
# echo "Ouputs: $outputs"
# echo "Number of outputs: $n_outputs"
# echo "Total Lines: $total_lines"
# echo "Batch Size: $batch_size"

cleanup()
{
kill -SIGPIPE "$split_pid" > /dev/null 2>&1
}
trap cleanup EXIT


# echo "$PASH_TOP/evaluation/tools/split $input $batch_size $outputs"
./split "$temp" "$batch_size" "${outputs[@]}" &
split_pid=$!
wait "$split_pid"
rm -f "$temp"
Binary file added runtime/serverless/runtime/col
Binary file not shown.
Binary file added runtime/serverless/runtime/file
Binary file not shown.
Binary file added runtime/serverless/runtime/lib/libbsd.so.0
Binary file not shown.
Binary file added runtime/serverless/runtime/lib/libbz2.so.1.0
Binary file not shown.
Binary file added runtime/serverless/runtime/lib/libmagic.so.1
Binary file not shown.
Binary file added runtime/serverless/runtime/lib/magic.mgc
Binary file not shown.
Binary file added runtime/serverless/runtime/xargs
Binary file not shown.

0 comments on commit 3966c50

Please sign in to comment.