Skip to content

Commit

Permalink
creating anisble playbooks and more content to testing framework
Browse files Browse the repository at this point in the history
Signed-off-by: greg pereira <[email protected]>
  • Loading branch information
Gregory-Pereira committed May 1, 2024
1 parent 4419054 commit a99c1e5
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/instructlab_testing_framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,29 @@ jobs:
fail-fast: false
matrix:
include:
<<<<<<< HEAD
- arch: amd64
aws_image_type: t3a.medium
aws_ami_architecture: x86_64
# - arch: amd64
# aws_image_type: g5.8xlarge
# aws_ami_architecture: x86_64
=======
- image_name: instructlab-amd
aws_image_type: t2.micro
aws_ami_architecture: x86_64
arch: amd64
# - image_name: instructlab-nvidia
# aws_image_type: t2.micro
# 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
>>>>>>> 302ce79 (creating anisble playbooks and more content to testing framework)
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -82,10 +99,29 @@ jobs:
echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT
working-directory: terraform-test-environment-module

- name: Ansible Collections
run: ansible-galaxy install -r ./provision/requirements.yml
working-directory: ./main/training/instructlab

# 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: Set up Python
uses: actions/[email protected]
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
Expand Down
68 changes: 68 additions & 0 deletions training/instructlab/provision/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
- 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: Add Bootc Repo
ansible.builtin.get_url:
url: "https://copr.fedorainfracloud.org/coprs/rhcontainerbot/bootc/repo/fedora-39/rhcontainerbot-bootc-fedora-39.repo"
dest: /etc/yum.repos.d/bootc.repo
mode: 0644

- name: Add Cuda Toolkit Repo
ansible.builtin.get_url:
url: "https://developer.download.nvidia.com/compute/cuda/repos/fedora39/x86_64/cuda-fedora39.repo"
dest: /etc/yum.repos.d/bootc.repo
mode: 0644


- name: Update package cache
ansible.builtin.dnf:
update_cache: yes

- name: Required Packages
ansible.builtin.package:
name: "{{ item }}"
state: present
with_items:
- podman
- python3
- git
- python3-pip
- cmake
- virtualenv
- make
- automake
- gcc
- gcc-c++
- kernel-devel


# - 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') }}"
4 changes: 4 additions & 0 deletions training/instructlab/provision/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
collections:
- name: containers.podman
version: 1.13.0

0 comments on commit a99c1e5

Please sign in to comment.