© Copyright 2023, Intel Corporation
Intel® Optimized Cloud Recipes (OCRs) are:
- A combination of documentation(markdown) and scripted automation.
- Developed to enable/optimize technologies on Intel® Architecture (IA).
- Scripts that depend on existing Intel® Tuning Guides that were generated from testing and benchmarking exercises.
- Currently focused on enabling Infrastructure-as-a-Service (IaaS) Virtual Machines (VMs) on public cloud providers (today, on-prem hardware configuration is not supported).
- Written in Ansible or PowerShell, meant to automate operating system and above configuration.
- Ready to be Integrated into Intel® Cloud Optimization Modules for HashiCorp Terraform using Cloud Cloud-Init integration. See GCP Module example).
- Can also be used directly on their own(see usage on each recipe).
Currently out-of-scope for OCRs:
- Physical on-prem hardware configuration.
- Defining tuning parameters/knobs and values that are required to optimize a workload.
- Benchmarking.
Note: OCRs focus on the enablement of Intel Technologies and often will include a demo but are not meant to be a benchmarking tool.
Intel is working on a separate benchmarking repository called Workload Services Framework that will consume these recipes and provide benchmarking capabilities.
The primary goal of OCRs is to simplify and accelerate the enablement of Intel® Technologies on public cloud VMs.
Some examples of technologies that can be enabled and optimized are:
- OneAPI AI Training and Inference with Intel® Advanced Matrix Extensions (Intel® AMX)
- Encryption/Decryption with Intel Quick Assist Technology (Intel QAT)
- MySQL Open Source Database
- PostgreSQL Open Source Database
The Intel® Cloud Optimization Modules for HashiCorp Terraform enable the deployment of optimized instances on public cloud. The modules are available on the Terraform Registry.
The Modules can be easily integrated with these Recipes, see Usage below.
Recipes are located in the ./recipes
folder. Each recipe has its own folder and contains a README.md
file with instructions on how to use it.
There are two primary ways to use these Recipes:
- Via a Cloud-init Integration with Intel® Cloud Optimization Modules for HashiCorp Terraform
- By running Ansible via the command line
Option 1 - Integration with Intel® Cloud Optimization Modules for HashiCorp Terraform via Cloud-Init
Overview:
- The following demonstrates how to use the
ai-pytorch-amx-ubuntu
recipe with the Intel GCP module for Terraform. - It uses the Terraform
user_data
argument that enables the execution on thecloud_init.yml
file. - The
cloud_init.yml
file calls the Ansible playbook that installs the recipe by calling therecipe.yml
file directly from Github.
Example:
# main.tf Terraform file that deploys GCP VM via the GCP VM Module
# Cloud-init file that calls Ansible playbook, see 'user_data' below
data "template_file" "user_data" {
template = file("./cloud_init.yml")
}
# GCP VM Module
module "linux_vm" {
source = "intel/gcp-vm/intel"
project = "123456789"
boot_image_project = "ubuntu-os-cloud"
boot_image_family = "ubuntu-2204-lts"
name = "gcp-linux-with-aikit"
zone = "us-central1-a"
access_config = [{
nat_ip = null
public_ptr_domain_name = null
network_tier = "PREMIUM"
}, ]
# Integration between Terraform and Cloud-init
user_data = data.template_file.user_data.rendered
}
# Cloud-init file that calls Ansible playbook
package_update: true
package_upgrade: true
package:
- git
ansible:
install_method: distro
package_name: ansible
pull:
url: "https://github.com/intel/optimized-cloud-recipes.git"
playbook_name: "recipes/ai-pytorch-amx-ubuntu/recipe.yml"
Follow Ansible installation procedures for your operating system
https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html
For example, on Ubuntu by using ansible-pull, Ansible can run directly on the host:
# Install Git
sudo apt install git -y
# Install Ansible Key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
sudo apt update
# Install Ansible
sudo apt install ansible -y
#Run ansible-pull
sudo ansible-pull -vv -U https://github.com/intel/optimized-cloud-recipes.git recipes/ai-pytorch-amx-ubuntu/recipe.yml
# Logs at 'tail -f 10 /var/ansible-log' & 'tail -f 10 /var/log/dpkg.log'
The repository structure is very simple. All recipes will be located under the ./recipes
folder.
The recipes folders are structured as <category>-<workload name>-<intel tech enabled>-<OS>
Categories are: ai, compute, data, media, ml, networking
Examples:
- ai-pytorch-amx-ubuntu
- networking-java-qat-ubuntu
- database-mysql-avx512-ubuntu
- database-mssql-qat-windows
See Usage -> Option 1 above
A diagram showcasing the integration is coming!
We recommend using a Linux environment. If on Windows, we recommend using WSL2.
You will only need git and Ansible installed on your development environment. Follow Ansible installation procedures for your operating system. https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html
For example, on Ubuntu:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
sudo apt update
sudo apt install git -y
sudo apt install ansible -y
Note: If you are an Intel® employee, reach out to the Repository Owners. We have additional environment configuration information that can help you.
Please see CONTRIBUTING.md
We are glad to review and accept contributions.
Today, the scope is limited to enabling/optimizing VMs on public cloud providers.
The OCRs are currently not managing on-prem physical hardware configurations.