Skip to content

Commit

Permalink
Chores (#16)
Browse files Browse the repository at this point in the history
* update README.md

* add Bazel linters
  • Loading branch information
bcebere authored Jun 2, 2020
1 parent 677e52c commit e7c1a32
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 19 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/scripts/lint_bazel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -e

# Lint files (all BUILD) inplace.
find ./pir/ \( -iname BUILD \) | xargs buildifier
if [ $? -ne 0 ]
then
exit 1
fi

# Print changes.
git diff
# Already well formated if 'git diff' doesn't output anything.
! ( git diff | grep -q ^ ) || exit 1
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ jobs:
Linters:
runs-on: ubuntu-latest
steps:
- name: Install toolchains
uses: actions/setup-go@v2
with:
go-version: 1.13.3
id: go
- name: Install linters
run: go get github.com/bazelbuild/buildtools/buildifier
- uses: actions/checkout@v2
- name: C++ Build
run: .github/workflows/scripts/build_cpp.sh
- name: C++ linters
run: .github/workflows/scripts/lint_cpp.sh
- name: Bazel linters
run: .github/workflows/scripts/lint_bazel.sh

3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Bogdan Cebere](https://github.com/bcebere)

[Kareem Shehata](https://github.com/kshehata)
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
![om-logo](https://github.com/OpenMined/design-assets/blob/master/logos/OM/horizontal-primary-trans.png)

[![Tests](https://github.com/OpenMined/PSI/workflows/Tests/badge.svg?branch=master&event=push)](https://github.com/OpenMined/PSI/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush)
![License](https://img.shields.io/github/license/OpenMined/PIR)
![OpenCollective](https://img.shields.io/opencollective/all/openmined)


# Private Information Retrieval

## Requirements
Expand All @@ -23,7 +30,7 @@ pir/<target language>/<sources>

See the [C++ README.md](pir/cpp/README.md)

## Using the Library
## Usage

To use this library in another Bazel project, add the following in your WORKSPACE file:

Expand All @@ -46,3 +53,15 @@ load("@org_openmined_pir//pir:deps.bzl", "pir_deps")
pir_deps()
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## Contributors

See [CONTRIBUTORS.md](CONTRIBUTORS.md).

## License
[Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/)
50 changes: 32 additions & 18 deletions pir/cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,63 @@ package(default_visibility = ["//visibility:public"])

PIR_DEFAULT_INCLUDES = ["."]

PIR_DEFAULT_COPTS = ["-std=c++17"]
PIR_DEFAULT_COPTS = ["-std=c++17"]

cc_library(
name = "pir",
srcs = ["client.cpp", "server.cpp",
"context.cpp", "context.h",
"parameters.h", "parameters.cpp",
"serialization.h", "serialization.cpp",
"database.cpp", "database.h",
"utils.cpp", "utils.h",
],
hdrs = ["client.h", "server.h"],
srcs = [
"client.cpp",
"context.cpp",
"context.h",
"database.cpp",
"database.h",
"parameters.cpp",
"parameters.h",
"serialization.cpp",
"serialization.h",
"server.cpp",
"utils.cpp",
"utils.h",
],
hdrs = [
"client.h",
"server.h",
],
copts = PIR_DEFAULT_COPTS,
includes = PIR_DEFAULT_INCLUDES,
deps = [
"//pir/proto:payload_cc_proto",
"@com_microsoft_seal//:seal",
"@com_google_absl//absl/memory",
"@com_microsoft_seal//:seal",
"@private_join_and_compute//util:status",
],
copts = PIR_DEFAULT_COPTS,
)

cc_test(
name = "pir_test",
srcs = ["client_test.cpp", "server_test.cpp", "serialization_test.cpp"],
srcs = [
"client_test.cpp",
"serialization_test.cpp",
"server_test.cpp",
],
copts = PIR_DEFAULT_COPTS,
includes = PIR_DEFAULT_INCLUDES,
linkstatic = True,
deps = [
":pir",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",

],
copts = PIR_DEFAULT_COPTS,
linkstatic = True,
)

cc_binary(
name = "benchmark",
srcs = ["benchmark.cpp"],
copts = PIR_DEFAULT_COPTS,
includes = PIR_DEFAULT_INCLUDES,
linkstatic = True,
deps = [
":pir",
"@com_google_benchmark//:benchmark_main",
],
includes = PIR_DEFAULT_INCLUDES,
copts = PIR_DEFAULT_COPTS,
linkstatic = True,
)
1 change: 1 addition & 0 deletions pir/proto/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#

package(default_visibility = ["//visibility:public"])

load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
Expand Down

0 comments on commit e7c1a32

Please sign in to comment.