run uats with self hosted #240
Workflow file for this run
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: Test self hosted | |
on: | |
pull_request: | |
#inputs: | |
#bundle-test-path: | |
#description: 'Test folder to run' | |
#required: true | |
#bundle-source: | |
#description: 'Either `--channel <channel_name>` or `--file <bundle_file>.yaml`' | |
#required: true | |
#uats-branch: | |
#description: 'The branch of `charmed-kubeflow-uats` to run, e.g. `track/1.7`' | |
#type: string | |
#default: 'main' | |
#required: true | |
#workflow_call: | |
#inputs: | |
#bundle-test-path: | |
#description: 'Test folder to run' | |
#type: string | |
#required: true | |
#bundle-source: | |
#description: 'Either `--channel <channel_name>` or `--file <bundle_file>.yaml`' | |
#type: string | |
#required: true | |
#uats-branch: | |
#description: 'The branch of `charmed-kubeflow-uats` to run, e.g. `track/1.7`' | |
#type: string | |
#default: 'main' | |
#required: true | |
jobs: | |
test-bundle: | |
runs-on: [self-hosted, linux, X64, two-xlarge] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install tools | |
run: | | |
eval "$(pyenv init -)" | |
pip install tox | |
#sudo snap install charmcraft --classic | |
sudo snap install kubectl --classic | |
sudo snap install firefox | |
- name: Setup operator environment | |
uses: charmed-kubernetes/actions-operator@main | |
with: | |
provider: microk8s | |
channel: 1.24/stable | |
juju-channel: 2.9/stable | |
charmcraft-channel: latest/candidate | |
microk8s-addons: "dns hostpath-storage rbac metallb:10.64.140.43-10.64.140.49" | |
# - name: update registry | |
# run: | | |
# sg microk8s -c "cat > /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml << EOF | |
# server = \"https://rocks.canonical.com\" | |
# [host.\"https://rocks.canonical.com\"] | |
# capabilities = [\"pull\", \"resolve\"] | |
# EOF" | |
# | |
# - run: | | |
# sudo cat /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml | |
# - name: Update credentials | |
#run: | | |
#sg microk8s -c "cat >> /var/snap/microk8s/current/args/containerd-template.toml << EOF | |
#[plugins.\"io.containerd.grpc.v1.cri\".registry.configs.\"registry-1.docker.io\".auth] | |
#username = \"${{ secrets.MAKSIM_DOCKERHUB_USER }}\" | |
#password = \"${{ secrets.MAKSIM_DOCKERHUB_PASSWORD }}\" | |
#EOF" | |
# - name: Restart microk8s | |
#run: | | |
#sg microk8s -c "microk8s stop" | |
#sg microk8s -c "microk8s start" | |
#sg microk8s -c "microk8s status --wait-ready --timeout 150" | |
#- name: Enable addons | |
#run: | | |
#sg microk8s -c "microk8s enable ${{ steps.dns-name.outputs.MY_ADDONS }}" | |
- name: Wait for microk8s to be ready and give time for addons | |
run: | | |
sg microk8s -c "mkdir -p ~/.kube" | |
sg microk8s -c "microk8s config > ~/.kube/config" | |
- name: Show all pods status | |
run: | | |
sg microk8s -c "microk8s kubectl get pods --all-namespaces" | |
- name: Increase file system limits | |
run: | | |
sudo sysctl fs.inotify.max_user_instances=1280 | |
sudo sysctl fs.inotify.max_user_watches=655360 | |
- name: Configure Juju model | |
run: | | |
sg microk8s -c "juju add-model kubeflow --config default-series=focal --config automatically-retry-hooks=true" | |
sg microk8s -c "juju model-config" | |
sg microk8s -c "juju status" | |
- name: Configure env for Gecko driver | |
run: | | |
# required for gecko driver | |
export XDG_RUNTIME_DIR="/run/user/$(id -u)" | |
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus" | |
echo "$(id -u)" | |
loginctl enable-linger $USER | |
sudo apt-get install dbus-user-session -yqq | |
systemctl --user start dbus.service | |
- name: Run bundle tests | |
run: | | |
eval "$(pyenv init -)" | |
export BUNDLE_TEST_PATH=tests-bundle/1.7 | |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
sg microk8s -c "tox -e full_bundle_tests -- --file releases/1.7/stable/kubeflow/bundle.yaml" | |
- name: Checkout Kubeflow UATs | |
run: | | |
git clone https://github.com/canonical/charmed-kubeflow-uats.git ~/charmed-kubeflow-uats | |
cd ~/charmed-kubeflow-uats | |
git checkout main | |
- name: Run UATs | |
run: | | |
eval "$(pyenv init -)" | |
sg microk8s -c "tox -c ~/charmed-kubeflow-uats/ -e kubeflow -- --env params.env" | |
- name: Upload selenium screenshots | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: selenium-screenshots | |
path: | | |
sel-screenshots | |
**/sel-screenshots | |
**/**/sel-screenshots | |
- name: Run connectivity check | |
if: always() | |
run: | | |
sg microk8s -c "curl --max-time 10 --connect-timeout 10 http://10.64.140.43.nip.io" | |
- name: Dump Juju/k8s logs on failure | |
if: failure() || cancelled() | |
run: | | |
sg microk8s -c "juju status" | |
echo "Dumping k8s logs" | |
sg microk8s -c "microk8s kubectl get all --all-namespaces" | |
- name: Descript all pods | |
if: failure() | |
run: | | |
sg microk8s -c "microk8s kubectl describe pods --all-namespaces" | |
- name: Get logs from failed pods | |
if: failure() || cancelled() | |
run: | | |
POD_LIST=$(sg microk8s -c "microk8s kubectl get pods --all-namespaces -o 'custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace,CONTAINERS:.status.containerStatuses[*].ready'" | awk '$3 == "false" {print $1,$2}') | |
if [ -n "$POD_LIST" ]; then | |
echo "Actual Logs" | |
while read -r POD NAMESPACE; do | |
echo "\n\n\nPod: $POD" | |
sg microk8s -c "microk8s kubectl logs -n $NAMESPACE $POD" | |
done <<< "$POD_LIST" | |
fi | |
- name: Save debug artifacts | |
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main | |
if: always() |