Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

ClearLinux Support #2

Merged
merged 18 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
vagrant/.vagrant
vagrant/inventory/artifacts/
vagrant/inventory/group_vars/all.yml
vagrant/inventory/
vagrant/roles
qat*.tar.gz
*.retry
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.envoy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM debian:sid as builder

ADD qat1.7.l.4.3.0-00033.tar.gz .
electrocucaracha marked this conversation as resolved.
Show resolved Hide resolved
ADD qat1.7.l.4.4.0-00023.tar.gz .
electrocucaracha marked this conversation as resolved.
Show resolved Hide resolved
ADD openssl openssl
ADD QAT_Engine QAT_Engine
ADD envoy envoy
Expand Down
15 changes: 15 additions & 0 deletions vagrant/ClearLinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2019 Intel Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
qat_driver_pkgs:
- linux-lts2018-dev
mythi marked this conversation as resolved.
Show resolved Hide resolved
- make
- c-basic
- dev-utils
- devpkg-systemd
9 changes: 9 additions & 0 deletions vagrant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ Kubernetes cluster using the following instruction:

$ vagrant up

## Enable Grafana Dashboard

The [sample_plugin.sh](sample_plugin.sh) bash script installs and
configures a grafana dashboard which makes easier to compare the
request per second and request duration results of a single Nginx
server that is using QAT.

![Grafana Dashboard](img/grafana_dashboard.png)

## License

Apache-2.0
Expand Down
63 changes: 48 additions & 15 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,87 @@
##############################################################################

box = {
:virtualbox => { :name => 'generic/centos7', :version=> '1.9.2' },
:libvirt => { :name => 'centos/7', :version=> '1901.01' }
:virtualbox => {
:centos => { :name => 'generic/centos7', :version=> '1.9.2' },
:clearlinux => { :name => 'AntonioMeireles/ClearLinux', :version=> '28510' }
},
:libvirt => {
:centos => { :name => 'centos/7', :version=> '1901.01' },
:clearlinux => { :name => 'AntonioMeireles/ClearLinux', :version=> '28510' }
}
}

if ENV['no_proxy'] != nil or ENV['NO_PROXY']
$no_proxy = ENV['NO_PROXY'] || ENV['no_proxy'] || "127.0.0.1,localhost"
$subnet = "192.168.121"
# NOTE: This range is based on vagrant-libvirt network definition CIDR 192.168.121.0/27
$subnet = "192.168.123"
# NOTE: This range is based on vagrant-libvirt network definition CIDR 192.168.123.0/27
(1..31).each do |i|
$no_proxy += ",#{$subnet}.#{i}"
end
$no_proxy += ",qat-demo-server,10.0.2.15"
end

container_manager = (ENV['QAT_CONTAINER_MANAGER'] || :docker).to_sym
distro = (ENV['QAT_DISTRO'] || :centos).to_sym
vagrant_root = File.dirname(__FILE__)
vagrant_root.slice! "vagrant"
puts "[INFO] Shared folder: #{vagrant_root}"
puts "[INFO] Linux Distro: #{distro}"
puts "[INFO] Container manager: #{container_manager}"

Vagrant.configure("2") do |config|
config.vm.provider :libvirt
config.vm.provider :virtualbox
config.vm.synced_folder '../', "#{vagrant_root}", create: true
config.vm.hostname = "qat-demo-server"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.synced_folder '../', "#{vagrant_root}", create: true,
rsync__args: ["--verbose", "--archive", "--delete", "-z"]
config.vm.provision "shell", inline: <<-SHELL
source /etc/os-release || source /usr/lib/os-release
case ${ID,,} in
clear-linux-os)
mkdir -p /etc/kernel/{cmdline.d,cmdline-removal.d}
echo "module.sig_unenforce" | sudo tee /etc/kernel/cmdline.d/allow-unsigned-modules.conf
echo "intel_iommu=igfx_off" | sudo tee /etc/kernel/cmdline-removal.d/disable-iommu.conf
clr-boot-manager update
sudo mkdir -p /etc/systemd/resolved.conf.d
printf "[Resolve]\nDNSSEC=false" | sudo tee /etc/systemd/resolved.conf.d/dnssec.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? Clear's systemd is built using -Ddefault-dnssec=no

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, maybe it's related to the Intel's network but if I don't manually disable I get timeouts.

Copy link
Contributor

@mythi mythi Jun 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the vagrant image have the latest systemd from Clear? See clearlinux-pkgs/systemd@f748d5d

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some issues before trying to use the latest CLR image but maybe I can give another try

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope :( I'm going to keep trying to see if I can make it work.

Copy link
Contributor

@mythi mythi Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps not spend too much time on it now. It can be dropped later when it works.

;;
esac
SHELL
config.vm.provision :reload
config.vm.provision 'shell', privileged: false do |sh|
sh.env = {
'JENKINS_HOME': '/home/vagrant'
'CONTAINER_MANAGER': "#{container_manager}"
}
sh.inline = <<-SHELL
echo "export CONTAINER_MANAGER=$CONTAINER_MANAGER" >> ~/.bashrc
cd #{vagrant_root}
sed -ri "s|^qat_envoy_dest:.*$|qat_envoy_dest: \"$(pwd)\"|g" ./vagrant/krd-vars.yml
cd ./vagrant/
./installer.sh | tee installer.log
SHELL
end
[:virtualbox, :libvirt].each do |provider|
config.vm.provider provider do |p, override|
p.cpus = 6
p.memory = 8192
end
end

config.vm.provider :virtualbox do |v, override|
override.vm.box = box[:virtualbox][:name]
override.vm.box_version = box[:virtualbox][:version]
v.customize ["modifyvm", :id, "--memory", 8192]
v.customize ["modifyvm", :id, "--cpus", 4]
override.vm.box = box[:virtualbox][distro][:name]
override.vm.box_version = box[:virtualbox][distro][:version]
end

config.vm.provider :libvirt do |v, override|
override.vm.box = box[:libvirt][:name]
override.vm.box_version = box[:libvirt][:version]
v.memory = 32768
v.cpus = 16
override.vm.box = box[:libvirt][distro][:name]
override.vm.box_version = box[:libvirt][distro][:version]
v.nested = true
v.cpu_mode = 'host-passthrough'
v.management_network_address = "192.168.121.0/27"
v.management_network_address = "192.168.123.0/27"
v.management_network_name = "qat-mgmt-net"
v.random_hostname = true
end

if ENV['http_proxy'] != nil and ENV['https_proxy'] != nil
Expand Down
Loading