Skip to content

Commit

Permalink
Add google- into project title (closes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFradet committed Nov 5, 2018
1 parent 7d77d64 commit 72cf726
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ before_deploy:
deploy:
- provider: script
skip_cleanup: true
script: release-manager --config ./.travis/release.yml --check-version --make-version --make-artifact --upload-artifact
script: ./.travis/deploy_template.sh $TRAVIS_TAG
on:
tags: true
- provider: script
skip_cleanup: true
script: ./.travis/deploy_docker.sh $TRAVIS_TAG
script: release-manager --config ./.travis/release.yml --check-version --make-version --make-artifact --upload-artifact
on:
tags: true
- provider: script
skip_cleanup: true
script: ./.travis/deploy_template.sh $TRAVIS_TAG
script: ./.travis/deploy_docker.sh $TRAVIS_TAG
on:
tags: true
env:
Expand Down
2 changes: 1 addition & 1 deletion .travis/deploy_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd ${TRAVIS_BUILD_DIR}
project_version=$(sbt -no-colors version | perl -ne 'print "$1\n" if /info.*(\d+\.\d+\.\d+[^\r\n]*)/' | tail -n 1 | tr -d '\n')
if [[ "${tag}" = "${project_version}" ]]; then
sbt docker:publishLocal
docker push "${docker_repo}/snowplow/snowplow-cloud-storage-loader:${tag}"
docker push "${docker_repo}/snowplow/snowplow-google-cloud-storage-loader:${tag}"
else
echo "Tag version '${tag}' doesn't match version in scala project ('${project_version}'). aborting!"
exit 1
Expand Down
6 changes: 3 additions & 3 deletions .travis/deploy_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ cd ${TRAVIS_BUILD_DIR}

project_version=$(sbt -no-colors version | perl -ne 'print "$1\n" if /info.*(\d+\.\d+\.\d+[^\r\n]*)/' | tail -n 1 | tr -d '\n')
if [[ "${tag}" = *"${project_version}" ]]; then
sbt "runMain com.snowplowanalytics.storage.cloudstorage.loader.CloudStorageLoader --project=engineering-sandbox \
--templateLocation=gs://snowplow-hosted-assets/4-storage/cloud-storage-loader/${tag}/CloudStorageLoaderTemplate-${tag} \
--stagingLocation=gs://snowplow-hosted-assets/4-storage/cloud-storage-loader/${tag}/staging \
sbt "runMain com.snowplowanalytics.storage.googlecloudstorage.loader.CloudStorageLoader --project=engineering-sandbox \
--templateLocation=gs://snowplow-hosted-assets/4-storage/snowplow-google-cloud-storage-loader/${tag}/SnowplowGoogleCloudStorageLoaderTemplate-${tag} \
--stagingLocation=gs://snowplow-hosted-assets/4-storage/snowplow-google-cloud-storage-loader/${tag}/staging \
--runner=DataflowRunner \
--tempLocation=gs://snowplow-hosted-assets/tmp"
else
Expand Down
6 changes: 3 additions & 3 deletions .travis/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ targets :
# Required: packages to be deployed
packages :
- repo : "snowplow-generic"
name : "snowplow-cloud-storage-loader"
name : "snowplow-google-cloud-storage-loader"
user_org : "snowplow"
publish : true
override : false
Expand All @@ -26,7 +26,7 @@ packages :
- sbt universal:packageBin
artifacts :
- type : "asis"
prefix : "snowplow_cloud_storage_loader_"
prefix : "snowplow_google_cloud_storage_loader_"
suffix : ".zip"
binary_paths :
- "target/universal/cloud-storage-loader-{{ packages.0.build_version }}.zip"
- "target/universal/snowplow-google-cloud-storage-loader-{{ packages.0.build_version }}.zip"
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cloud Storage Loader
# Snowplow Google Cloud Storage Loader

## Introduction

Expand All @@ -15,9 +15,9 @@ additional flexibility when running your pipeline.
To upload the template to your own bucket, run:

```bash
sbt "runMain com.snowplowanalytics.storage.cloudstorage.loader.CloudStorageLoader \
sbt "runMain com.snowplowanalytics.storage.googlecloudstorage.loader.CloudStorageLoader \
--project=[PROJECT] \
--templateLocation=gs://[BUCKET]/CloudStorageLoaderTemplate \
--templateLocation=gs://[BUCKET]/SnowplowGoogleCloudStorageLoaderTemplate \
--stagingLocation=gs://[BUCKET]/staging \
--runner=DataflowRunner \
--tempLocation=gs://[BUCKET]/tmp"
Expand Down Expand Up @@ -55,7 +55,7 @@ Here, we provide an example using `gcloud`:

```bash
gcloud dataflow jobs run [JOB-NAME] \
--gcs-location gs://snowplow-hosted-assets/4-storage/cloud-storage-loader/0.1.0/CloudStorageLoaderTemplate-0.1.0 \
--gcs-location gs://snowplow-hosted-assets/4-storage/snowplow-google-cloud-storage-loader/0.1.0/SnowplowGoogleCloudStorageLoaderTemplate-0.1.0 \
--parameters \
inputSubscription=projects/[PROJECT]/subscriptions/[SUBSCRIPTION],\
outputDirectory=gs://[BUCKET]/YYYY/MM/dd/HH/,\ # partitions by date
Expand All @@ -67,14 +67,14 @@ gcloud dataflow jobs run [JOB-NAME] \
numShards=1 # optional
```

### Directly
### Through the zip archive

You can find the archive hosted on [our Bintray][bintray].

Once unzipped the artifact can be run as follows:

```bash
./bin/cloud-storage-loader \
./bin/snowplow-google-cloud-storage-loader \
--runner=DataFlowRunner \
--project=[PROJECT] \
--streaming=true \
Expand All @@ -92,23 +92,25 @@ Once unzipped the artifact can be run as follows:
To display the help message:

```bash
./bin/cloud-storage-loader --help
./bin/snowplow-google-cloud-storage-loader --help
```

To display documentation about Cloud Storage Loader-specific options:

```bash
./bin/cloud-storage-loader --help=com.snowplowanalytics.storage.cloudstorage.loader.Options
./bin/snowplow-google-cloud-storage-loader --help=com.snowplowanalytics.storage.googlecloudstorage.loader.Options
```

### Through a docker container

You can also find the image on [our Bintray][bintray-docker].

A container can be run as follows:

```bash
docker run \
-e GOOGLE_APPLICATION_CREDENTIALS=/snowplow/config/credentials.json \ # if running outside GCP
snowplow-docker-registry.bintray.io/snowplow/cloud-storage-loader:0.1.0 \
snowplow-docker-registry.bintray.io/snowplow/snowplow-google-cloud-storage-loader:0.1.0 \
--runner=DataFlowRunner \
--job-name=[JOB-NAME] \
--project=[PROJECT] \
Expand All @@ -127,15 +129,15 @@ docker run \
To display the help message:

```bash
docker run snowplow-docker-registry.bintray.io/snowplow/cloud-storage-loader:0.1.0 \
docker run snowplow-docker-registry.bintray.io/snowplow/snowplow-google-cloud-storage-loader:0.1.0 \
--help
```

To display documentation about Cloud Storage Loader-specific options:

```bash
docker run snowplow-docker-registry.bintray.io/snowplow/cloud-storage-loader:0.1.0 \
--help=com.snowplowanalytics.storage.cloudstorage.loader.Options
docker run snowplow-docker-registry.bintray.io/snowplow/snowplow-google-cloud-storage-loader:0.1.0 \
--help=com.snowplowanalytics.storage.googlecloudstorage.loader.Options
```

### Additional information
Expand Down Expand Up @@ -186,11 +188,12 @@ limitations under the License.
[templates]: https://cloud.google.com/dataflow/docs/templates/overview
[executing-templates]: https://cloud.google.com/dataflow/docs/templates/executing-templates

[bintray]: https://bintray.com/snowplow/snowplow-generic/snowplow-cloud-storage-loader
[bintray]: https://bintray.com/snowplow/snowplow-generic/snowplow-google-cloud-storage-loader
[bintray-docker]: https://bintray.com/snowplow/registry/snowplow%3Asnowplow-google-cloud-storage-loader

[license]: http://www.apache.org/licenses/LICENSE-2.0

[techdocs-image]: https://d3i6fms1cm1j0i.cloudfront.net/github/images/techdocs.png
[setup-image]: https://d3i6fms1cm1j0i.cloudfront.net/github/images/setup.png
[techdocs]: https://github.com/snowplow/snowplow/wiki/Cloud-Storage-Loader
[setup]: https://github.com/snowplow/snowplow/wiki/setting-up-cloud-storage-loader
[techdocs]: https://github.com/snowplow/snowplow/wiki/Snowplow-Google-Cloud-Storage-Loader
[setup]: https://github.com/snowplow/snowplow/wiki/setting-up-snowplow-google-cloud-storage-loader
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lazy val root: Project = project
.settings(commonSettings)
.settings(macroSettings)
.settings(
name := "cloud-storage-loader",
name := "snowplow-google-cloud-storage-loader",
description := "Snowplow Google Cloud Storage Loader",
publish / skip := true,
libraryDependencies ++= Seq(
Expand All @@ -71,7 +71,7 @@ lazy val repl: Project = project
.settings(macroSettings)
.settings(
name := "repl",
description := "Scio REPL for snowplow-cloud-storage-loader",
description := "Scio REPL for snowplow-google-cloud-storage-loader",
libraryDependencies ++= Seq(
"com.spotify" %% "scio-repl" % scioVersion
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* See the Apache License Version 2.0 for the specific language governing permissions and
* limitations there under.
*/
package com.snowplowanalytics.storage.cloudstorage.loader
package com.snowplowanalytics.storage.googlecloudstorage.loader

import com.spotify.scio._
import org.apache.beam.sdk.io.{Compression, FileBasedSink, TextIO}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
* See the Apache License Version 2.0 for the specific language governing permissions and
* limitations there under.
*/
package com.snowplowanalytics.storage.cloudstorage.loader
package com.snowplowanalytics.storage.googlecloudstorage.loader

import org.apache.beam.sdk.options._
import org.apache.beam.sdk.options.Validation.Required

/** Trait regrouping the loader's configuration. */
trait Options extends PipelineOptions with StreamingOptions {
@Description("The Cloud Pub/Sub subscription to read from")
@Description("The Cloud Pub/Sub subscription to read from, formatted as projects/[PROJECT]/subscriptions/[SUB]")
@Required
def getInputSubscription: ValueProvider[String]
def setInputSubscription(value: ValueProvider[String]): Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* See the Apache License Version 2.0 for the specific language governing permissions and
* limitations there under.
*/
package com.snowplowanalytics.storage.cloudstorage.loader
package com.snowplowanalytics.storage.googlecloudstorage.loader

import org.apache.beam.sdk.io.DefaultFilenamePolicy
import org.apache.beam.sdk.io.FileBasedSink.{FilenamePolicy, OutputFileHints}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* See the Apache License Version 2.0 for the specific language governing permissions and
* limitations there under.
*/
package com.snowplowanalytics.storage.cloudstorage.loader
package com.snowplowanalytics.storage.googlecloudstorage.loader

import com.spotify.scio.testing._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* See the Apache License Version 2.0 for the specific language governing permissions and
* limitations there under.
*/
package com.snowplowanalytics.storage.cloudstorage.loader
package com.snowplowanalytics.storage.googlecloudstorage.loader

import java.io.File
import java.nio.file.Files
Expand Down

0 comments on commit 72cf726

Please sign in to comment.