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

Bazelize bazel-bench #13

Merged
merged 16 commits into from
May 9, 2019
Merged

Bazelize bazel-bench #13

merged 16 commits into from
May 9, 2019

Conversation

joeleba
Copy link
Member

@joeleba joeleba commented May 8, 2019

What this PR does and why we need it:

This PR enables the use of Bazel to build & test bazel-bench.

New changes / Issues that this PR fixes:

  • Added various build/test targets.
  • Updated README to reflect this big change.

Special notes for reviewer:

If possible, try to clone and set up the project from scratch.

Does this require a change in the script's interface or the BigQuery's table structure?

No

@joeleba joeleba requested a review from meisterT May 8, 2019 18:12
Copy link
Member

@meisterT meisterT left a comment

Choose a reason for hiding this comment

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

I get:
DEBUG: Rule 'io_bazel_rules_python' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1551999322 -0500"

and three failing tests (the build succeeds). Is that expected?

BUILD Outdated Show resolved Hide resolved
BUILD Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
WORKSPACE Outdated Show resolved Hide resolved
utils/BUILD Outdated Show resolved Hide resolved
utils/bazel_test.py Outdated Show resolved Hide resolved
@Globegitter
Copy link

Not sure if these BUILD files where generated by hand, but I had success using https://github.com/tuomasr/pazel to generate optimal BUILD files for me (sometimes with a little bit of hand tweaking afterwards). Also there are alternative rules to interact with pip: https://github.com/apt-itude/rules_pip. They support sub-dependency locking out of the box, could be worth giving a shot. Anyway, just my two cents, feel free to ignore.

Copy link
Member Author

@joeleba joeleba left a comment

Choose a reason for hiding this comment

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

I've made some changes. You shouldn't need pip and virtualenv now. Just bazel.

BUILD Outdated Show resolved Hide resolved
WORKSPACE Outdated Show resolved Hide resolved
utils/BUILD Outdated Show resolved Hide resolved
@joeleba
Copy link
Member Author

joeleba commented May 9, 2019

Not sure if these BUILD files where generated by hand, but I had success using https://github.com/tuomasr/pazel to generate optimal BUILD files for me (sometimes with a little bit of hand tweaking afterwards). Also there are alternative rules to interact with pip: https://github.com/apt-itude/rules_pip. They support sub-dependency locking out of the box, could be worth giving a shot. Anyway, just my two cents, feel free to ignore.

@Globegitter thanks for the recommendation! Yes, those were generated by hand.

@joeleba joeleba requested a review from meisterT May 9, 2019 12:06
@@ -73,6 +72,8 @@ def upload_csv(csv_file_path, bigquery_cfg):
bigquery_cfg: The string representing the BigQuery table config. Comes in
the form <dataset_id>:<table_id>:<location>
"""
from google.cloud import bigquery
Copy link
Member

Choose a reason for hiding this comment

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

What's the motivation to move this import down here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a workaround of bazelbuild/rules_python#14 for bazel test to work.

@joeleba joeleba merged commit e8bcc64 into master May 9, 2019
@joeleba joeleba deleted the bazelize branch May 9, 2019 12:48
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.

3 participants