-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding start of predictors (symbolator and actual)
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
381 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
[ | ||
{ | ||
"binaries": [ | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-7ybfviq4uauvq4hhggxn3npc6ib4clr3/bin/curl" | ||
], | ||
"predictions": { | ||
"actual": [ | ||
{ | ||
"message": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\nHTTP/1.1 403 Forbidden\r\nDate: Sat, 04 Dec 2021 01:07:32 GMT\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: close\r\nCF-Chl-Bypass: 1\r\nPermissions-Policy: accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()\r\nCache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\nExpires: Thu, 01 Jan 1970 00:00:01 GMT\r\nX-Frame-Options: SAMEORIGIN\r\nExpect-CT: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"\r\nReport-To: {\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=7qbpxfTO2iFvTK6xWWcdT7JXLgStMWxeykf2sFLxpAjJSLvAULQJNMvLfLpgyjPxIM8Vw9TRr2DNlkfmKfmZhlXrMHYSWDzJpTi4lW6i7cXwmYINMnNgghJYEctQMw8R7krO0LFNOO8FEw%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}\r\nNEL: {\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}\r\nStrict-Transport-Security: max-age=15552000; includeSubDomains; preload\r\nX-Content-Type-Options: nosniff\r\nServer: cloudflare\r\nCF-RAY: 6b812372aac4638a-ORD\r\nalt-svc: h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400, h3-28=\":443\"; ma=86400, h3-27=\":443\"; ma=86400\r\n\r\n", | ||
"return_code": 0, | ||
"prediction": true, | ||
"command": "/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-7ybfviq4uauvq4hhggxn3npc6ib4clr3/bin/curl --head https://linuxize.com/" | ||
} | ||
], | ||
"symbolator": { | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-7ybfviq4uauvq4hhggxn3npc6ib4clr3/bin/curl": { | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/zlib-1.2.11-3kmnsdv36qxm3slmcyrb326gkghsp6px/lib/libz.so.1.2.11": true | ||
} | ||
} | ||
}, | ||
"libs": [ | ||
{ | ||
"dep": "zlib@1.2.11%gcc@9.3.0+optimize+pic+shared arch=linux-ubuntu20.04-skylake", | ||
"paths": [ | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/zlib-1.2.11-3kmnsdv36qxm3slmcyrb326gkghsp6px/lib/libz.so.1.2.11" | ||
] | ||
} | ||
], | ||
"experiment": null, | ||
"result": "splice-success", | ||
"success": true, | ||
"splice": "zlib@1.2.11", | ||
"package": "curl@7.50.2" | ||
}, | ||
{ | ||
"binaries": [ | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-uyqxrcmgypzjxolcxsfrkjtvbptcoeud/bin/curl" | ||
], | ||
"predictions": { | ||
"actual": [ | ||
{ | ||
"message": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\nHTTP/1.1 403 Forbidden\r\nDate: Sat, 04 Dec 2021 01:07:33 GMT\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: close\r\nCF-Chl-Bypass: 1\r\nPermissions-Policy: accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()\r\nCache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\nExpires: Thu, 01 Jan 1970 00:00:01 GMT\r\nX-Frame-Options: SAMEORIGIN\r\nExpect-CT: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"\r\nReport-To: {\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=rNqO6HRZsOL3%2F7JIX077X%2BQ%2B2gdKkpAaex%2FBYQlO4i46JJ%2Fr5B1Dg34z6%2FBmY%2F%2BQJCQYabk9Gx1Xecv8oXgmh5ev3t%2BTTDgiHLNDAaFZHYbi4FsozTL9a1%2F%2F4aUxmbzQlWs3%2Biphc42xpg%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}\r\nNEL: {\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}\r\nStrict-Transport-Security: max-age=15552000; includeSubDomains; preload\r\nX-Content-Type-Options: nosniff\r\nServer: cloudflare\r\nCF-RAY: 6b8123738dbe2c11-ORD\r\nalt-svc: h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400, h3-28=\":443\"; ma=86400, h3-27=\":443\"; ma=86400\r\n\r\n", | ||
"return_code": 0, | ||
"prediction": true, | ||
"command": "/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-uyqxrcmgypzjxolcxsfrkjtvbptcoeud/bin/curl --head https://linuxize.com/" | ||
} | ||
], | ||
"symbolator": { | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-uyqxrcmgypzjxolcxsfrkjtvbptcoeud/bin/curl": { | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/zlib-1.2.8-mtdthhgpvdcqsfmbqzzvdlvain56j6th/lib/libz.so.1.2.8": true | ||
} | ||
} | ||
}, | ||
"libs": [ | ||
{ | ||
"dep": "zlib@1.2.8%gcc@9.3.0+optimize+pic+shared arch=linux-ubuntu20.04-skylake", | ||
"paths": [ | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/zlib-1.2.8-mtdthhgpvdcqsfmbqzzvdlvain56j6th/lib/libz.so.1.2.8" | ||
] | ||
} | ||
], | ||
"experiment": null, | ||
"result": "splice-success", | ||
"success": true, | ||
"splice": "zlib@1.2.8", | ||
"package": "curl@7.50.2" | ||
}, | ||
{ | ||
"binaries": [ | ||
"/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-6wfkzljni43ly6uh3ocgotxgrlq5b347/bin/curl" | ||
], | ||
"predictions": { | ||
"actual": [ | ||
{ | ||
"message": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\nHTTP/1.1 403 Forbidden\r\nDate: Sat, 04 Dec 2021 01:07:33 GMT\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: close\r\nCF-Chl-Bypass: 1\r\nPermissions-Policy: accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()\r\nCache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\nExpires: Thu, 01 Jan 1970 00:00:01 GMT\r\nX-Frame-Options: SAMEORIGIN\r\nExpect-CT: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"\r\nReport-To: {\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=3%2BztzQcSul%2BM%2F0TX716OuDtoSHRsyYSLG4qpGr946MviZ4Re9N8%2BUCxnT0Gz8%2BfSe5ShCTuIffaM4gB5%2FZJPPJvc0rb%2F9nTANKNscCroZ%2FVNStPnNz0Ud3lFv3%2FqM54lej%2FL%2FOl0VAUh0Q%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}\r\nNEL: {\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}\r\nStrict-Transport-Security: max-age=15552000; includeSubDomains; preload\r\nX-Content-Type-Options: nosniff\r\nServer: cloudflare\r\nCF-RAY: 6b8123746e216327-ORD\r\nalt-svc: h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400, h3-28=\":443\"; ma=86400, h3-27=\":443\"; ma=86400\r\n\r\n", | ||
"return_code": 0, | ||
"prediction": true, | ||
"command": "/home/vanessa/Desktop/Code/spack-vsoch/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/curl-7.50.2-6wfkzljni43ly6uh3ocgotxgrlq5b347/bin/curl --head https://linuxize.com/" | ||
} | ||
] | ||
}, | ||
"libs": [ | ||
{ | ||
"dep": "zlib@1.2.3%gcc@9.3.0+optimize+pic+shared arch=linux-ubuntu20.04-skylake", | ||
"paths": [] | ||
} | ||
], | ||
"experiment": null, | ||
"result": "splice-success", | ||
"success": true, | ||
"splice": "zlib@1.2.3", | ||
"package": "curl@7.50.2" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from .base import Prediction, Actual | ||
from .symbolator import SymbolatorPrediction | ||
|
||
|
||
def get_predictors(names=None): | ||
""" | ||
Get a lookup of predictors for an experiment to run. | ||
""" | ||
names = names or [] | ||
predictors = {"actual": Actual(), "symbolator": SymbolatorPrediction()} | ||
if names: | ||
keepers = {} | ||
for name, predictor in predictors.items(): | ||
if name in names: | ||
keepers[name] = predictor | ||
predictors = keepers | ||
return predictors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
from spliced.logger import logger | ||
import spliced.utils as utils | ||
|
||
import shlex | ||
import os | ||
import re | ||
|
||
|
||
class Prediction: | ||
""" | ||
A prediction is a base for assessing a Splice and making predictions. | ||
""" | ||
|
||
def predict(self, splice): | ||
raise NotImplementedError | ||
|
||
def __str__(self): | ||
return str(self.__class__.__name__) | ||
|
||
|
||
class Actual(Prediction): | ||
""" | ||
Given a splice result with a command, get an actual result. | ||
""" | ||
|
||
def predict(self, splice): | ||
if not splice.command: | ||
return | ||
|
||
# Check each binary to match the command | ||
executable = shlex.split(splice.command)[0] | ||
results = [] | ||
for binary in splice.binaries: | ||
if binary.endswith(executable): | ||
cmd = "%s%s%s" % (os.path.dirname(binary), os.path.sep, splice.command) | ||
res = utils.run_command(cmd) | ||
res["prediction"] = True if res["return_code"] == 0 else False | ||
res["command"] = cmd | ||
results.append(res) | ||
|
||
splice.predictions["actual"] = results |
Oops, something went wrong.