-
Notifications
You must be signed in to change notification settings - Fork 819
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
Switch to parrallel execution of SDK commands #742
Conversation
Build Succeeded 👏 Build Id: 7ad13ad2-04bc-4cd2-ab8c-ea3826632791 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
2232de4
to
f5c26d1
Compare
I have added wait right after the loop, if one process fail we would get the error and a message. And tested errors scenario for instance if we add
Note that we only have one build.sh script (currently for cpp only). So running |
Build Succeeded 👏 Build Id: 7e353e99-3d43-45a1-bccf-099a02d6ae78 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 251a76ce-c16e-41a2-b6f0-d2e33abac867 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 41249e09-c5c0-498a-988c-e0461fdbf362 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
build/includes/sdk.mk
Outdated
@@ -55,17 +55,22 @@ gen-all-sdk-grpc: run-all-sdk-command | |||
gen-sdk-grpc: COMMAND := gen | |||
gen-sdk-grpc: run-sdk-command | |||
|
|||
# Runs a command on all supported languages, use COMMAND variable to select which command. | |||
# Runs a command on all supported languages in parallel, use COMMAND variable to select which command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about using native parallelism built into make:
run-all-sdk-command: run-sdk-command-go run-sdk-command-rust run-sdk-command-cpp
run-sdk-command-cpp:
$(MAKE) run-sdk-command SDK_FOLDER=cpp
run-sdk-command-rust:
$(MAKE) run-sdk-command SDK_FOLDER=rust
run-sdk-command-go:
$(MAKE) run-sdk-command SDK_FOLDER=go
Then the user can do make -j4 run-all-sdk-command COMMAND=gen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh that's a really interesting idea. I wonder if we could also come up with a pattern rule so we don't have to define each rule individually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That native way looks more natural and simple, updating this Pull Request, removing initial and next waiting for loop:
for job in `jobs -p` ; \
do \
wait $$job || let "FAIL+=1"; \
done ; \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkowalski
The only thing that we don't have build.sh in each directory, that's why we have such check that file exists:
if [ "$${d%?}" != "tool" ] && [ -f $$d/$(COMMAND).sh ];
/cc @Kuqd any thoughts? |
68b65f8
to
9cab1b0
Compare
Build Succeeded 👏 Build Id: d1ff4a7e-44c2-451d-a5b9-50004a0f2508 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 4c207497-f260-46fc-983c-fdf77a407093 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Updated cloudbuild-yaml also. Now if I run:
|
Combine multiple targets into one `run-all-sdk-command` make target. Now we can run make -j 2 test-sdks.
9cab1b0
to
2e1a2cb
Compare
Build Succeeded 👏 Build Id: 94f5a06c-a30c-44c2-888e-8575ad434dbe The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Use subshell execution of the
run-all-sdk-command
make target.