diff --git a/.github/workflows/instructlab_testing_framework.yaml b/.github/workflows/instructlab_testing_framework.yaml index 7d691543a..80c62fc8d 100644 --- a/.github/workflows/instructlab_testing_framework.yaml +++ b/.github/workflows/instructlab_testing_framework.yaml @@ -36,12 +36,18 @@ jobs: fail-fast: false matrix: include: - - arch: amd64 + - image_name: instructlab-amd aws_image_type: t3a.medium aws_ami_architecture: x86_64 - # - arch: amd64 + - image_name: instructlab-nvidia + aws_image_type: t3a.medium + aws_ami_architecture: x86_64 + # - image_name: instructlab-amd # aws_image_type: g5.8xlarge # aws_ami_architecture: x86_64 + # - image_name: instructlab-nvidia + # aws_image_type: g5.8xlarge + # aws_ami_architecture: x86_64 steps: - name: Checkout uses: actions/checkout@v4.1.4 @@ -73,6 +79,29 @@ jobs: env: TF_VAR_aws_instance_type: ${{ matrix.aws_image_type }} TF_VAR_aws_ami_architecture: ${{ matrix.aws_ami_architecture }} + + - 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/instructlab + + - name: Release Info + run: cat /etc/os-release + + # This provision will actually run the instructlab images, might need to run this differently than standard container + # Commenting out the run statement in the playbook for testing + - name: Provision + run: | + ansible-playbook ./main/training/instructlab/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: Terraform Output id: terraform-output @@ -82,10 +111,9 @@ 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' + # # THIS IS COMMING IN https://github.com/instructlab/instructlab/pull/1016 + # - name: Run Integration Tests + # working-directory: ./main/training/instructlab - name: Destroy Test Environment id: down diff --git a/.gitignore b/.gitignore index efc8276a8..c213095b0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ models/* convert_models/converted_models recipes/common/bin/* */.venv/ +training/instructlab/instructlab diff --git a/training/instructlab/provision/playbook.yml b/training/instructlab/provision/playbook.yml new file mode 100644 index 000000000..790296327 --- /dev/null +++ b/training/instructlab/provision/playbook.yml @@ -0,0 +1,46 @@ +--- +- 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: 10 + timeout: 60 + + - name: Gather facts for first time + ansible.builtin.setup: + + - name: Required Packages + ansible.builtin.package: + name: "{{ item }}" + state: present + with_items: + - podman + - cuda-toolkit + - python3 + - git + - python3-pip + - cmake + - build-essential + - virtualenv + - make + + # - name: Install bootc + # ansible.builtin.command: | + # sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-d9fbb93c29 + + # - name: Run Instructlab image + # containers.podman.podman_container: + # name: {{ image_name }} + # image: ghcr.io/containers/{{ image_name }}:latest + # state: started + # interactive: true + # tty: true + # detach: false + # vars: + # my_variable: "{{ lookup('env', 'image_name') }}" diff --git a/training/instructlab/provision/requirements.yml b/training/instructlab/provision/requirements.yml new file mode 100644 index 000000000..51377264e --- /dev/null +++ b/training/instructlab/provision/requirements.yml @@ -0,0 +1,5 @@ +--- +collections: + - name: containers.podman + version: 1.13.0 + - name: ansible.builtin \ No newline at end of file