From 0b36defc4905005e2fef625f4990973897452a8c Mon Sep 17 00:00:00 2001 From: greg pereira Date: Tue, 30 Apr 2024 16:25:36 -0700 Subject: [PATCH] creating anisble playbooks and more content to testing framework Signed-off-by: greg pereira --- ...work.yaml => bootc_testing_framework.yaml} | 26 ++++++++++++------- training/provision/playbook.yml | 21 +++++++++++++++ training/provision/requirements.yml | 4 +++ 3 files changed, 41 insertions(+), 10 deletions(-) rename .github/workflows/{instructlab_testing_framework.yaml => bootc_testing_framework.yaml} (81%) create mode 100644 training/provision/playbook.yml create mode 100644 training/provision/requirements.yml diff --git a/.github/workflows/instructlab_testing_framework.yaml b/.github/workflows/bootc_testing_framework.yaml similarity index 81% rename from .github/workflows/instructlab_testing_framework.yaml rename to .github/workflows/bootc_testing_framework.yaml index 7d691543..d669371b 100644 --- a/.github/workflows/instructlab_testing_framework.yaml +++ b/.github/workflows/bootc_testing_framework.yaml @@ -1,4 +1,4 @@ -name: Instructlab Images Testing Framework +name: Bootc Images Testing Framework on: schedule: # schedule the job to run every day at midnight @@ -9,7 +9,7 @@ on: branches: - main paths: - - .github/workflows/instructlab_testing_framework.yaml + - .github/workflows/bootc_testing_framework.yaml workflow_dispatch: @@ -37,11 +37,9 @@ jobs: matrix: include: - arch: amd64 - aws_image_type: t3a.medium + aws_image_type: t2.micro + image_name: nvidia-bootc aws_ami_architecture: x86_64 - # - arch: amd64 - # aws_image_type: g5.8xlarge - # aws_ami_architecture: x86_64 steps: - name: Checkout uses: actions/checkout@v4.1.4 @@ -82,10 +80,18 @@ jobs: echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT working-directory: terraform-test-environment-module - - name: Set up Python - uses: actions/setup-python@v5.1.0 - with: - python-version: '3.11' + - name: Ansible Collections + run: ansible-galaxy install -r ./provision/requirements.yml + working-directory: ./main/training + + - name: Provision + run: | + ansible-playbook ./main/training/provision/playbook.yml \ + -i terraform-test-environment-module/hosts.ini \ + --private-key=terraform-test-environment-module/${{ steps.terraform-output.outputs.pem_filename }} + env: + ANSIBLE_HOST_KEY_CHECKING: false + image_name: ${{ matrix.image_name }} - name: Destroy Test Environment id: down diff --git a/training/provision/playbook.yml b/training/provision/playbook.yml new file mode 100644 index 00000000..b1e820d6 --- /dev/null +++ b/training/provision/playbook.yml @@ -0,0 +1,21 @@ +--- +- name: Test Environment Provisioning + hosts: test_environments + remote_user: fedora + become: true + gather_facts: false + + tasks: + + - name: Wait until the instance is ready + ansible.builtin.wait_for_connection: + delay: 15 + timeout: 180 + + - name: Gather facts for first time + ansible.builtin.setup: + + - name: Required Packages + ansible.builtin.package: + name: podman + state: present diff --git a/training/provision/requirements.yml b/training/provision/requirements.yml new file mode 100644 index 00000000..da8ae831 --- /dev/null +++ b/training/provision/requirements.yml @@ -0,0 +1,4 @@ +--- +collections: + - name: containers.podman + version: 1.13.0