sample.sh now runs both estimator and customestimator, and returns the right exit code
# See the License for the specific language governing permissions and
# limitations under the License.
-#[TODO] Hardcoded for now, fix when this works
-cd estimator
-
+run_script_local() {
+ cd $1
GCS_TRAIN_FILE=gs://cloud-samples-data/ml-engine/census/data/adult.data.csv
GCS_EVAL_FILE=gs://cloud-samples-data/ml-engine/census/data/adult.test.csv
CENSUS_DATA=census_data
@@ -37,7 +36,20 @@ python -m trainer.task --train-files $TRAIN_FILE \
--train-steps $TRAIN_STEPS \
--eval-steps 100
-
+ if [ $? = 0 ]; then
+ echo "python script succeeded"
rm -rf $CENSUS_DATA
rm -rf $OUTPUT_DIR
cd ..
+ return 0
+ fi
+ echo "python script failed"
+ return 1
+}
+
+run_script_local estimator
+if [ $? = 1 ]; then
+ exit 1
+fi
+
+run_script_local customestimator
\ No newline at end of file
