kaxil closed pull request #3957: [AIRFLOW-2952] Fix Kubernetes CI URL: https://github.com/apache/incubator-airflow/pull/3957
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/airflow/example_dags_kubernetes/__init__.py b/airflow/contrib/example_dags/__init__.py similarity index 100% rename from airflow/example_dags_kubernetes/__init__.py rename to airflow/contrib/example_dags/__init__.py diff --git a/airflow/example_dags_kubernetes/example_kubernetes_annotation.py b/airflow/example_dags_kubernetes/example_kubernetes_annotation.py deleted file mode 100644 index 058baf6990..0000000000 --- a/airflow/example_dags_kubernetes/example_kubernetes_annotation.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, 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. -from __future__ import print_function -import airflow -from airflow.operators.python_operator import PythonOperator -from airflow.models import DAG - -args = { - 'owner': 'airflow', - 'start_date': airflow.utils.dates.days_ago(2) -} - -dag = DAG( - dag_id='example_kubernetes_annotation', default_args=args, - schedule_interval=None -) - - -def print_stuff(): - print("annotated!") - - -# You can use annotations on your kubernetes pods! -start_task = PythonOperator( - task_id="start_task", python_callable=print_stuff, dag=dag, - executor_config={ - "KubernetesExecutor": { - "annotations": {"test": "annotation"} - } - } -) diff --git a/scripts/ci/kubernetes/docker/airflow-test-env-init.sh b/scripts/ci/kubernetes/docker/airflow-test-env-init.sh index 33593fd1ca..05f8e20aea 100755 --- a/scripts/ci/kubernetes/docker/airflow-test-env-init.sh +++ b/scripts/ci/kubernetes/docker/airflow-test-env-init.sh @@ -18,8 +18,9 @@ # under the License. cd /usr/local/lib/python2.7/dist-packages/airflow && \ -cp -R example_dags_kubernetes/* /root/airflow/dags/ && \ +cp -R example_dags/* /root/airflow/dags/ && \ +cp -R contrib/example_dags/example_kubernetes_*.py /root/airflow/dags/ && \ airflow initdb && \ alembic upgrade heads && \ -(airflow create_user -u airflow -l airflow -f jon -e [email protected] -r Admin -p airflow || true) && \ +(airflow users --create --username airflow --lastname airflow --firstname jon --email [email protected] --role Admin --password airflow || true) && \ echo "retrieved from mount" > /root/test_volume/test.txt ---------------------------------------------------------------- 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] With regards, Apache Git Services
