Skip to content

Conversation

@jyane
Copy link
Member

@jyane jyane commented Jan 6, 2018

add bazel build checking to .travis.yml.

This PR's CI would be failed because protobuf's sha256 is incorrect.
When it (#3924) be merged, I will rebase this branch to pass CI.

This PR is partial fix for this issue: #3502

.travis.yml Outdated

script:
- ./gradlew check :grpc-all:jacocoTestReport
- bazel build //compiler:all //context:all //core:all //netty:all //okhttp:all //protobuf:all //protobuf-lite:all //protobuf-nano:all //stub:all //testing:all
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be //... right?

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

Choose a reason for hiding this comment

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

Slightly different and ... will unintentionally include //examples:all which is a non-target.

Copy link
Member

Choose a reason for hiding this comment

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

If examples is the only reason for the expansion, then we should subtract it out:

bazel build -- ... -examples/...

Also /... should be preferred to :all here, since there's no need to disable descending into subpackages (although they don't exist today).

Honestly, I would be okay with including the examples in this line. I know that users will see something slightly different since the WORKSPACE is handled differently, but building examples using its own WORKSPACE will rebuild everything a third time.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will change building each services to ....

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jan 8, 2018
@kokoro-team kokoro-team removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jan 8, 2018
@ejona86
Copy link
Member

ejona86 commented Jan 9, 2018

I think it may be better to use a matrix build (or similar) here. The bazel build takes 6 minutes, which is a third of the total time. A matrix build could run it in parallel.

@jyane
Copy link
Member Author

jyane commented Jan 9, 2018

Thank you for your comments!
I will change to use the parallel computing :)

Caching bazel artifacts is also probably needed.
But I think splitting PRs would be better because the caching might break CI (voilate/corrupt).

@jyane jyane force-pushed the add-bazel-checking-to-bazel branch from 49304b0 to 1d56ee4 Compare January 9, 2018 12:36
@jyane
Copy link
Member Author

jyane commented Jan 9, 2018

I have added matrix testing via my forked repository (jyane#1), but it is so dirty...

@jyane jyane force-pushed the add-bazel-checking-to-bazel branch from 52d5e74 to be89838 Compare January 9, 2018 13:52
@jyane jyane force-pushed the add-bazel-checking-to-bazel branch from be89838 to 9292ccb Compare January 9, 2018 14:00
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

I'm thinking it may be better to just do this as a kokoro job and leave travis as-is. I think with Kokoro we could probably do this in < 5 lines or some such. Let me see if I can cook this up quickly.

If we use travis with it, then I'd want the majority of commands for each stage to be in the same file. That could be aided by putting each stage's commands in a function. We could then also have a separate file for bazel vs gradle's functions.

@@ -1,43 +1,40 @@
sudo: false
sudo: required
Copy link
Member

Choose a reason for hiding this comment

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

Wait... how did it work before with sudo: false? I didn't look closely enough earlier to notice it was running dpkg. The need for sudo is why I didn't mess with this earlier; I'd rather not lose that. It looks like it is possible to install into the home directory though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know why...

addons:
apt:
packages:
- wget
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually necessary? We've already been using wget in make_dependencies.sh and the Travis documentation says wget is already installed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, it is an oversight...

@jyane
Copy link
Member Author

jyane commented Jan 9, 2018

Thank you for your comments and reviews.

I'm thinking it may be better to just do this as a kokoro job and leave travis as-is.

When I have seen this issue (#3502), I thought that want to add bazel build checking to kokoro.
But I (and not Googler) can not see kokoro and do not know APIs (I know it is actually jenkins), so I could not.
If I could, I did it in kokoro, because the above issue is for kokoro and kokoro is interesting for me.

I thought writing the CI codes in an opening way is helpful for contributors because contributors could know how to build and test.
Therefore I choose the travis.

@jyane
Copy link
Member Author

jyane commented Jan 9, 2018

Thank you very much for reviews and comments, @ejona86, c.arl-mastrangelo and d.apengzhang0.

Close this PR due to #3933

@jyane jyane closed this Jan 9, 2018
@jyane jyane deleted the add-bazel-checking-to-bazel branch January 9, 2018 17:39
@ejona86
Copy link
Member

ejona86 commented Jan 9, 2018

@jyane, I wasn't trying to criticize your decisions in the PR. Yes, my initial issue said Kokoro, but that wasn't a strong requirement. It actually pains me quite a bit how "blind" Kokoro is to external users. And, yes, lack of CI for Bazel has been creating problems and so a PR to add Travis testing for it is quite reasonable.

My preference is actually to do it in Travis as well, but I had anticipated some of the problems discussed here and thought Kokoro would be simpler. My main problem with Travis here is that it is a pain to have a completely different build[1]. Having 6 highly-coupled files would be unfortunate. I think there can be some acceptable organizations of the commands, but it seems like Kokoro is simple enough here to warrant accepting its limitations.

  1. This has been a problem for Android builds as well. We have to change the language to "android," and then the build wouldn't work on OS X.

@jyane
Copy link
Member Author

jyane commented Jan 10, 2018

Thank you for your comment, and I understand. Please don't care about me. You can always close my PR.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants