You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by fg...@apache.org on 2018/04/26 21:34:34 UTC

[incubator-sdap-ningester] branch master updated: SDAP-65 ningesterpy output not printing in docker logs (#8)

This is an automated email from the ASF dual-hosted git repository.

fgreg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ningester.git


The following commit(s) were added to refs/heads/master by this push:
     new 6591c52  SDAP-65 ningesterpy output not printing in docker logs (#8)
6591c52 is described below

commit 6591c524af96a2875659892f4bd3942dc822a57f
Author: fgreg <fg...@gmail.com>
AuthorDate: Thu Apr 26 14:34:32 2018 -0700

    SDAP-65 ningesterpy output not printing in docker logs (#8)
    
    * Add -u flag to python command for unbuffered stdout.
    
    * Added wait for ningesterpy to start. Used -e and single quotes for sed.
    
    * Made stdout not buffer with `stdbuf -o`
---
 docker/entrypoint.sh | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 250efc0..ae80a4c 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -13,12 +13,19 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-set -e
+set -eb
 
 NINGESTER_JAR=`find ningester/build/libs -name ningester*.jar`
 CONFIG_FILES=`find /config -name "*.yml" | awk -vORS=, '{ print $1 }'`
 GRANULE=`find /data -type f -print -quit`
 
-python -m sdap.ningesterpy 2>&1 | sed "s/^/[ningesterpy] /" &
+echo "Launching ningesterpy. Logs from this process will be prefixed with [ningesterpy]"
+python -u -m sdap.ningesterpy 2>&1 | stdbuf -o0 sed -e 's/^/[ningesterpy] /' &
+
+until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:5000/healthcheck); do
+    sleep 1
+done
+
+echo "Launching ningester. Logs from this process will be prefixed with [ningester]"
+java -Dspring.profiles.active=$1 -Dspring.config.location=classpath:/application.yml,${CONFIG_FILES} -jar ${NINGESTER_JAR} granule=file://${GRANULE} ${@:2} 2>&1 | sed -e 's/^/[ningester] /'
 
-java -Dspring.profiles.active=$1 -Dspring.config.location=classpath:/application.yml,${CONFIG_FILES} -jar ${NINGESTER_JAR} granule=file://${GRANULE} ${@:2} | sed "s/^/[ningester] /"
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
fgreg@apache.org.