-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from D-Sai-Venkatesh/generate-pipeline
Updated generate (simple pipeline) pipeline
- Loading branch information
Showing
6 changed files
with
302 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Steps to generate a new pipeline | ||
- create a `pipeline_definitions.yaml` file for the required task (similar to the example [pipeline_definitions.yaml for the noop task](./example/pipeline_definitions.yaml). | ||
- execute `./run.sh <pipeline_definitions_file_path> <destination directory>`. When `pipeline_definitions_file_path` is the path of the `pipeline_definitions.yaml` file that defines the pipeline and `destination directory` is a directory where new pipeline file | ||
- execute `./run.sh --config_file <pipeline_definitions_file_path> --output_dir_file <destination directory>`. When `pipeline_definitions_file_path` is the path of the `pipeline_definitions.yaml` file that defines the pipeline and `destination directory` is a directory where new pipeline file | ||
will be generated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,64 @@ | ||
#!/bin/bash | ||
|
||
DEF_FILE=$1 | ||
DIST_DIR=$2 | ||
POSITIONAL_ARGS=() | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
-c|--config_file) | ||
DEF_FILE="$2" | ||
if [[ "$2" = -* ]] | ||
then | ||
echo "ERROR: config_file value not provided." | ||
exit 1 | ||
fi | ||
shift # past argument | ||
shift # past value | ||
;; | ||
-od|--output_dir_file) | ||
DIST_DIR="$2" | ||
if [[ "$2" = -* ]] | ||
then | ||
echo "ERROR: output_dir_file value not provided." | ||
exit 1 | ||
fi | ||
shift # past argument | ||
shift # past value | ||
;; | ||
-h|--help) | ||
echo "-c/--config_file(required): file path to config_file(pipeline_definition.yaml)." | ||
echo "-od/--output_dir_file(required): output folder path to store generated pipeline." | ||
exit 1 | ||
;; | ||
-*|--*) | ||
echo "Unknown option $1" | ||
exit 1 | ||
;; | ||
*) | ||
POSITIONAL_ARGS+=("$1") # save positional arg | ||
shift # past argument | ||
;; | ||
esac | ||
done | ||
|
||
|
||
if [ -z ${DEF_FILE+x} ] | ||
then | ||
echo "ERROR: config_file is not defined." | ||
exit 1 | ||
fi | ||
|
||
if [ -z ${DIST_DIR+x} ] | ||
then | ||
echo "ERROR: output_dir_file is not defined." | ||
exit 1 | ||
fi | ||
|
||
|
||
ROOT_DIR=${PWD} | ||
|
||
mkdir -p ${ROOT_DIR}/${DIST_DIR}/ | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip install pre-commit | ||
python3 pipeline_generator.py -c ${DEF_FILE} -od ${ROOT_DIR}/${DIST_DIR}/ | ||
pip install jinja2 | ||
python3 pipeline_generator.py -c ${DEF_FILE} -od ${ROOT_DIR}/${DIST_DIR}/ |
Oops, something went wrong.