-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anna Jung (VMware) <antheaj@vmware.com>
- Loading branch information
Anna Jung (VMware)
committed
Mar 23, 2023
1 parent
9fa5b94
commit eebd58c
Showing
12 changed files
with
226 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
e2e: | ||
name: AWS | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
juju: [2.9/stable] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install juju | ||
run: | | ||
sudo snap install juju --classic --channel ${{ matrix.juju }} | ||
sudo snap install juju-wait --classic | ||
- name: Bootstrap onto AWS | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
set -eux | ||
juju autoload-credentials --client aws | ||
juju bootstrap aws/us-east-1 uk8saws --debug --show-log --config test-mode=true --model-default test-mode=true | ||
juju deploy ubuntu --constraints 'instance-type=t3a.xlarge root-disk=80G' | ||
juju wait -vw | ||
juju status --format yaml | ||
- name: Copy manifests to AWS instance | ||
run: | | ||
set -eux | ||
juju scp -- -r $(pwd)/ ubuntu/0:~/ | ||
- name: Install Docker | ||
run: juju ssh ubuntu/0 ./manifests/tests/e2e/setup/install_docker.sh | ||
|
||
- name: Install Python | ||
run: juju ssh ubuntu/0 ./manifests/tests/e2e/setup/install_python.sh | ||
|
||
- name: Install Kubectl | ||
run: juju ssh ubuntu/0 ./manifests/tests/e2e/setup/install_kubectl.sh | ||
|
||
- name: Install Kustomize | ||
run: juju ssh ubuntu/0 ./manifests/tests/gh-actions/install_kustomize.sh | ||
|
||
- name: Install KinD | ||
run: juju ssh ubuntu/0 ./manifests/tests/gh-actions/install_kind.sh | ||
|
||
- name: Create a KinD Cluster | ||
run: juju ssh ubuntu/0 kind create cluster --config ./manifests/tests/gh-actions/kind-cluster.yaml | ||
|
||
- name: Deploy Kubeflow | ||
run: juju ssh ubuntu/0 ./manifests/tests/e2e/setup/install_kubeflow.sh | ||
timeout-minutes: 45 | ||
|
||
- name: Test Kubeflow with mnist | ||
run: | | ||
juju ssh ubuntu/0 <<EOF | ||
cd manifests/tests/e2e | ||
./runner.sh | ||
EOF | ||
timeout-minutes: 20 | ||
|
||
- name: Generate KinD logs | ||
env: | ||
JOB_INDEX: ${{ strategy.job-index }} | ||
run: | | ||
set -eux | ||
juju ssh ubuntu/0 ./manifests/tests/e2e/setup/generate_kind_logs.sh | ||
juju scp ubuntu/0:~/kind-logs-$JOB_INDEX.tar.gz . | ||
if: failure() | ||
|
||
- name: Upload KinD logs tarball | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kind-logs | ||
path: kind-logs-${{ strategy.job-index }}.tar.gz | ||
if: failure() | ||
|
||
- name: Generate kubectl describe logs | ||
env: | ||
JOB_INDEX: ${{ strategy.job-index }} | ||
run: | | ||
set -eux | ||
juju ssh ubuntu/0 ./manifests/tests/e2e/setup/generate_describe_logs.sh | ||
juju scp ubuntu/0:~/describe.tar.gz kubectl-describe-$JOB_INDEX.tar.gz | ||
if: failure() | ||
|
||
- name: Upload kubectl describe tarball | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kubectl-describe | ||
path: kubectl-describe-${{ strategy.job-index }}.tar.gz | ||
if: failure() | ||
|
||
- name: Generate pod logs | ||
env: | ||
JOB_INDEX: ${{ strategy.job-index }} | ||
run: | | ||
set -eux | ||
juju ssh ubuntu/0 ./manifests/tests/e2e/setup/generate_pod_logs.sh | ||
juju scp ubuntu/0:~/stdout.tar.gz kubectl-stdout-$JOB_INDEX.tar.gz | ||
if: failure() | ||
|
||
- name: Upload pod logs tarball | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kubectl-stdout | ||
path: kubectl-stdout-${{ strategy.job-index }}.tar.gz | ||
if: failure() | ||
|
||
- name: Destroy controller | ||
run: juju destroy-controller -y uk8saws --destroy-all-models --destroy-storage | ||
if: always() |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
kubernetes==21.7.0 | ||
kfp==1.8.4 | ||
kubeflow-katib==0.12.0 | ||
kubernetes==19.15.0 | ||
kfp==1.8.19 | ||
kubeflow-katib==0.14.0 | ||
protobuf==3.19.5 | ||
PyYAML==5.4.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
echo "Installing necessary RBAC.""" | ||
echo "Installing required python packages." | ||
pip3 install -r requirements.txt | ||
|
||
echo "Installing necessary RBAC." | ||
kubectl apply -f yamls | ||
|
||
echo "Setting up port-forward..." | ||
./hack/proxy_istio.sh | ||
./hack/proxy_pipelines.sh | ||
|
||
echo "Running the tests.""" | ||
echo "Running the tests." | ||
python3 mnist.py | ||
|
||
echo "Cleaning up opened processes.""" | ||
echo "Cleaning up opened processes." | ||
./hack/cleanup_proxies.sh | ||
|
||
echo "Leaving the cluster as is for further inspection." |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
kubectl describe pods -A | ||
|
||
mkdir describe-${JOB_INDEX} | ||
|
||
for RESOURCE in $(kubectl api-resources -o name | sort); do | ||
kubectl describe $RESOURCE -A > "describe-${JOB_INDEX}/$RESOURCE.describe" || true | ||
done | ||
|
||
tar -cvzf describe.tar.gz describe-${JOB_INDEX}/*.describe |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
kind export logs ./logs | ||
tar -czvf kind-logs-${JOB_INDEX}.tar.gz ./logs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
kubectl get pods -A | ||
|
||
mkdir stdout-${JOB_INDEX} | ||
|
||
for NAMESPACE in kubeflow-user-example-com kubeflow; do | ||
for POD in $(kubectl get pods -n $NAMESPACE -o custom-columns=:metadata.name --no-headers); do | ||
for CONTAINER in $(kubectl get pods -n $NAMESPACE -o jsonpath="{.spec.containers[*].name}" $POD); do | ||
kubectl logs -n $NAMESPACE --timestamps $POD -c $CONTAINER > stdout-${JOB_INDEX}/$NAMESPACE-$POD-$CONTAINER.log || true | ||
done | ||
done | ||
done | ||
|
||
tar -cvzf stdout.tar.gz stdout-${JOB_INDEX}/*.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
sudo apt update | ||
|
||
# Install prereq packages | ||
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common tar | ||
|
||
# Add GPG key for the official Docker repository | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
|
||
# Add the Docker repository APT sources | ||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" | ||
|
||
# Update to install from Docker repo | ||
apt-cache policy docker-ce | ||
|
||
# Install Docker | ||
sudo apt install -y docker-ce | ||
|
||
# Verify Docker is running | ||
sudo systemctl status docker | ||
|
||
# Add user to the docker group | ||
sudo usermod -a -G docker ubuntu |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
# Download kubectl | ||
sudo curl -L "https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl | ||
sudo chmod +x /usr/local/bin/kubectl | ||
kubectl version --short --client |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
# Install kubeflow using raw manifests | ||
cd manifests | ||
while ! kustomize build example | awk '!/well-defined/' | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done | ||
|
||
# Wait for pods to be ready | ||
kubectl -n kubeflow wait --for=condition=Ready pods --all --timeout=1200s |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
# Install python | ||
sudo apt install python3 | ||
python3 --version | ||
|
||
# Install pip | ||
sudo apt install -y python3-pip |