[ 
https://issues.apache.org/jira/browse/SDAP-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16454908#comment-16454908
 ] 

ASF GitHub Bot commented on SDAP-65:
------------------------------------

fgreg closed pull request #8: SDAP-65 ningesterpy output not printing in docker 
logs
URL: https://github.com/apache/incubator-sdap-ningester/pull/8
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> ningesterpy output not printing in docker logs
> ----------------------------------------------
>
>                 Key: SDAP-65
>                 URL: https://issues.apache.org/jira/browse/SDAP-65
>             Project: Apache Science Data Analytics Platform
>          Issue Type: Bug
>          Components: nexus
>            Reporter: Frank Greguska
>            Assignee: Frank Greguska
>            Priority: Major
>
> The docker logs are supposed to print the stdout from the python process into 
> the logs with prefix `[ningesterpy]` but this is not currently working.
> In the current ningester docker image ningesterpy is run without the `-u` 
> flag meaning that stdout can be buffered. ThisĀ can cause theĀ `[ningesterpy]` 
> messages to not show up in the logs.
> Need to modify the entrypoint script to add `-u` to the python command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to