Skip to content

Commit

Permalink
Release 1.5.1 (#17)
Browse files Browse the repository at this point in the history
* Extracted Java Code out for DP Module
* Upgraded Java Compatibility to 17+
* @Nojipiz added feature to stream large datasets from BigQuery using ZIO Streams
---------
Co-authored-by: Orlando Vargas <nojipiz@protonmail.com>
  • Loading branch information
tharwaninitin authored May 17, 2024
1 parent 8642073 commit d2c6c5a
Show file tree
Hide file tree
Showing 28 changed files with 453 additions and 250 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11, 14 ]
# removed version 8 temporarily to avoid sbt-updates failing because of the latest version of LogbackVersion
java-version: [ 17, 21 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand All @@ -21,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 14 ]
java-version: [ 17, 21 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand All @@ -36,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 14 ]
java-version: [ 17, 21 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand All @@ -51,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 14 ]
java-version: [ 17, 21 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand All @@ -66,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 14 ]
java-version: [ 17, 21 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11, 8, 14 ]
java-version: [ 17 ]
fail-fast: false
steps:
- name: Checkout Code
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Scala Code Linting Check
name: Scala/Java Code Linting Check
on: [push]
jobs:
scalafmt:
Expand All @@ -10,7 +10,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
java-version: 21
- name: Check scalafmt
run: sbt scalafmtCheckAll
scalastyle:
Expand All @@ -22,6 +22,18 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
java-version: 21
- name: Check scalastyle
run: sbt "scalastyle; Test/scalastyle"
javafmt:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 21
- name: Check javafmt
run: sbt javafmtCheckAll
2 changes: 1 addition & 1 deletion .github/workflows/mdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
java-version: 21
- name: Check Documentation
run: sbt "docs/mdoc --check"
37 changes: 37 additions & 0 deletions .github/workflows/publishLocal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Local CI
on: [push]
jobs:
publish213:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 21 ]
fail-fast: false
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java-version }}
cache: 'sbt'
- name: Publish Local for 2.13
run: sbt "++ 2.13.12 publishLocal"
publish3:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [21]
fail-fast: false
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java-version }}
cache: 'sbt'
- name: Publish Local for 3
run: sbt "++ 3.3.1 publishLocal"
2 changes: 1 addition & 1 deletion .github/workflows/semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: 21
cache: 'sbt'
# - name: Run Semantic Versioning Policy Check for BQ
# run: sbt bq/versionPolicyCheck
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
java-version: 21
- name: Check Dependency Updates
run: sbt dependencyUpdates
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@

Add the latest release as a dependency to your project

