Skip to content

Commit

Permalink
update: remove checks the same way
Browse files Browse the repository at this point in the history
  • Loading branch information
saisona committed Jun 14, 2022
1 parent b2d59a1 commit dd0ab76
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
7 changes: 2 additions & 5 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: 'ga-model-deployment'
description: 'Launch Metaflow model deployment worflow & Launch Loki tests'
inputs:
skipDeployment:
description: 'Skips metaflow ArgoWorkflow for model deployment and API registration'
lokiSkip:
description: 'Skips Loki ArgoWorkflow.'
required: true
default: "0"
modelInstanceId:
description: 'generated modelInstanceId given by previous registerModel in bookish-happiness'
required: false
workflowTemplateName:
description: 'Name of the Argo Workflow template to run'
required: false
Expand Down
25 changes: 16 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,32 @@ URI_MODEL_INSTANCE_ID="s3://loki-artefacts/metaflow/modelInstanceIds/$WORKFLOW_M
URI_THREAD_TS="s3://loki-artefacts/metaflow/modelInstanceIds/$WORKFLOW_MODEL_DEPLOY_ID/threadTS"
echo "[$(date +"%m/%d/%y %T")] Downloading ModelInstance id from $URI"
aws s3 cp $URI_MODEL_INSTANCE_ID ./modelInstanceId
if [[ $? == 1 ]]
then
echo "[$(date +"%m/%d/%y %T")] An error occured while fetching $URI_MODEL_INSTANCE_ID"
exit 1
fi
aws s3 cp $URI_THREAD_TS ./threadTS
if [[ $? == 1 ]]
then
echo "[$(date +"%m/%d/%y %T")] An error occured while fetching $URI_THREAD_TS"
exit 1
fi
MODEL_INSTANCE_ID=$(cat modelInstanceId)
THREAD_TS=$(cat threadTS)
echo "[$(date +"%m/%d/%y %T")] modelInstanceId is $MODEL_INSTANCE_ID and threadTS is $THREAD_TS"
echo "::endgroup::"

## Launches loki tests
echo "::group::Loki non-regression tests"
if [[ $INPUT_LOKISKIP == 1 ]]
then
echo "[$(date +"%m/%d/%y %T")] Loki has been skipped. Model deployment finished with success"
exit 0
fi

WORFLOW_TEMPLATE_NAME="$INPUT_WORKFLOWTEMPLATENAME"
REGRESSION_TEST_ID="non-regression-${MODEL_INSTANCE_ID}-$(date +"%s")"
if [[ -z $MODEL_INSTANCE_ID || $MODEL_INSTANCE_ID == "" ]]
then
echo "[$(date +"%m/%d/%y %T")] Error: missing MODEL_INSTANCE_ID env variable"
exit 1
elif [[ -z $WORFLOW_TEMPLATE_NAME ]]
then
echo "[$(date +"%m/%d/%y %T")] Error: missing WORFLOW_TEMPLATE_NAME env variable"
exit 1
fi

PREDICTION_ENDPOINT="https://${API_ENDPOINT}/imodels/predict"
echo "[$(date +"%m/%d/%y %T")] Adding arguments inarix_api_hostname: $API_ENDPOINT"
Expand Down

0 comments on commit dd0ab76

Please sign in to comment.