From eb0e494f20dcc0959ef550e4bf55e2015baf45ec Mon Sep 17 00:00:00 2001 From: Newnius Date: Thu, 2 Jul 2020 21:16:22 +0800 Subject: [PATCH] update, exit with real exitCode --- tensorflow/1.14-gpu/bootstrap.sh | 4 ++++ tensorflow/1.14-gpu/save.py | 2 +- tensorflow/2.1-gpu/bootstrap.sh | 4 ++++ tensorflow/2.1-gpu/save.py | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tensorflow/1.14-gpu/bootstrap.sh b/tensorflow/1.14-gpu/bootstrap.sh index 503e80b..00f7c06 100755 --- a/tensorflow/1.14-gpu/bootstrap.sh +++ b/tensorflow/1.14-gpu/bootstrap.sh @@ -17,5 +17,9 @@ fi # use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment eval $@ +code=$? + # persist output python /etc/save.py + +exit $code diff --git a/tensorflow/1.14-gpu/save.py b/tensorflow/1.14-gpu/save.py index 16ad890..4eeaf58 100644 --- a/tensorflow/1.14-gpu/save.py +++ b/tensorflow/1.14-gpu/save.py @@ -15,6 +15,6 @@ if __name__ == '__main__': client = Client(hdfs_address) client.upload(hdfs_dir, output_dir) - print('Save ' + output_dir + 'to' + hdfs_address + ' ' + hdfs_dir) + print('Save ' + output_dir + ' to' + hdfs_address + ' ' + hdfs_dir) except Exception as e: print('Unable to persist data to HDFS,', str(e)) diff --git a/tensorflow/2.1-gpu/bootstrap.sh b/tensorflow/2.1-gpu/bootstrap.sh index b7b7a88..5c3871a 100755 --- a/tensorflow/2.1-gpu/bootstrap.sh +++ b/tensorflow/2.1-gpu/bootstrap.sh @@ -17,5 +17,9 @@ fi # use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment eval $@ +code=$? + # Persist output python /etc/save.py + +exit $code diff --git a/tensorflow/2.1-gpu/save.py b/tensorflow/2.1-gpu/save.py index 16ad890..4eeaf58 100644 --- a/tensorflow/2.1-gpu/save.py +++ b/tensorflow/2.1-gpu/save.py @@ -15,6 +15,6 @@ if __name__ == '__main__': client = Client(hdfs_address) client.upload(hdfs_dir, output_dir) - print('Save ' + output_dir + 'to' + hdfs_address + ' ' + hdfs_dir) + print('Save ' + output_dir + ' to' + hdfs_address + ' ' + hdfs_dir) except Exception as e: print('Unable to persist data to HDFS,', str(e))