Skip to content

Commit

Permalink
Show hhvm-perf version in PKB log (GoogleCloudPlatform#109)
Browse files Browse the repository at this point in the history
Git clone hhvm-perf so that version can be found and displayed. Fall back to curl if git fails.
  • Loading branch information
Papa, Florin authored and harp-intel committed Mar 14, 2019
1 parent de9b52a commit 8d0bcf9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ The path to these commands should be

`C:\\Users\\\<user\>\\AppData\\Local\\GitHub\\PortableGit\_\<guid\>\\bin`

## (*Linux Only*) Install git
In most recent Linux distributions, git can be installed using the distribution's package manager. Please see the
[Git Download page](https://git-scm.com/download/linux) for more information.

## Install PerfKit

[Download PerfKit Benchmarker](http://github.com/GoogleCloudPlatform/PerfKitBenchmarker/releases) from GitHub.
Expand Down
33 changes: 20 additions & 13 deletions perfkitbenchmarker/linux_packages/intel_hhvm_provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from perfkitbenchmarker import data, vm_util
from perfkitbenchmarker.linux_packages import INSTALL_DIR

HHVM_PERF_URL = ('https://github.intel.com/dslo/hhvm-perf/'
HHVM_PERF_URL_GIT = ('https://github.intel.com/DSLO/hhvm-perf.git')
HHVM_PERF_URL_CURL = ('https://github.intel.com/dslo/hhvm-perf/'
'archive/master.tar.gz')
HHVM_PROV_URL = ('https://github.intel.com/dslo/hhvm_provisioning/'
'archive/master.tar.gz')
Expand Down Expand Up @@ -73,19 +74,25 @@ def Install(vm):
if not onPrem(vm):
# get hhvm-perf and copy to hhvm_provisioning dir structure
perf_path = vm_util.PrependTempDir('hhvm-perf.tar.gz')
cmds = [['curl',
'-SL', '--noproxy', 'github.intel.com',
HHVM_PERF_URL,
'-o', perf_path],
# extract tarball so we can rename root dir to 'hhvm-perf'
['tar', '-C', vm_util.GetTempDir(), '-xvf', perf_path],
['mv', vm_util.PrependTempDir('hhvm-perf-master'),
vm_util.PrependTempDir('hhvm-perf')],
['rm', '-r', perf_path]
]
for cmd in cmds:
try:
vm_util.IssueCommand(['git',
'clone',
'--depth=1',
HHVM_PERF_URL_GIT,
vm_util.PrependTempDir('hhvm-perf')])
except:
cmds = [['curl',
'-SL', '--noproxy', 'github.intel.com',
HHVM_PERF_URL_CURL,
'-o', perf_path],
# extract tarball so we can rename root dir to 'hhvm-perf'
['tar', '-C', vm_util.GetTempDir(), '-xvf', perf_path],
['mv', vm_util.PrependTempDir('hhvm-perf-master'),
vm_util.PrependTempDir('hhvm-perf')],
['rm', '-r', perf_path]
]
for cmd in cmds:
vm_util.IssueCommand(cmd)

# set the cwd to 'tempdir' for this command so the tarball won't preserve
# the entire dir structure
vm_util.IssueCommand(['tar', '-czvf', perf_path, 'hhvm-perf'],
Expand Down

0 comments on commit 8d0bcf9

Please sign in to comment.