Skip to content

Commit

Permalink
fix typed BQ examples build, #2272 (#2284)
Browse files Browse the repository at this point in the history
* exclude typed BQ examples from vanilla build

* update build docs, #2272
  • Loading branch information
nevillelyh authored Oct 3, 2019
1 parent 5b7c95e commit 01bece4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ You can also run `~mdoc` to automatically build the documentation on save.

# Building locally

Some example and test code in Scio depends on Google Cloud Platform access for BigQuery schemas, Cloud Dataflow service, etc. To build Scio locally without a GCP credential, first run the following script to generate BigQuery schema cache.

```bash
./scripts/gen_schemas.sh
```

When opening the project in IntelliJ IDEA, tick "Use sbt shell:" both "for imports" and "for builds".
See [this page](https://spotify.github.io/scio/dev/build.html) for building Scio locally.

# Code of Conduct

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ lazy val scioExamples: Project = Project(
if (BuildCredentials.exists) {
HiddenFileFilter
} else {
HiddenFileFilter || "TypedBigQueryTornadoes*.scala"
HiddenFileFilter || "TypedBigQueryTornadoes*.scala" || "TypedStorageBigQueryTornadoes*.scala"
}
},
sources in doc in Compile := List()
Expand Down
2 changes: 1 addition & 1 deletion site/src/paradox/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Unlike Hadoop, Scio or Dataflow input should be file patterns and not directorie
Use the @javadoc[`DataflowRunner`](org.apache.beam.runners.dataflow.DataflowRunner) to execute pipelines on Google Cloud Dataflow service using managed resources in the Google Cloud Platform.

```
neville@localhost scio $ sbt -Dbigquery.project=<BILLING_PROJECT>
neville@localhost scio $ sbt
[info] ...
> project scio-examples
[info] ...
Expand Down
22 changes: 18 additions & 4 deletions site/src/paradox/dev/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@ git clone https://github.com/spotify/scio.git

## Compiling

Copy the pre generated BigQuery schemas:
Build and test the code.

```bash
cp -r scripts/bigquery .bigquery
cd scio
sbt test
```

Define `bigquery.project` as a system property. You can use any value since we will be using the pre generated schemas.
Some examples depend on Google Cloud Platform and are excluded by default if GCP credentials are missing. To enable them, authenticate yourself for GCP, set up default credentials and restart sbt.

```bash
sbt -Dbigquery.project=dummy compile
gcloud auth application-default login
sbt test
```

Alternatively you can populate pre-generated cache for BigQuery schemas to bypass GCP access.
Define `bigquery.project` as a system property. The value can by anything since we'll hit cache instead.

```bash
./scripts/gen_schemas.sh
sbt -Dbigquery.project=dummy-project test
```

## IntelliJ IDEA

When opening the project in IntelliJ IDEA, tick "Use sbt shell:" both "for imports" and "for builds".

0 comments on commit 01bece4

Please sign in to comment.