CI #14
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
# 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 GitHub Actions / CIInvalid workflow file
|
||
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 }} |