| Module | Latest Version | Documentation | Scala Versions |
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Google Cloud Storage | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-gcs_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-gcs) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-gcs_2.12/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-gcs_2.12) | [![gcp4zio-gcs Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-gcs/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-gcs) |
| Dataproc | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-dp_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-dp) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-dp_2.12/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-dp_2.12) | [![gcp4zio-dp Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-dp/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-dp) |
| BigQuery | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-bq_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-bq) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-bq_2.12/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-bq_2.12) | [![gcp4zio-bq Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-bq/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-bq) |
| PubSub | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-pubsub_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-pubsub) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-pubsub_2.12/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-pubsub_2.12) | [![gcp4zio-pubsub Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-pubsub/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-pubsub) |
| Cloud Monitoring | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-monitoring_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-monitoring) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-monitoring_2.12/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-monitoring_2.12) | [![gcp4zio-monitoring Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-monitoring/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-monitoring) |
| Module | Latest Version | Documentation | Scala Versions |
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Google Cloud Storage | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-gcs_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-gcs) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-gcs_3/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-gcs_3) | [![gcp4zio-gcs Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-gcs/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-gcs) |
| Dataproc | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-dp_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-dp) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-dp_3/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-dp_3) | [![gcp4zio-dp Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-dp/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-dp) |
| BigQuery | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-bq_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-bq) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-bq_3/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-bq_3) | [![gcp4zio-bq Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-bq/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-bq) |
| PubSub | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-pubsub_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-pubsub) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-pubsub_3/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-pubsub_3) | [![gcp4zio-pubsub Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-pubsub/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-pubsub) |
| Cloud Monitoring | [![Latest Version](https://maven-badges.herokuapp.com/maven-central/com.github.tharwaninitin/gcp4zio-monitoring_2.12/badge.svg)](https://mvnrepository.com/artifact/com.github.tharwaninitin/gcp4zio-monitoring) | [![javadoc](https://javadoc.io/badge2/com.github.tharwaninitin/gcp4zio-monitoring_3/javadoc.svg)](https://javadoc.io/doc/com.github.tharwaninitin/gcp4zio-monitoring_3) | [![gcp4zio-monitoring Scala version support](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-monitoring/latest-by-scala-version.svg)](https://index.scala-lang.org/tharwaninitin/gcp4zio/gcp4zio-monitoring) |

This project is compiled with scala versions 2.12.18, 2.13.12, 3.3.1
This project is tested with scala versions 2.13.12, 3.3.1 and java versions 17, 21

__SBT__
``` scala mdoc
libraryDependencies ++= List(
"com.github.tharwaninitin" %% "gcp4zio-gcs" % "1.5.0",
"com.github.tharwaninitin" %% "gcp4zio-dp" % "1.5.0",
"com.github.tharwaninitin" %% "gcp4zio-bq" % "1.5.0",
"com.github.tharwaninitin" %% "gcp4zio-pubsub" % "1.5.0",
"com.github.tharwaninitin" %% "gcp4zio-monitoring" % "1.5.0"
"com.github.tharwaninitin" %% "gcp4zio-gcs" % "1.5.1",
"com.github.tharwaninitin" %% "gcp4zio-dp" % "1.5.1",
"com.github.tharwaninitin" %% "gcp4zio-bq" % "1.5.1",
"com.github.tharwaninitin" %% "gcp4zio-pubsub" % "1.5.1",
"com.github.tharwaninitin" %% "gcp4zio-monitoring" % "1.5.1"
)
```
__Maven__
```
<dependency>
<groupId>com.github.tharwaninitin</groupId>
<artifactId>gcp4zio-gcs_2.12</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
</dependency>
```
# GCP4ZIO API's
Expand Down Expand Up @@ -123,14 +123,14 @@ GCS.copyObjectsGCStoGCS(
import gcp4zio.dp._

// Create Dataproc Cluster Properties
val dpProps = ClusterProps(bucketName = "dpLogBucket")
val props = new ClusterProps("dataproc-logs")
// Create Dataproc Cluster
val createTask = DPCluster.createDataproc("dpCluster", dpProps)
val createTask = DPCluster.createDataproc("cluster1", props)

// Delete Dataproc Cluster
val deleteTask = DPCluster.deleteDataproc("dpCluster")

(createTask *> deleteTask).provide(DPCluster.live("gcpProject", "gcpRegion", "dpEndpoint"))
(createTask *> deleteTask).provide(DPCluster.live("gcpProject", "gcpRegion"))
```

### Dataproc Job
Expand Down
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ lazy val commonSettings = Seq(
scalaVersion := scala212,
crossScalaVersions := allScalaVersions,
dependencyUpdatesFailBuild := true,
compileOrder := CompileOrder.JavaThenScala,
// scalacOptions ++= Seq("-target:11"),
// scalacOptions ++= Seq("-release", "25"),
dependencyUpdatesFilter -= moduleFilter(organization = "org.scala-lang"),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
Expand Down Expand Up @@ -35,7 +38,7 @@ lazy val gcp4zio = (project in file("."))
crossScalaVersions := Nil, // crossScalaVersions must be set to Nil on the aggregating project
publish / skip := true
)
.aggregate(bq, dp, gcs, pubsub, batch, monitoring)
.aggregate(bq, dp, gcs, pubsub, batch, monitoring, examples)

lazy val bq = (project in file("modules/bq"))
.settings(commonSettings)
Expand Down Expand Up @@ -76,7 +79,7 @@ lazy val docs = project
.settings(
name := "gcp4zio-docs",
publish / skip := true,
mdocVariables := Map("VERSION" -> version.value, "Scala212" -> scala212, "Scala213" -> scala213, "Scala3" -> scala3),
mdocVariables := Map("VERSION" -> version.value, "Scala212" -> scala212, "Scala213" -> scala213, "Scala3" -> scala3, "JavaVersions" -> "17, 21"),
mdocIn := new File("docs/readme.template.md"),
mdocOut := new File("README.md")
)
Expand Down
Loading

0 comments on commit d2c6c5a

Please sign in to comment.