From 2551a99e495d973fc916322bed352b3a13bf9d5f Mon Sep 17 00:00:00 2001 From: Naman Nandan Date: Wed, 28 Jun 2023 16:15:39 -0700 Subject: [PATCH] Publish torchserve-plugins-sdk artifacts to Maven Central repository (#2422) * Fix missing torchserve-plugins-sdk artifacts and version * Add support for releasing torchserve plugins sdk to Maven Central * enable gpg signing * Add necessary gpg arguments and update distribution management * Revert workaround used to build and install torchserve-plugins-sdk locally * Disable building torchserve-plugins-sdk in CI --------- Co-authored-by: Naman Nandan --- .github/workflows/ci_cpu.yml | 8 ------- .github/workflows/ci_gpu.yml | 3 --- frontend/build.gradle | 2 -- serving-sdk/pom.xml | 34 ++++++++++++++++++++++++++---- ts_scripts/install_dependencies.py | 15 ------------- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci_cpu.yml b/.github/workflows/ci_cpu.yml index 1f7fd98ad6..c33d5d1c7b 100644 --- a/.github/workflows/ci_cpu.yml +++ b/.github/workflows/ci_cpu.yml @@ -43,14 +43,6 @@ jobs: retry_on: error command: | python torchserve_sanity.py - - name: mvn install - unix - if: matrix.os != 'windows-latest' - run: | - cd serving-sdk/ && ./mvnw clean install -q && cd ../ - - name: mvn install - windows - if: matrix.os == 'windows-latest' - run: | - cd serving-sdk/ && .\mvnw.cmd clean install -q && cd ../ # Any coverage.xml will be picked up by this step # Just make sure each coverage.xml is in a different folder - name: Upload codecov diff --git a/.github/workflows/ci_gpu.yml b/.github/workflows/ci_gpu.yml index e43e2b92f2..695c245c97 100644 --- a/.github/workflows/ci_gpu.yml +++ b/.github/workflows/ci_gpu.yml @@ -47,9 +47,6 @@ jobs: max_attempts: 3 command: | python torchserve_sanity.py - - name: mvn install - run: | - cd serving-sdk/ && ./mvnw clean install -q && cd ../ # Any coverage.xml will be picked up by this step # Just make sure each coverage.xml is in a different folder diff --git a/frontend/build.gradle b/frontend/build.gradle index ccda20960d..b01ab449b8 100644 --- a/frontend/build.gradle +++ b/frontend/build.gradle @@ -19,8 +19,6 @@ allprojects { repositories { mavenCentral() - jcenter() - mavenLocal() } apply plugin: 'idea' diff --git a/serving-sdk/pom.xml b/serving-sdk/pom.xml index 93ed5ab070..07ce573553 100644 --- a/serving-sdk/pom.xml +++ b/serving-sdk/pom.xml @@ -24,6 +24,12 @@ + + scm:git:git://github.com/pytorch/serve.git + scm:git:ssh://github.com:pytorch/serve.git + https://github.com/pytorch/serve + + http://maven.apache.org file://${project.build.directory}/repo @@ -61,6 +67,12 @@ 1.6 ${skip.gpg} + ${gpg.keyname} + ${gpg.passphrase} + + --pinentry-mode + loopback + @@ -112,7 +124,7 @@ attach-sources - jar + jar-no-fork @@ -142,14 +154,28 @@ 8 + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + false + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + - bintray-pytorch-maven - pytorch-maven - https://api.bintray.com/maven/pytorch/maven/org.pytorch:torchserve_plugins_sdk/ + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ diff --git a/ts_scripts/install_dependencies.py b/ts_scripts/install_dependencies.py index 8bc949f185..b5b9b4b0a7 100644 --- a/ts_scripts/install_dependencies.py +++ b/ts_scripts/install_dependencies.py @@ -81,9 +81,6 @@ def install_wget(self): def install_numactl(self): pass - def install_torchserve_plugins_sdk(self): - pass - class Linux(Common): def __init__(self): @@ -113,9 +110,6 @@ def install_numactl(self): if os.system("numactl --show") != 0 or args.force: os.system(f"{self.sudo_cmd}apt-get install -y numactl") - def install_torchserve_plugins_sdk(self): - os.system(f"cd {REPO_ROOT}/serving-sdk/ && ./mvnw clean install -q && cd ../") - class Windows(Common): def __init__(self): @@ -134,11 +128,6 @@ def install_wget(self): def install_numactl(self): pass - def install_torchserve_plugins_sdk(self): - os.system( - f"cd {REPO_ROOT}/serving-sdk/ && .\mvnw.cmd clean install -q && cd ../" - ) - class Darwin(Common): def __init__(self): @@ -167,9 +156,6 @@ def install_numactl(self): if os.system("numactl --show") != 0 or args.force: os.system("brew install numactl") - def install_torchserve_plugins_sdk(self): - os.system(f"cd {REPO_ROOT}/serving-sdk/ && ./mvnw clean install -q && cd ../") - def install_dependencies(cuda_version=None, nightly=False): os_map = {"Linux": Linux, "Windows": Windows, "Darwin": Darwin} @@ -180,7 +166,6 @@ def install_dependencies(cuda_version=None, nightly=False): system.install_nodejs() system.install_node_packages() system.install_numactl() - system.install_torchserve_plugins_sdk() # Sequence of installation to be maintained system.install_java()