Skip to content

Remove serving model log #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 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
20 changes: 12 additions & 8 deletions pkg/operator/workloads/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func ReadLogs(appName string, podSearchLabels map[string]string, verbose bool, s
}

if !wrotePending {
if !writeSocket("\nPending", socket) {
if !writeSocket("\nPending...", socket) {
return
}
wrotePending = true
Expand All @@ -138,9 +138,10 @@ func getKubectlLogs(pods []kcore.Pod, verbose bool, wrotePending bool, previous
}

if isAllPending {
if !writeSocket("\nPending", socket) {
if !writeSocket("\nPending...", socket) {
return
}
wrotePending = true
}
}

Expand All @@ -154,7 +155,7 @@ func getKubectlLogs(pods []kcore.Pod, verbose bool, wrotePending bool, previous
podCheckCancel := make(chan struct{})
defer close(podCheckCancel)

go podCheck(podCheckCancel, socket, pods, previous, verbose, inr)
go podCheck(podCheckCancel, socket, pods, previous, verbose, wrotePending, inr)
pumpStdin(socket, inw)
podCheckCancel <- struct{}{}
}
Expand Down Expand Up @@ -186,7 +187,7 @@ func startKubectlProcess(pod kcore.Pod, previous bool, attrs *os.ProcAttr) (*os.
return process, nil
}

func podCheck(podCheckCancel chan struct{}, socket *websocket.Conn, initialPodList []kcore.Pod, previous bool, verbose bool, inr *os.File) {
func podCheck(podCheckCancel chan struct{}, socket *websocket.Conn, initialPodList []kcore.Pod, previous bool, verbose bool, wrotePending bool, inr *os.File) {
timer := time.NewTimer(0)
defer timer.Stop()

Expand Down Expand Up @@ -266,6 +267,13 @@ func podCheck(podCheckCancel chan struct{}, socket *websocket.Conn, initialPodLi
maxPodsToAdd = len(podsToAdd)
}

if wrotePending && len(latestRunningPods) > 0 {
if !writeSocket("Streaming logs:", socket) {
return
}
wrotePending = false
}

for _, podName := range podsToAdd[:maxPodsToAdd] {
process, err := startKubectlProcess(latestRunningPodsMap[podName], previous, &os.ProcAttr{
Files: []*os.File{inr, outw, outw},
Expand Down Expand Up @@ -453,10 +461,6 @@ func extractFromCortexLog(match string, loglevel string, logStr string) (*string
return formatHeader3(cutStr), false
}

if strings.HasPrefix(cutStr, "Serving model") {
return formatHeader3(cutStr), false
}

if strings.HasPrefix(cutStr, "Prediction failed") {
return formatHeader2(cutStr), false
}
Expand Down
1 change: 0 additions & 1 deletion pkg/workloads/cortex/onnx_serve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ def start(args):
local_cache["sess"] = sess
local_cache["input_metadata"] = sess.get_inputs()
local_cache["output_metadata"] = sess.get_outputs()
logger.info("Serving model: {}".format(util.remove_resource_ref(api["model"])))
except CortexException as e:
e.wrap("error")
logger.error(str(e))
Expand Down
1 change: 0 additions & 1 deletion pkg/workloads/cortex/tf_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ def start(args):

time.sleep(1)

logger.info("Serving model: {}".format(util.remove_resource_ref(api["model"])))
serve(app, listen="*:{}".format(args.port))


Expand Down