ap-airflow icon indicating copy to clipboard operation
ap-airflow copied to clipboard

Copy logging sidecar entrypoint to 2.2.3 image

Open thmzlt opened this issue 3 years ago • 5 comments
trafficstars

What this PR does / why we need it: Copy logging sidecar entrypoint to 2.2.3 image

Special notes for your reviewer: These are the changes suggested by @rob-1126 in his implementation of the sidecar logging feature. I copied them verbatim.

Related to astronomer/issues#3563.

thmzlt avatar Jan 03 '22 14:01 thmzlt

Don't we need it for other images as well, or are we intentionally targeting 2.2.3 and above?

kaxil avatar Jan 11 '22 08:01 kaxil

Don't we need it for other images as well, or are we intentionally targeting 2.2.3 and above?

@kaxil, that question came up on our conversation yesterday. Rob initially added support for logging sidecar on 2.1.3 and I did 2.2.3 because it was the latest version.

@rob-1126 can you check Daniel's comments when you have a chance?

thmzlt avatar Jan 11 '22 13:01 thmzlt

@kaxil, that question came up on our conversation yesterday. Rob initially added support for logging sidecar on 2.1.3 and I did 2.2.3 because it was the latest version.

I don't see it in 2.1.3 though

kaxil avatar Jan 21 '22 19:01 kaxil

@kaxil Thomaz was waiting until everything was approved before copying it to the other supported versions.

danielhoherd avatar Jan 21 '22 20:01 danielhoherd

Agreed. That comment doesn't seem to describe what's going on there at all. I suggest snipping lines 33-45 and reimplementing a retry fail there that's less terrible. That code is certainly terrible and entirely untested (my doing). Lines 33-45 look to not serve their intended purpose at all (definitely my fault). It looks like at some time in the past lines 46-51 probably resided between lines 38 and 39.

basically to do something in bash like: while true: try: setup_redirect() break catch: sleep(.05)

On Fri, Jan 21, 2022 at 4:09 PM Daniel Hoherd @.***> wrote:

@.**** commented on this pull request.

In 2.2.3/bullseye/include/entrypoint https://github.com/astronomer/ap-airflow/pull/388#discussion_r789995464:

  • done +fi

+# Optional support for shipping unstructured logs +if [[ ! -z ${UNSTRUCTURED_LOGGING_HOST+x} ]] && [[ "$COMPONENT" =~ ^(scheduler|webserver|worker)$ ]] && [[ $1 != "python" ]]; then

  • if [[ -z ${COMPONENT} ]]; then
  • echo "COMPONENT must be set when using sidecar logging."
  • exit 2;
  • fi
  • UNSTRUCTURED_LOGGING_SOCKET=/dev/tcp/${UNSTRUCTURED_LOGGING_HOST}/${UNSTRUCTURED_LOGGING_PORT}
  • echo "Connecting to tcp logging daemon on ${UNSTRUCTURED_LOGGING_SOCKET}"
  • while true; do
  • set +e
  • create a pointer to the origianl stdout and stderr

  • exec 3>&1 4>&2 2>&4
  • clobber old stdout and stderr

What i mean is there's a comment that says "Clobber old stdout and stderr" but there is nothing below that comment.

— Reply to this email directly, view it on GitHub https://github.com/astronomer/ap-airflow/pull/388#discussion_r789995464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVHHXBX4J6DOIC7SPJNWLTDUXHDPBANCNFSM5LFMPEZQ . You are receiving this because you were mentioned.Message ID: @.***>

rob-1126 avatar Jan 21 '22 21:01 rob-1126

(Closing this because it is stale)

jedcunningham avatar Jan 23 '23 20:01 jedcunningham

FTR this approach as abandoned, so this PR wasn't needed anymore.

danielhoherd avatar Jan 23 '23 20:01 danielhoherd