Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdworkin committed Jul 26, 2023
1 parent 909e8c3 commit 7ff2f4c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 18 deletions.
14 changes: 1 addition & 13 deletions contrib/intel/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,7 @@ pipeline {
stage('parallel-tests') {
when { equals expected: 1, actual: DO_RUN }
parallel {
stage ('oneCCL-GPU-v3') {
agent { node { label 'ze' } }
options { skipDefaultCheckout() }
steps {
script {
dir ("${env.WORKSPACE}/${SCRIPT_LOCATION}/") {
run_middleware([["verbs", "rxm"]], "oneCCL-GPU", "onecclgpu",
"fabrics-ci", "2")
}
}
}
}
stage ('DMABUF-Tests') {
stage ('DMABUF-Tests') {
agent { node { label 'ze' } }
options { skipDefaultCheckout() }
steps {
Expand Down
51 changes: 51 additions & 0 deletions contrib/intel/jenkins/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import collections
import subprocess
from subprocess import Popen, TimeoutExpired
from time import sleep
import sys
import os

Expand All @@ -21,6 +23,55 @@ def run_command(command):
print("exiting with " + str(p.poll()))
sys.exit(p.returncode)

def read_file(file_name):
with open(file_name) as file_out:
output = file_out.read()
return output

class ClientServerTest:
def __init__(self, server_cmd, client_cmd, server_log, client_log,
timeout=None):
self.server_cmd = server_cmd
self.client_cmd = client_cmd
self.server_log = server_log
self.client_log = client_log
self._timeout = timeout

def run(self):
# start running
server_process = Popen(
f"{self.server_cmd} > {self.server_log} 2>&1",
shell=True, close_fds=True
)
sleep(1)
client_process = Popen(
f"{self.client_cmd} > {self.client_log} 2>&1",
shell=True, close_fds=True
)

try:
server_process.wait(timeout=self._timeout)
except TimeoutExpired:
server_process.terminate()

try:
client_process.wait(timeout=self._timeout)
except TimeoutExpired:
client_process.terminate()

server_output = read_file(self.server_log)
client_output = read_file(self.client_log)

print("")
print(f"server_command: {self.server_cmd}")
print('server_stdout:')
print(server_output)
print(f"client_command: {self.client_cmd}")
print('client_stdout:')
print(client_output)

return (server_process.returncode, client_process.returncode)

Prov = collections.namedtuple('Prov', 'core util')
prov_list = [
Prov('psm3', None),
Expand Down
10 changes: 5 additions & 5 deletions contrib/intel/jenkins/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,11 +1068,11 @@ def execute_cmd(self, test_type):
else:
command = f"{server_cmd} "
client_command = f"{server_cmd} -t {test} {self.server} "
outputcmd = shlex.split(command)
client_outputcmd = shlex.split(client_command)
common.run_command(outputcmd)
time.sleep(1)
common.run_command(client_outputcmd)

common.ClientServerTest(
command, client_command,
f"{os.environ['LOG_DIR']}/server.log",
f"{os.environ['LOG_DIR']}/client.log", 300).run()
print("--------------------TEST COMPLETED----------------------")

os.chdir(curr_dir)

0 comments on commit 7ff2f4c

Please sign in to comment.