Skip to content

Commit

Permalink
Merge pull request #8425 from OpenMined/yash/k8s-worker
Browse files Browse the repository at this point in the history
Kubernetes-based worker pool
  • Loading branch information
rasswanth-s authored Jan 31, 2024
2 parents ce8978f + 4e2f173 commit 349985b
Show file tree
Hide file tree
Showing 25 changed files with 2,067 additions and 202 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/pr-tests-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Add K3d Registry
run: |
sudo python ./scripts/patch_hosts.py --add-k3d-registry
# free 10GB of space
- name: Remove unnecessary files
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -614,18 +618,51 @@ jobs:
GITHUB_CI: true
shell: bash
run: |
# install k3d
K3D_VERSION=v5.6.0
DEVSPACE_VERSION=v6.3.10
# install k3d
wget https://github.com/k3d-io/k3d/releases/download/${K3D_VERSION}/k3d-linux-amd64
mv k3d-linux-amd64 k3d
chmod +x k3d
export PATH=`pwd`:$PATH
k3d version
DEVSPACE_VERSION=v6.3.3
curl -sSL https://github.com/loft-sh/devspace/releases/download/${DEVSPACE_VERSION}/devspace-linux-amd64 -o ./devspace
chmod +x devspace
devspace version
tox -e stack.test.integration.k8s
tox -e syft.build.helm
tox -e syft.package.helm
# tox -e syft.test.helm
- name: Get current timestamp
id: date
if: failure()
shell: bash
run: echo "date=$(date +%s)" >> $GITHUB_OUTPUT

- name: Collect logs from k3d
if: steps.changes.outputs.stack == 'true' && failure()
shell: bash
run: |
mkdir -p ./k8s-logs
kubectl describe all -A --context k3d-testgateway1 --namespace testgateway1 > ./k8s-logs/testgateway1-desc-${{ steps.date.outputs.date }}.txt
kubectl describe all -A --context k3d-testdomain1 --namespace testdomain1 > ./k8s-logs/testdomain1-desc-${{ steps.date.outputs.date }}.txt
kubectl logs -l app.kubernetes.io/name!=random --prefix=true --context k3d-testgateway1 --namespace testgateway1 > ./k8s-logs/testgateway1-logs-${{ steps.date.outputs.date }}.txt
kubectl logs -l app.kubernetes.io/name!=random --prefix=true --context k3d-testdomain1 --namespace testdomain1 > ./k8s-logs/testdomain1-logs-${{ steps.date.outputs.date }}.txt
ls -la ./k8s-logs
- name: Upload logs to GitHub
uses: actions/upload-artifact@master
if: steps.changes.outputs.stack == 'true' && failure()
with:
name: k8s-logs-${{ matrix.os }}-${{ steps.date.outputs.date }}
path: ./k8s-logs/

- name: Cleanup k3d
if: steps.changes.outputs.stack == 'true' && failure()
shell: bash
run: |
export PATH=`pwd`:$PATH
k3d cluster delete testgateway1 || true
k3d cluster delete testdomain1 || true
k3d registry delete k3d-registry.localhost || true
Loading

0 comments on commit 349985b

Please sign in to comment.