-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consolidate scripts in worflow dir (#144)
* consolidate scripts in worflow dir * move ci/cd to workflow/pipeline dir * pass everything useing CLI arguments, intstead of env. vars * simplify directory structure of workflow * use new pipeline config entry point in the ci.yml script * extended README
- Loading branch information
Showing
17 changed files
with
171 additions
and
88 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/usr/bin/env bash | ||
|
||
datetime () { date +"%Y-%m-%d %H:%M:%S"; } | ||
|
||
usage () { | ||
echo "usage: configure -r recipe-path -c config-path" | ||
echo "" | ||
echo "where:" | ||
echo " recipe-path: the location of the recipes" | ||
echo ' config-path: the location of the config.yaml file' | ||
echo "" | ||
[[ "" == "$1" ]] && exit 0 | ||
err "$1" | ||
} | ||
|
||
[[ -t 1 ]] && interm=yes | ||
|
||
red () { echo "\e[1;31m$1\e[m"; } | ||
yellow () { echo "\e[1;33m$1\e[m"; } | ||
log () { printf "$(yellow "[log $(datetime)]") $1\n"; } | ||
err () { printf "$(red "[error $(datetime)]") $1\n"; exit 1; } | ||
|
||
config_path="-" | ||
recipe_path="-" | ||
output_path="-" | ||
uarch="-" | ||
system="-" | ||
uenv="-" | ||
|
||
while getopts c:r:o:s:u:a: flag | ||
do | ||
case "${flag}" in | ||
c) config_path=${OPTARG};; | ||
r) recipe_path=$(realpath "${OPTARG}");; | ||
o) output_path=$(realpath "${OPTARG}");; | ||
a) uarch=${OPTARG};; | ||
s) system=${OPTARG};; | ||
u) uenv=${OPTARG};; | ||
esac | ||
done | ||
|
||
[[ "-" == "${config_path}" ]] && usage "missing -c argument for config.yaml file" | ||
[[ "-" == "${recipe_path}" ]] && usage "missing -r argument for the recipes path" | ||
[[ "-" == "${output_path}" ]] && usage "missing -o argument for the output path" | ||
[[ "-" == "${system}" ]] && usage "missing -s argument for system" | ||
[[ "-" == "${uarch}" ]] && usage "missing -a argument for uarch" | ||
[[ "-" == "${uenv}" ]] && usage "missing -u argument for uenv" | ||
|
||
script_path=$(dirname $(realpath $0)) | ||
pipeline_path=${script_path}/pipeline | ||
|
||
# | ||
# print status | ||
# | ||
|
||
log "configuring cicd pipeline for alps uenv" | ||
log " system = $system" | ||
log " uarch = $uarch" | ||
log " uenv = $uenv" | ||
log "script_path = $script_path" | ||
log "config_path = $config_path" | ||
log "pipeline_path= $pipeline_path" | ||
log "recipe_path = $recipe_path" | ||
log "output_path = $output_path" | ||
|
||
# | ||
# create temporary working path for python | ||
# | ||
#TODO: check if CI_JOB_ID exists otherwise create random | ||
#CI_JOB_ID=squigglydot | ||
tmp_path=/tmp/uenv$CI_JOB_ID | ||
rm -rf $tmp_path | ||
mkdir -p $tmp_path | ||
|
||
log "temporary path $tmp_path" | ||
|
||
# | ||
# set up python environment | ||
# | ||
pyenv_path=$tmp_path/.pyenv | ||
|
||
python3 -m venv $pyenv_path | ||
source $pyenv_path/bin/activate | ||
log "created and loaded python venv in $pyenv_path" | ||
log "$(python --version)" | ||
|
||
pip install --upgrade --quiet pip | ||
pip install --quiet -r $pipeline_path/requirements.txt | ||
log "installed python dependencies" | ||
|
||
${pipeline_path}/ci.py --recipes="$recipe_path" --config="$config_path" --uarch="$uarch" --uenv="$uenv" --system="$system" --output="$output_path" | ||
[[ $? -eq 0 ]] || err "unable to configure" | ||
|
||
log "configuration complete" | ||
log "the generated configuration ${output_path} is:\n\n$(cat $output_path)" |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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 @@ | ||
# to be sourced from stack-build | ||
# to be sourced from stage-build | ||
|
||
log "build cache: generating configuration" | ||
|
||
|
File renamed without changes.
Oops, something went wrong.