Skip to content

Commit

Permalink
refactor: Get Distro Dependencies from Release Commit (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanbrub authored Oct 9, 2024
1 parent 6bdc30c commit 686f77c
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 25 deletions.
40 changes: 40 additions & 0 deletions .github/distro/dependency-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.deephaven</groupId>
<artifactId>deephaven-benchmark-distro</artifactId>
<version>1.0-SNAPSHOT</version>
<name>deephaven-benchmark-distro</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.deephaven</groupId>
<artifactId>deephaven-benchmark</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
14 changes: 12 additions & 2 deletions .github/scripts/make-release-distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ARTIFACT=deephaven-benchmark-${RELEASE_VERSION}
DISTRO_DEST=target/distro
THIS=$(basename "$0")
RELEASE_NOTES=target/release-notes.md
WORKING_DIR=$(pwd)

PREVIOUS_REF=${PREVIOUS_TAG}
if [[ ${PREVIOUS_VERSION} != *"."*"."* ]]; then
Expand All @@ -36,10 +37,19 @@ echo "**What's Changed**" > ${RELEASE_NOTES}
git log --oneline ${PREVIOUS_REF}...${RELEASE_COMMIT} | sed -e 's/^/- /' >> ${RELEASE_NOTES}
echo "**Full Changelog**: https://github.com/deephaven/benchmark/compare/${PREVIOUS_TAG}...${RELEASE_TAG}" >> ${RELEASE_NOTES}

# Build the Distro for running standard benchmarks
# Generate dependencies directory
mkdir -p ${DISTRO_DEST}/libs/
cd ${DISTRO_DEST}
cp ${DISTRO_SOURCE}/dependency-pom.xml .
mvn -B install --file dependency-pom.xml
mv target/dependencies/* libs/
rm -rf target
rm libs/deephaven-benchmark-*SNAPSHOT*.jar
cd ${WORKING_DIR}

# Build the Distro for running standard benchmarks
cp ${DISTRO_SOURCE}/* ${DISTRO_DEST}
cp target/dependencies/* ${DISTRO_DEST}/libs
rm ${DISTRO_DEST}/dependency-pom.xml
cp target/deephaven-benchmark-1.0-SNAPSHOT.jar ${DISTRO_DEST}/libs/${ARTIFACT}.jar
cp target/deephaven-benchmark-1.0-SNAPSHOT-tests.jar ${DISTRO_DEST}/libs/${ARTIFACT}-tests.jar
echo "VERSION=${RELEASE_VERSION}" > ${DISTRO_DEST}/.env
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ jobs:
working-directory: ${{env.RELEASE_DIR}}
run: git checkout ${COMMIT}

- name: Build Release Artifacts
- name: Pull and Start Docker Image
working-directory: ${{env.RELEASE_DIR}}
run: |
cp ${LATEST_DIR}/.github/resources/integration-docker-compose.yml docker-compose.yml
docker compose up -d
- name: Build Release Artifacts
- name: Build and Install Release Artifacts Locally
working-directory: ${{env.RELEASE_DIR}}
run: |
mvn -B verify --file pom.xml
mvn -B install --file pom.xml
docker compose down
- name: Build Release Distro and Notes
Expand Down
20 changes: 0 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,6 @@
<target>21</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down

0 comments on commit 686f77c

Please sign in to comment.