Skip to content

Commit

Permalink
Fix deps & build
Browse files Browse the repository at this point in the history
  • Loading branch information
SemyonSinchenko committed Sep 20, 2024
1 parent 006c268 commit 9853975
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 38 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ jobs:
uses: actions/checkout@v4

- name: Set up JDK
if: startsWith(github.ref, 'refs/tags/')
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Set up Python
if: startsWith(github.ref, 'refs/tags/')
uses: actions/setup-python@v5

- name: Set up Poetry
if: startsWith(github.ref, 'refs/tags/')
uses: snok/install-poetry@v1

- name: Create Release tag
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -28,17 +37,24 @@ jobs:
draft: false
prerelease: false

- name: Build with Maven
- name: Build server with Maven
if: startsWith(github.ref, 'refs/tags/')
run: mvn versions:set -DnewVersion=${{ steps.generate_tag.outpur.id }} -DskipTests --no-transfer-progress clean package
run: mvn versions:set -DnewVersion=${{ steps.generate_tag.outputs.id }} -DskipTests --no-transfer-progress clean package
working-directory: tsumugi-server

- name: Build client with poetry
if: startsWith(github.ref, 'refs/tags/')
run: |
poetry version ${{ steps.generate_tag.output.id }}
poetry build --format sdist
- name: Upload assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
append_body: true
files: |
tsumugi-server/target/tsumugi-server-*.jar
tsumugi-python/dist/tsumugi-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 1 addition & 35 deletions dev/run-connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

MVN_BUILD_COMMAND = ["mvn", "clean", "-DskipTests", "package"]
SPARK_VERSION = "3.5.2"
DEEQU_VERSION = "2.0.7-spark-3.5"
PROTOBUF_VERSION = "3.25.1"
SCALA_VERSION = "2.12"
TSUMUGI_VERSION = "1.0-SNAPSHOT"

Expand Down Expand Up @@ -83,38 +81,6 @@
spark_home = tmp_dir.joinpath(unpackaed_spark_binary)
os.chdir(spark_home)

if not spark_home.joinpath(f"deequ-{DEEQU_VERSION}.jar").exists():
print(f"Download Deequ {DEEQU_VERSION}...")
get_deequ = subprocess.run(
[
"wget",
f"https://repo1.maven.org/maven2/com/amazon/deequ/deequ/{DEEQU_VERSION}/deequ-{DEEQU_VERSION}.jar",
]
)
if get_deequ.returncode == 0:
print("Done.")
else:
print("Downlad failed.")
print("stdout: ", get_deequ.stdout)
print("stdeerr: ", get_deequ.stderr)
sys.exit(1)

if not spark_home.joinpath(f"protobuf-java-{PROTOBUF_VERSION}.jar").exists():
print(f"Download Protobuf {PROTOBUF_VERSION}...")
get_proto = subprocess.run(
[
"wget",
f"https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/{PROTOBUF_VERSION}/protobuf-java-{PROTOBUF_VERSION}.jar",
]
)
if get_proto.returncode == 0:
print("Done.")
else:
print("Downlad failed.")
print("stdout: ", get_proto.stdout)
print("stdeerr: ", get_proto.stderr)
sys.exit(1)

tsumugi_jar = (
scala_root.joinpath("target")
.joinpath(f"tsumugi-server-{TSUMUGI_VERSION}.jar")
Expand All @@ -125,7 +91,7 @@
"./sbin/start-connect-server.sh",
"--wait",
"--jars",
f"{tsumugi_jar},protobuf-java-{PROTOBUF_VERSION}.jar,deequ-{DEEQU_VERSION}.jar",
f"{tsumugi_jar}",
"--conf",
"spark.connect.extensions.relation.classes=org.apache.spark.sql.tsumugi.DeequConnectPlugin",
"--packages",
Expand Down
Loading

0 comments on commit 9853975

Please sign in to comment.