-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Backport Sonatype publishing and datatypes module for v0.3.x #407
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
Merged
feast-ci-bot
merged 4 commits into
feast-dev:v0.3-branch
from
ches:sonatype-and-datatypes-backport
Jan 8, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
| set -o pipefail | ||
|
|
||
| GPG_KEY_IMPORT_DIR=/etc/gpg | ||
|
|
||
| usage() | ||
| { | ||
| echo "usage: publish-java-sdk.sh | ||
|
|
||
| --revision Value for the revision e.g. '0.2.3' | ||
| --gpg-key-import-dir Directory containing existing GPG keys to import. | ||
| The directory should contain these 2 files: | ||
| - public-key | ||
| - private-key | ||
| The default value is '/etc/gpg' | ||
|
|
||
| This script assumes the GPG private key is protected by a passphrase. | ||
| The passphrase can be specified in \$HOME/.m2/settings.xml. In the same xml | ||
| file, credentials to upload releases to Sonatype must also be provided. | ||
|
|
||
| # Example settings: ~/.m2/settings.xml | ||
| <settings> | ||
| <servers> | ||
| <server> | ||
| <id>ossrh</id> | ||
| <username>SONATYPE_USER</username> | ||
| <password>SONATYPE_PASSWORD</password> | ||
| </server> | ||
| </servers> | ||
| <profiles> | ||
| <profile> | ||
| <id>ossrh</id> | ||
| <properties> | ||
| <gpg.passphrase>GPG_PASSPHRASE</gpg.passphrase> | ||
| </properties> | ||
| </profile> | ||
| </profiles> | ||
| </settings> | ||
| " | ||
| } | ||
|
|
||
| while [ "$1" != "" ]; do | ||
| case "$1" in | ||
| --revision ) REVISION="$2"; shift;; | ||
| --gpg-key-import-dir ) GPG_KEY_IMPORT_DIR="$2"; shift;; | ||
| -h | --help ) usage; exit;; | ||
| * ) usage; exit 1 | ||
| esac | ||
| shift | ||
| done | ||
|
|
||
| if [ -z $REVISION ]; then usage; exit 1; fi | ||
|
|
||
| echo "============================================================" | ||
| echo "Checking Maven and GPG versions" | ||
| echo "============================================================" | ||
| mvn --version | ||
| echo "" | ||
| gpg --version | ||
|
|
||
| echo "============================================================" | ||
| echo "Importing GPG keys" | ||
| echo "============================================================" | ||
| gpg --import --batch --yes $GPG_KEY_IMPORT_DIR/public-key | ||
| gpg --import --batch --yes $GPG_KEY_IMPORT_DIR/private-key | ||
|
|
||
| echo "============================================================" | ||
| echo "Deploying Java SDK with revision: $REVISION" | ||
| echo "============================================================" | ||
| mvn --projects datatypes/java,sdk/java -Drevision=$REVISION --batch-mode clean deploy | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| Feast Data Types for Java | ||
| ========================= | ||
|
|
||
| This module produces Java class files for Feast's data type and gRPC service | ||
| definitions, from Protobuf IDL. These are used across Feast components for wire | ||
| interchange, contracts, etc. | ||
|
|
||
| End users of Feast will be best served by our Java SDK which adds higher-level | ||
| conveniences, but the data types are published independently for custom needs, | ||
| without any additional dependencies the SDK may add. | ||
|
|
||
| Dependency Coordinates | ||
| ---------------------- | ||
|
|
||
| ```xml | ||
| <dependency> | ||
| <groupId>dev.feast</groupId> | ||
| <artifactId>datatypes-java</artifactId> | ||
| <version>0.3.6-SNAPSHOT</version> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| Using the `.proto` Definitions | ||
| ------------------------------ | ||
|
|
||
| The `.proto` definitions are packaged as resources within the Maven artifact, | ||
| which may be useful to `include` them in dependent Protobuf definitions in a | ||
| downstream project, or for other JVM languages to consume from their builds to | ||
| generate more idiomatic bindings. | ||
|
|
||
| Google's Gradle plugin, for instance, [can use protos in dependencies][Gradle] | ||
| either for `include` or to compile with a different `protoc` plugin than Java. | ||
|
|
||
| [sbt-protoc] offers similar functionality for sbt/Scala. | ||
|
|
||
| [Gradle]: https://github.com/google/protobuf-gradle-plugin#protos-in-dependencies | ||
| [sbt-protoc]: https://github.com/thesamet/sbt-protoc | ||
|
|
||
| Publishing | ||
| ---------- | ||
|
|
||
| TODO: this module should be published to Maven Central upon Feast releases—this | ||
| needs to be set up in POM configuration and release automation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Copyright 2019 The Feast Authors | ||
| ~ | ||
| ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| ~ you may not use this file except in compliance with the License. | ||
| ~ You may obtain a copy of the License at | ||
| ~ | ||
| ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| ~ | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <name>Feast Data Types for Java</name> | ||
| <description> | ||
| Data types and service contracts used throughout Feast components and | ||
| their interchanges. These are generated from Protocol Buffers and gRPC | ||
| definitions included in the package. | ||
| </description> | ||
| <artifactId>datatypes-java</artifactId> | ||
|
|
||
| <parent> | ||
| <groupId>dev.feast</groupId> | ||
| <artifactId>feast-parent</artifactId> | ||
| <version>${revision}</version> | ||
| <relativePath>../..</relativePath> | ||
| </parent> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.xolstice.maven.plugins</groupId> | ||
| <artifactId>protobuf-maven-plugin</artifactId> | ||
| <configuration> | ||
| <checkStaleness>true</checkStaleness> | ||
| <protocArtifact> | ||
| com.google.protobuf:protoc:${protocVersion}:exe:${os.detected.classifier} | ||
| </protocArtifact> | ||
| <pluginId>grpc-java</pluginId> | ||
| <pluginArtifact> | ||
| io.grpc:protoc-gen-grpc-java:${grpcVersion}:exe:${os.detected.classifier} | ||
| </pluginArtifact> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>compile</goal> | ||
| <goal>compile-custom</goal> | ||
| <goal>test-compile</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-services</artifactId> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../../../protos/third_party |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidheryanto I went with the bare minimum of augmenting the script here, since it makes sense that these are always published together by the same job, the conditions for when to run are the same, etc. Do you think anything more than this is needed, docs or otherwise?
We will need to forward-port this change to master, I forgot it in #391 since the release process came after I started.