-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github action tests #8222
github action tests #8222
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# 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. | ||
|
||
name: "k8s tests" | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
create-airflow-docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: checkout | ||
- name: pip install airflow | ||
run: pip install -e .[devel] | ||
- name: build docker 1image | ||
run: ./breeze build-image --production-image | ||
launch-airflow-on-k8s: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
k8s-version: [v1.15.7, v1.16.4, v1.17.2, v1.18.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: checkout | ||
- name: create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
cluster_name: kind | ||
node_image: kindest/node:${{ matrix.k8s-version }} | ||
config: ./kind-cluster-conf.yaml | ||
- name: test cluster running | ||
run: | | ||
kubectl cluster-info | ||
kubectl get pods -n kube-system | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.7' | ||
- name: download helm | ||
run: | | ||
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | ||
chmod 700 get_helm.sh | ||
./get_helm.sh | ||
- name: create namespace | ||
run: kubectl create namespace airflow | ||
- name: pull astronomer helm chart | ||
run: | | ||
helm repo add astronomer https://helm.astronomer.io | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we create a new repo now? Happy to help with that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @schnie thoughts? |
||
helm install airflow --namespace airflow astronomer/airflow \ | ||
--set env[0].name=AIRFLOW__CORE__LOAD_EXAMPLES \ | ||
--set env[0].value=True | ||
kubectl get pods --namespace airflow | ||
kubectl get svc --namespace airflow | ||
kubectl port-forward --namespace airflow svc/airflow-webserver 8080:8080 & | ||
- name: pip install airflow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can pull and use CI image to run the tests on - I am happy to work on it. this way we won't have to install airflow locally and we should be able to repeat it easily using breeze. The problem which Breeze /CI image solves is to make sure that local environment does not have impact on running the tests. But it can be done as a follow-up PR easily. |
||
run: pip install -e .[devel] | ||
- name: run k8sexecutor tests | ||
run: | | ||
pytest tests/runtime/kubernetes/test_kubernetes_executor.py | ||
env: | ||
RUNTIME: kubernetes | ||
- name: run k8sPodOperator tests | ||
run: pytest tests/runtime/kubernetes/test_kubernetes_pod_operator.py | ||
env: | ||
RUNTIME: kubernetes |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,37 +78,3 @@ do | |
done | ||
|
||
RUN_INTEGRATION_TESTS=${RUN_INTEGRATION_TESTS:=""} | ||
|
||
if [[ ${RUNTIME:=} == "kubernetes" ]]; then | ||
export KUBERNETES_MODE=${KUBERNETES_MODE:="git_mode"} | ||
export KUBERNETES_VERSION=${KUBERNETES_VERSION:="v1.15.3"} | ||
|
||
set +u | ||
# shellcheck disable=SC2016 | ||
docker-compose --log-level INFO \ | ||
-f "${MY_DIR}/docker-compose/base.yml" \ | ||
-f "${MY_DIR}/docker-compose/backend-${BACKEND}.yml" \ | ||
-f "${MY_DIR}/docker-compose/runtime-kubernetes.yml" \ | ||
"${INTEGRATIONS[@]}" \ | ||
"${DOCKER_COMPOSE_LOCAL[@]}" \ | ||
run airflow \ | ||
'/opt/airflow/scripts/ci/in_container/entrypoint_ci.sh "${@}"' \ | ||
/opt/airflow/scripts/ci/in_container/entrypoint_ci.sh "${@}" | ||
# Note the command is there twice (!) because it is passed via bash -c | ||
# and bash -c starts passing parameters from $0. TODO: fixme | ||
set -u | ||
else | ||
set +u | ||
# shellcheck disable=SC2016 | ||
docker-compose --log-level INFO \ | ||
-f "${MY_DIR}/docker-compose/base.yml" \ | ||
-f "${MY_DIR}/docker-compose/backend-${BACKEND}.yml" \ | ||
"${INTEGRATIONS[@]}" \ | ||
"${DOCKER_COMPOSE_LOCAL[@]}" \ | ||
run airflow \ | ||
'/opt/airflow/scripts/ci/in_container/entrypoint_ci.sh "${@}"' \ | ||
/opt/airflow/scripts/ci/in_container/entrypoint_ci.sh "${@}" | ||
# Note the command is there twice (!) because it is passed via bash -c | ||
# and bash -c starts passing parameters from $0. TODO: fixme | ||
set -u | ||
Comment on lines
-101
to
-113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come? We're not running those travis tests anymore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought only the "if" part ran Kubernetes tests cc @potiuk Can you verify if we need the else part or is it safe to remove, please :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We definitely need the else. all tests are using it but the kubernetes ones. |
||
fi |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we will switch to the airflow's helm chart eventually :) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly the setup we have right now is just a super janky version of helm (using SED for templating). It's really unflexible and a LOT of code. figure this would make our tests closer to production.