Skip to content
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

Feature: Added creating of Directed Acyclic Graphs (DAG) to existing DAG Driver #433

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NotAnAddictz
Copy link
Contributor

Summary

Previously, in PR #383 , we added functionality for sequential invocation for each function. This commit adds on to this existing feature, making every function act as an entry point and create a DAG structure for each function based on the width and depth distributions in data/traces/example/dag_structure.xlsx and invoke it according to the frequency of the entry functions.

Implementation Notes ⚒️

  • Added various helper functions to create and manage the DAG structure.
  • Added functionality to download the sampled_150 folder containing the folders for each group of functions if required.
  • Tweaked the generation of specifications for each function to cover the highest possible invocation frequencies/min
  • Wrapped the functions into Nodes to facilitate DAG generation
  • Added parameter entriesWritten to functionsDriver to ensure all invocations are written in the output file
  • Added a retry limit of 1 for each function in the DAG.
    image
  • All DAG Structures will not have duplicate functions inside it, and is populated by randomly chosen functions in the function list.

External Dependencies 🍀

  • N/A

Breaking API Changes ⚠️

  • N/A

Simply specify none (N/A) if not applicable.

@cvetkovic
Copy link
Contributor

@leokondrashov: Is this still relevant or we close this PR?

@wanghanchengchn
Copy link
Contributor

@leokondrashov: Is this still relevant or we close this PR?

I apologize for the late reply. I will review this pull request!

@wanghanchengchn
Copy link
Contributor

Dear @cvetkovic,

The current version looks good to me. However, due to my limited experience in reviewing pull requests, I would greatly appreciate it if you could provide us with some feedback when you have a moment. Thank you very much!

cmd/loader.go Show resolved Hide resolved
cmd/loader.go Outdated
Comment on lines 202 to 214
func getTrace() bool {
_, err := exec.Command("git", "lfs", "pull").CombinedOutput()
if err != nil {
log.Warnf("Failed to get traces")
return false
}
_, err = exec.Command("tar", "-xzf", "data/traces/reference/sampled_150.tar.gz", "-C", "data/traces").CombinedOutput()
if err != nil {
log.Warnf("Failed to extract sample")
return false
}
return true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be git and tar commands should be part of the the loader. The user should be responsible for making sure these files exist and are in proper format.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no proprietary formats. Use CSV.

Comment on lines 59 to 62
DAGTracePath string `json:"DAGTracePath"`
EnableDAGDataset bool `json:"EnableDAGDataset"`
Width int `json:"Width"`
Depth int `json:"Depth"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent properly.

pkg/driver/trace_driver.go Show resolved Hide resolved
Signed-off-by: Kway Yi Shen <[email protected]>
Signed-off-by: Kway Yi Shen <SamKway@localhost>
Signed-off-by: Kway Yi Shen <[email protected]>
Copy link
Contributor

@cvetkovic cvetkovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @leokondrashov If good, you can proceed with merging.

@cvetkovic
Copy link
Contributor

@wanghanchengchn Just fix the errors linter reports.

@wanghanchengchn
Copy link
Contributor

Thank you! Dear @NotAnAddictz, could you please address the failed checks? Additionally, this branch is out-of-date with the base branch. Kindly rebase on the main branch and verify that all checks are passing. Thank you!

Copy link
Contributor

@leokondrashov leokondrashov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me codewise. But I'd like to have documentation for the feature in the repo, not only in the PR description.

I think the linter problem is not caused by you, but it's easy to fix by changing Fatalf to Fatal.

@@ -21,5 +21,9 @@

"GRPCConnectionTimeoutSeconds": 15,
"GRPCFunctionTimeoutSeconds": 900,
"DAGMode": false
"DAGMode": false,
"DAGTracePath": "data/traces/sampled_150/20",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this file exist by default?

@@ -19,7 +19,12 @@
| MetricScrapingPeriodSeconds | int | > 0 | 15 | Period of Prometheus metrics scrapping |
| GRPCConnectionTimeoutSeconds | int | > 0 | 60 | Timeout for establishing a gRPC connection |
| GRPCFunctionTimeoutSeconds | int | > 0 | 90 | Maximum time given to function to execute[^4] |
| DAGMode | bool | true/false | false | Sequential invocation of all functions one after another |
| DAGMode | bool | true/false | false | Parallel invocation of DAG with each function acting as entry function |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is okay for the description of the config option, but we need proper documentation of this feature in the docs. Please consider writing down the generation and invocation processes of the DAG so the user can understand the output results without looking at the code.

@@ -19,7 +19,12 @@
| MetricScrapingPeriodSeconds | int | > 0 | 15 | Period of Prometheus metrics scrapping |
| GRPCConnectionTimeoutSeconds | int | > 0 | 60 | Timeout for establishing a gRPC connection |
| GRPCFunctionTimeoutSeconds | int | > 0 | 90 | Maximum time given to function to execute[^4] |
| DAGMode | bool | true/false | false | Sequential invocation of all functions one after another |
| DAGMode | bool | true/false | false | Parallel invocation of DAG with each function acting as entry function |
| DAGTracePath | string | string | data/traces/sampled_150/20 | Folder with Azure trace dimensions used for DAG Invocation. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a reference to the trace. It can be located with the rest of the docs (see other comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants