Skip to content

CI

CI #14

Workflow file for this run

# reusable workflow triggered by other actions
name: CI
on:
schedule:
- cron: 0 13 * * 1
jobs:
start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/[email protected]
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ${{ vars.AWS_EC2_IMAGE_ID }}
ec2-instance-type: ${{ vars.AWS_EC2_INSTANCE_TYPE }}
subnet-id: ${{ vars.AWS_DEFAULT_SUBNET_ID }}
security-group-id: ${{ vars.AWS_SECURITY_GROUP_ID }}
integration-tests:
name: Run integration tests
needs: [start-runner, lint, unit-tests]

Check failure on line 34 in .github/workflows/deploy-aws.yaml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-aws.yaml (Line: 34, Col: 27): Job 'integration-tests' depends on unknown job 'lint'. .github/workflows/deploy-aws.yaml (Line: 34, Col: 33): Job 'integration-tests' depends on unknown job 'unit-tests'.
runs-on: ${{ needs.start-runner.outputs.label }}
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Setup operator environment
# The runner will run the code as root. There is problem when using juju under root so here is small workaround to exec as ubuntu user
run: |
chmod 777 .
/bin/su -c "$(pwd)/.github/workflows/setup_environment.sh" - ubuntu
- name: Setup microk8s
run: /bin/su -c "$(pwd)/.github/workflows/setup_microk8s.sh" - ubuntu
- name: Run integration tests
run: /bin/su -c "cd $(pwd) && tox -vve aws-integration -- --model kubeflow" - ubuntu
# On failure, capture debugging resources
- name: Get all
run: /bin/su -c "kubectl get all -A" - ubuntu
if: failure()
- name: Get juju status
run: /bin/su -c "juju status" - ubuntu
if: failure()
- name: Get workload logs
run: /bin/su -c "kubectl logs --tail 100 -ntesting -lapp.kubernetes.io/name=mlflow-server-manager" - ubuntu
if: failure()
- name: Get operator logs
run: /bin/su -c "kubectl logs --tail 100 -ntesting -loperator.juju.is/name=mlflow-server-manager" - ubuntu
if: failure()
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner
- lint
- unit-tests
- integration-tests
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Stop EC2 runner
uses: machulav/[email protected]
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}