You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/17 08:01:30 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #9331: add log endpoint

mik-laj commented on a change in pull request #9331:
URL: https://github.com/apache/airflow/pull/9331#discussion_r441356636



##########
File path: airflow/api_connexion/endpoints/log_endpoint.py
##########
@@ -14,13 +14,99 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+import logging
+import os
+from io import BytesIO
 
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8135
+from flask import Response, current_app, request
+from itsdangerous.exc import BadSignature
+from itsdangerous.url_safe import URLSafeSerializer
 
+from airflow import models, settings
+from airflow.api_connexion.exceptions import BadRequest, NotFound
+from airflow.configuration import conf
+from airflow.models import DagRun
+from airflow.settings import STORE_SERIALIZED_DAGS
+from airflow.utils.helpers import render_log_filename
+from airflow.utils.session import provide_session
 
-def get_log():
+if os.environ.get('SKIP_DAGS_PARSING') != 'True':
+    dagbag = models.DagBag(settings.DAGS_FOLDER, store_serialized_dags=STORE_SERIALIZED_DAGS)
+else:
+    dagbag = models.DagBag(os.devnull, include_examples=False)

Review comment:
       We need to come up with a way to make DagBag created only one for the webserver. Web and API should share one instance.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org