forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·24 lines (18 loc) · 784 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
set -e
if [ -z "$1" ]; then (echo "syntax: run.sh [workflow.py]"; exit -1); fi
command -v python3 >/dev/null 2>&1 || (echo "missing python3"; exit -1)
command -v pip >/dev/null 2>&1 || (echo "missing python3-pip"; exit -1)
command -v pipenv >/dev/null 2>&1 || (echo "missing pipenv"; exit -1)
DIR="$(dirname "$0")"
echo "Installing dependencies in $DIR ..."
export PIPENV_PIPFILE="$DIR/Pipfile"
python3 -m pipenv install
if [[ ! "$1" == *benchmark* ]]; then (echo "Running "$1" ${@:2} ..."; ); fi
python3 -m pipenv run python "$1" ${@:2}