Update Flink Docs #419
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Flink Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
types: [ opened, reopened, synchronize, labeled ] | |
schedule: | |
- cron: '0 4 * * *' # run once a day at 4 AM | |
jobs: | |
build: | |
# run on: | |
# - all pushes to main | |
# - schedule defined above | |
# - a PR was just labeled 'test-flink' or 'test-all' | |
# - a PR with 'test-flink' or 'test-all' label was opened, reopened, or synchronized | |
if: | | |
github.event_name == 'push' || | |
github.event_name == 'schedule' || | |
github.event.label.name == 'test-all' || | |
github.event.label.name == 'test-flink' || | |
contains( github.event.pull_request.labels.*.name, 'test-all') || | |
contains( github.event.pull_request.labels.*.name, 'test-flink') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Starts a k8s cluster with NetworkPolicy enforcement and installs both | |
# kubectl and helm | |
# | |
# ref: https://github.com/jupyterhub/action-k3s-helm/ | |
- uses: jupyterhub/action-k3s-helm@v3 | |
with: | |
metrics-enabled: false | |
traefik-enabled: false | |
docker-enabled: true | |
- name: Setup CertManager | |
run: | | |
# Setup cert-manager, required by Flink Operator | |
CERT_MANAGER_VERSION=1.9.1 | |
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v${CERT_MANAGER_VERSION}/cert-manager.yaml | |
- name: Wait for CertManager to be ready | |
uses: jupyterhub/action-k8s-await-workloads@v1 | |
with: | |
timeout: 150 | |
max-restarts: 1 | |
namespace: cert-manager | |
- name: Setup FlinkOperator | |
run: | | |
FLINK_OPERATOR_VERSION=1.5.0 | |
helm repo add flink-operator-repo https://downloads.apache.org/flink/flink-kubernetes-operator-${FLINK_OPERATOR_VERSION} | |
helm install flink-kubernetes-operator flink-operator-repo/flink-kubernetes-operator --wait | |
kubectl get pod -A | |
kubectl get crd -A | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v0' | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: 'Setup minio + mc' | |
run: | | |
wget --quiet https://dl.min.io/server/minio/release/linux-amd64/minio | |
chmod +x minio | |
mv minio /usr/local/bin/minio | |
wget --quiet https://dl.min.io/client/mc/release/linux-amd64/mc | |
chmod +x mc | |
mv mc /usr/local/bin/mc | |
minio --version | |
mc --version | |
- name: Install dependencies & our package | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r dev-requirements.txt | |
python -m pip install -e . | |
- name: Install socat so kubectl port-forward will work | |
run: | | |
# Not sure if this is why kubectl proxy isn't working, but let's try | |
sudo apt update --yes && sudo apt install --yes socat | |
- name: Test with pytest | |
run: | | |
pytest -vvv -s --cov=pangeo_forge_runner tests/integration/test_flink.py | |
kubectl get pod -A | |
kubectl describe pod | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v2 |