Skip to content

Commit

Permalink
General code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Barfy007JB1 committed Dec 11, 2024
1 parent 6c47bc2 commit f14dce5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
8 changes: 3 additions & 5 deletions AnsiblePlaybooks/meerkat/roles/setup_iris/files/get-iris.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ if lspci | grep -i 'vga\|3d\|display' > /dev/null; then

# Set up benchmark enviroment

#Expected run location
mkdir /home/<user>
cd /home/<user>

git clone https://github.com/Chris-green-stfc/iris-bench.git

# Expected run location: /home/<user>

cd iris-gpubench

sudo groupadd docker
Expand All @@ -32,7 +30,7 @@ if lspci | grep -i 'vga\|3d\|display' > /dev/null; then

./dockerfiles/build_images.sh

./setup_vm_docker.sh
./setup_vm_docker.sh

else
echo "GPU benchmarking skipped: No GPU detected"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/bin/bash

data_file="matrics.yml"
DB="https://{{ db_ip }}:{{ db_port }}/write"
server_UUID=$(curl http://169.254.169.254/openstack/latest/meta_data.json -s | grep -ioP .{8}-.{4}-.{4}-.{4}-.{12})
vm_info=$(openstack server show $server_UUID --os-cloud openstack)
flavor=$(echo $vm_info | grep -ioP "flavor\s\|\s\S*" | cut -c 10-)
image=$(echo $vm_info | grep -ioP "image\s\|\s\S*" | cut -c 9-)

run_benchmark () {
echo -------------------------------------------------------
Expand All @@ -17,8 +12,8 @@ run_benchmark () {
}

send_data () {
curl -H "Authorization: Basic `echo -n "{{ db_username }}:{{ db_password }}" | base64`" -d 'gpu_benchmark,image='"$image"',flavor='"$flavor"',test_type='$benchmark' 'result'='"$bench_score"'' -X POST $DB --insecure
curl -H "Authorization: Basic `echo -n "{{ db_username }}:{{ db_password }}" | base64`" -d 'gpu_benchmark,image='"$image"',flavor='"$flavor"',test_type='${benchmark} Emisions' 'result'='"$gpu_emisions_"'' -X POST $DB --insecure
curl -H "Authorization: Basic `echo -n "{{ db_username }}:{{ db_password }}" | base64`" -d 'gpu_benchmark,image='"$image"',flavor='"$flavor"',test_type='$benchmark' 'result'='"$bench_score"'' -X POST $DB
curl -H "Authorization: Basic `echo -n "{{ db_username }}:{{ db_password }}" | base64`" -d 'gpu_benchmark,image='"$image"',flavor='"$flavor"',test_type='${benchmark} Emisions' 'result'='"$gpu_emisions_"'' -X POST $DB
}

read_data () {
Expand All @@ -39,8 +34,8 @@ benchmark_and_send_data () {
server_UUID=$(curl http://169.254.169.254/openstack/latest/meta_data.json -s | grep -ioP .{8}-.{4}-.{4}-.{4}-.{12})
vm_info=$(openstack server show $server_UUID --os-cloud openstack)
hypervisor=$(echo $vm_info | grep -ioP "\w*.nubes.rl.ac.uk" | head -1)
flavor=$(echo $vm_info | grep -ioP "flavor\s\|\s\S*" | cut -c 10-)
image=$(echo $vm_info | grep -ioP "image\s\|\s\S*" | cut -c 9-)
flavor="{{ flavor }}"
image="{{ image }}"

DB="https://{{ db_ip }}:{{ db_port }}/write"

Expand Down

0 comments on commit f14dce5

Please sign in to comment.