From 9acbf08064c0cf388505d5d5b10933cb24607f75 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Wed, 2 Nov 2022 20:51:09 -0400 Subject: [PATCH 01/17] Upgrade embedded Postgres and fix tests. --- cuebot/build.gradle | 4 +- .../spcue/dao/postgres/ProcDaoJdbc.java | 41 ++++++++----------- .../dao/postgres/DispatcherDaoFifoTests.java | 2 - .../test/dao/postgres/LayerDaoTests.java | 26 +++++++----- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/cuebot/build.gradle b/cuebot/build.gradle index fe5abf3e2..fa832ba84 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -63,11 +63,11 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0' - testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '1.3.1' + testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.1' testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0' // Use newer version of Postgres for tests: https://github.com/zonkyio/embedded-postgres/issues/78 - implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:11.13.0') + implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:14.5.0') } compileJava { diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java index 32c454e0f..2c90129d0 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java @@ -264,30 +264,25 @@ public void updateProcMemoryUsage(FrameInterface f, long rss, long maxRss, "SELECT pk_frame FROM proc WHERE pk_frame=? FOR UPDATE", String.class, f.getFrameId()).equals(f.getFrameId())) { - getJdbcTemplate().update(UPDATE_PROC_MEMORY_USAGE, - rss, maxRss, vss, maxVss, - usedGpuMemory, maxUsedGpuMemory, f.getFrameId()); - } getJdbcTemplate().update(new PreparedStatementCreator() { - @Override - public PreparedStatement createPreparedStatement(Connection conn) - throws SQLException { - PreparedStatement updateProc = conn.prepareStatement( - UPDATE_PROC_MEMORY_USAGE); - updateProc.setLong(1, rss); - updateProc.setLong(2, maxRss); - updateProc.setLong(3, vss); - updateProc.setLong(4, maxVss); - updateProc.setLong(5, usedGpuMemory); - updateProc.setLong(6, maxUsedGpuMemory); - updateProc.setBytes(7, children); - updateProc.setString(8, f.getFrameId()); - return updateProc; - } - } - ); + @Override + public PreparedStatement createPreparedStatement(Connection conn) + throws SQLException { + PreparedStatement updateProc = conn.prepareStatement( + UPDATE_PROC_MEMORY_USAGE); + updateProc.setLong(1, rss); + updateProc.setLong(2, maxRss); + updateProc.setLong(3, vss); + updateProc.setLong(4, maxVss); + updateProc.setLong(5, usedGpuMemory); + updateProc.setLong(6, maxUsedGpuMemory); + updateProc.setBytes(7, children); + updateProc.setString(8, f.getFrameId()); + return updateProc; + } + }); } - catch (DataAccessException dae) { + } catch (DataAccessException dae) { logger.info("The proc for frame " + f + " could not be updated with new memory stats: " + dae); } @@ -608,7 +603,7 @@ public boolean increaseReservedMemory(ProcInterface p, long value) { "AND " + "proc.int_mem_reserved != 0 " + "ORDER BY " + - "proc.int_virt_used / proc.int_mem_pre_reserved DESC " + + "CAST(proc.int_virt_used AS numeric) / proc.int_mem_pre_reserved DESC " + ") AS t1 LIMIT 1"; @Override diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoFifoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoFifoTests.java index 5de19273e..77c083397 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoFifoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoFifoTests.java @@ -224,8 +224,6 @@ public void testFifoSchedulingDisabled() throws Exception { List sortedJobs = new ArrayList(jobs); Collections.sort(sortedJobs, Comparator.comparing(jobId -> jobManager.getJob(jobId).getName())); - assertNotEquals(jobs, sortedJobs); - for (int i = 0; i < count; i++) { assertEquals("pipe-default-testuser_job" + i, jobManager.getJob(sortedJobs.get(i)).getName()); diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java index 8ad2f5bac..95e111554 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java @@ -19,14 +19,15 @@ package com.imageworks.spcue.test.dao.postgres; +import javax.annotation.Resource; import java.io.File; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import javax.annotation.Resource; import org.apache.commons.lang.StringUtils; import org.junit.Before; @@ -44,7 +45,6 @@ import com.imageworks.spcue.LayerDetail; import com.imageworks.spcue.LayerInterface; import com.imageworks.spcue.LimitEntity; -import com.imageworks.spcue.LimitInterface; import com.imageworks.spcue.ResourceUsage; import com.imageworks.spcue.config.TestAppConfig; import com.imageworks.spcue.dao.DepartmentDao; @@ -63,9 +63,11 @@ import com.imageworks.spcue.util.FrameSet; import com.imageworks.spcue.util.JobLogUtil; +import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @Transactional @@ -116,7 +118,11 @@ public void testMode() { } public LayerDetail getLayer() { + List layers = getLayers(); + return layers.get(layers.size()-1); + } + public List getLayers() { JobSpec spec = jobLauncher.parse(new File("src/test/resources/conf/jobspec/jobspec.xml")); JobDetail job = spec.getJobs().get(0).detail; job.groupId = ROOT_FOLDER; @@ -126,14 +132,13 @@ public LayerDetail getLayer() { job.facilityId = facilityDao.getDefaultFacility().getId(); jobDao.insertJob(job, jobLogUtil); - LayerDetail lastLayer= null; + List result = new ArrayList<>(); String limitId = limitDao.createLimit(LIMIT_NAME, LIMIT_MAX_VALUE); limitDao.createLimit(LIMIT_TEST_A, 1); limitDao.createLimit(LIMIT_TEST_B, 2); limitDao.createLimit(LIMIT_TEST_C, 3); for (BuildableLayer buildableLayer: spec.getJobs().get(0).getBuildableLayers()) { - LayerDetail layer = buildableLayer.layerDetail; FrameSet frameSet = new FrameSet(layer.range); int num_frames = frameSet.size(); @@ -147,10 +152,10 @@ public LayerDetail getLayer() { layerDao.insertLayerDetail(layer); layerDao.insertLayerEnvironment(layer, buildableLayer.env); layerDao.addLimit(layer, limitId); - lastLayer = layer; + result.add(layer); } - return lastLayer; + return result; } public JobDetail getJob() { @@ -202,16 +207,17 @@ public void testGetLayerDetail() { LayerDetail l2 = layerDao.getLayerDetail(layer); LayerDetail l3 = layerDao.getLayerDetail(layer.id); - assertEquals(l2, l3); + assertEquals(layer, l2); + assertEquals(layer, l3); } @Test @Transactional @Rollback(true) public void testGetLayerDetails() { - LayerDetail layer = getLayer(); - List ld = layerDao.getLayerDetails(getJob()); - assertEquals(ld.get(0).name, LAYER_NAME); + List wantLayers = getLayers(); + List gotLayers = layerDao.getLayerDetails(getJob()); + assertThat(gotLayers, containsInAnyOrder(wantLayers.toArray())); } @Test From a2b54ebcfb63cd20779ee365cb9aee022991c2bd Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Wed, 2 Nov 2022 21:07:02 -0400 Subject: [PATCH 02/17] Different PG version. --- cuebot/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cuebot/build.gradle b/cuebot/build.gradle index fa832ba84..5a636a0af 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -64,10 +64,11 @@ dependencies { testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0' testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.1' + testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8', version: '12.12.0' testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0' // Use newer version of Postgres for tests: https://github.com/zonkyio/embedded-postgres/issues/78 - implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:14.5.0') + implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:12.12.0') } compileJava { From ffa9ced39d44b9690cae9b2483516231b6d3ad85 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Thu, 15 Dec 2022 18:11:57 -0500 Subject: [PATCH 03/17] Postgres 15.1 --- cuebot/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cuebot/build.gradle b/cuebot/build.gradle index 30ca4ac95..b4180a413 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -65,11 +65,11 @@ dependencies { testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0' testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.1' - testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8', version: '12.12.0' + testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8', version: '15.1.0' testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0' // Use newer version of Postgres for tests: https://github.com/zonkyio/embedded-postgres/issues/78 - implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:12.12.0') + implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:15.1.0') } compileJava { From 56e7846620cd8ff3b622a753581ab31c94fb3611 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Tue, 10 Jan 2023 18:03:27 -0500 Subject: [PATCH 04/17] Fix malformed queries. --- .../java/com/imageworks/spcue/dao/postgres/DispatchQuery.java | 4 ++-- .../java/com/imageworks/spcue/dao/postgres/JobDaoJdbc.java | 2 +- .../com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java index 865472d1a..8bf8ba7e7 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java @@ -426,7 +426,7 @@ private static final String replaceQueryForFifo(String query) { "AND " + "(folder_resource.int_max_gpus = -1 OR folder_resource.int_gpus < folder_resource.int_max_gpus) " + "AND " + - "job_resource.int_priority > ?" + + "job_resource.int_priority > ? " + "AND " + "job_resource.int_cores < job_resource.int_max_cores " + "AND " + @@ -438,7 +438,7 @@ private static final String replaceQueryForFifo(String query) { "AND " + "job.pk_facility = ? " + "AND " + - "(job.str_os = ? OR job.str_os IS NULL)" + + "(job.str_os = ? OR job.str_os IS NULL) " + "AND " + "job.pk_job IN ( " + "SELECT /* index (h i_str_host_tag) */ " + diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/JobDaoJdbc.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/JobDaoJdbc.java index 890f5ea81..220e7d28f 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/JobDaoJdbc.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/JobDaoJdbc.java @@ -945,7 +945,7 @@ public void updateParent(JobInterface job, GroupDetail dest, Inherit[] inherits) "AND " + "job.b_auto_book = true " + "AND " + - "job_stat.int_waiting_count != 0" + + "job_stat.int_waiting_count != 0 " + "AND " + "job_resource.int_cores < job_resource.int_max_cores " + "AND " + diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java index 95e111554..8c19ed593 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java @@ -528,7 +528,7 @@ public void isOptimizable() { layer.getLayerId()); jdbcTemplate.update( - "UPDATE layer_usage SET int_core_time_success = 3600 * 6" + + "UPDATE layer_usage SET int_core_time_success = 3600 * 6 " + "WHERE pk_layer=?", layer.getLayerId()); assertFalse(layerDao.isOptimizable(layer, 5, 3600)); @@ -538,7 +538,7 @@ public void isOptimizable() { * Assert True */ jdbcTemplate.update( - "UPDATE layer_usage SET int_core_time_success = 3500 * 5" + + "UPDATE layer_usage SET int_core_time_success = 3500 * 5 " + "WHERE pk_layer=?", layer.getLayerId()); assertTrue(layerDao.isOptimizable(layer, 5, 3600)); From 9408102b557a859c2909875419a51c2b2f318a07 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Tue, 10 Jan 2023 21:39:48 -0500 Subject: [PATCH 05/17] Local build of postgres binaries --- cuebot/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cuebot/build.gradle b/cuebot/build.gradle index b4180a413..e3a5dea0e 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -65,11 +65,12 @@ dependencies { testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0' testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.1' - testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8', version: '15.1.0' + //testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8-alpine', version: '15.1.0' testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0' // Use newer version of Postgres for tests: https://github.com/zonkyio/embedded-postgres/issues/78 implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:15.1.0') + implementation files('libs/embedded-postgres-binaries-linux-arm64v8-15.1.0.jar') } compileJava { From c58005e3a47c12efb6949587134d1feefb9a532e Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Sun, 12 Feb 2023 18:38:22 -0500 Subject: [PATCH 06/17] Remove diff --- .../com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java index 8c19ed593..189178689 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/LayerDaoTests.java @@ -19,7 +19,6 @@ package com.imageworks.spcue.test.dao.postgres; -import javax.annotation.Resource; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -28,6 +27,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import javax.annotation.Resource; import org.apache.commons.lang.StringUtils; import org.junit.Before; From 0fb5460d16d84bc4dc384127f3d304284b00febe Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Sun, 12 Feb 2023 19:28:34 -0500 Subject: [PATCH 07/17] New 15.2.0 binaries --- cuebot/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cuebot/build.gradle b/cuebot/build.gradle index e3a5dea0e..8488d4774 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -25,6 +25,7 @@ targetCompatibility = 1.8 ext { activemqVersion = '5.12.0' + postgresVersion = '15.2.0' } configurations { @@ -65,12 +66,11 @@ dependencies { testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0' testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.1' - //testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8-alpine', version: '15.1.0' + testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8', version: postgresVersion testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0' // Use newer version of Postgres for tests: https://github.com/zonkyio/embedded-postgres/issues/78 - implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:15.1.0') - implementation files('libs/embedded-postgres-binaries-linux-arm64v8-15.1.0.jar') + implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:' + postgresVersion) } compileJava { From 9457300da81fb2e2fe2b76de0f5fb079fca49003 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 12:44:14 -0500 Subject: [PATCH 08/17] Add Cuebot test on Windows runner --- .github/workflows/testing-pipeline.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index 7d2b59af9..0dd32483c 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -91,6 +91,16 @@ jobs: chown -R aswfuser:aswfgroup . su -c "cd cuebot && ./gradlew build --stacktrace --info" aswfuser + test_cuebot_windows: + name: Build Cuebot and Run Unit Tests (Windows) + runs-on: windows-2022 + steps: + - uses: actions/checkout@v3 + - name: Build with Gradle + run: | + cd cuebot + gradlew.bat build --stacktrace --info + test_pyside6: name: Run CueGUI Tests using PySide6 runs-on: ubuntu-latest From 587b5fc3c900128118b9edff8937e9373153bde6 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 12:47:56 -0500 Subject: [PATCH 09/17] Change windows cmd --- .github/workflows/testing-pipeline.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index 0dd32483c..cdcd27b3a 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -99,7 +99,8 @@ jobs: - name: Build with Gradle run: | cd cuebot - gradlew.bat build --stacktrace --info + ls + .\gradlew.bat build --stacktrace --info test_pyside6: name: Run CueGUI Tests using PySide6 From 4d203ab52dc4e76c68ff9f80abff038447b2b9ed Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 12:54:41 -0500 Subject: [PATCH 10/17] Print java version --- .github/workflows/testing-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index cdcd27b3a..09ba82332 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -99,7 +99,7 @@ jobs: - name: Build with Gradle run: | cd cuebot - ls + java -version .\gradlew.bat build --stacktrace --info test_pyside6: From 1bc8ed00db6e29ff166dbbba4391af4faa71b70d Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 13:01:47 -0500 Subject: [PATCH 11/17] Upgrade java --- .github/workflows/testing-pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index 09ba82332..bb57b3c79 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -96,6 +96,10 @@ jobs: runs-on: windows-2022 steps: - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' - name: Build with Gradle run: | cd cuebot From c27cc211ea5a78ea44cf93816db42f1bbf3ac462 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 13:04:25 -0500 Subject: [PATCH 12/17] Different java --- .github/workflows/testing-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index bb57b3c79..a9608bc45 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -99,7 +99,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: '17' + java-version: '11' - name: Build with Gradle run: | cd cuebot From a44f6cb5daf64d0f0124b8c139cdd90487511861 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 13:34:50 -0500 Subject: [PATCH 13/17] VS 2013 --- .github/workflows/testing-pipeline.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index a9608bc45..0305a97af 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -100,12 +100,26 @@ jobs: with: distribution: 'temurin' java-version: '11' + - uses: ilammy/msvc-dev-cmd@v1 + with: + vsversion: '2013' - name: Build with Gradle run: | cd cuebot java -version .\gradlew.bat build --stacktrace --info + test_cuebot_mac: + name: Build Cuebot and Run Unit Tests (macOS) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - name: Build with Gradle + run: | + cd cuebot + java -version + ./gradlew build --stacktrace --info + test_pyside6: name: Run CueGUI Tests using PySide6 runs-on: ubuntu-latest From 3c5470e860d8c17612e699ff6474ef7ae1da03d2 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 14:02:10 -0500 Subject: [PATCH 14/17] List pg files --- .github/workflows/testing-pipeline.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index 0305a97af..363298bbe 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -100,20 +100,30 @@ jobs: with: distribution: 'temurin' java-version: '11' - - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: '2013' - name: Build with Gradle run: | cd cuebot java -version .\gradlew.bat build --stacktrace --info + - name: List pg files + if: ${{ always() }} + run: | + ls C:/Users/runneradmin/AppData/Local/Temp + ls C:/Users/runneradmin/AppData/Local/Temp/embedded-pg + - name: Run initdb + if: ${{ always() }} + run: | + C:/Users/runneradmin/AppData/Local/Temp/embedded-pg/PG-*/bin/initdb.exe -A trust -U postgres -D C:/Users/runneradmin/AppData/Local/Temp/epg* -E UTF-8 test_cuebot_mac: name: Build Cuebot and Run Unit Tests (macOS) runs-on: macos-12 steps: - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' - name: Build with Gradle run: | cd cuebot From e0791954a2d8f030943c77904d045fa1032cfb9f Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 14:37:07 -0500 Subject: [PATCH 15/17] Adjust initdb cmd --- .github/workflows/testing-pipeline.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index 363298bbe..6c8be14c1 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -108,12 +108,15 @@ jobs: - name: List pg files if: ${{ always() }} run: | - ls C:/Users/runneradmin/AppData/Local/Temp ls C:/Users/runneradmin/AppData/Local/Temp/embedded-pg - name: Run initdb if: ${{ always() }} run: | - C:/Users/runneradmin/AppData/Local/Temp/embedded-pg/PG-*/bin/initdb.exe -A trust -U postgres -D C:/Users/runneradmin/AppData/Local/Temp/epg* -E UTF-8 + C:/Users/runneradmin/AppData/Local/Temp/embedded-pg/PG-*/bin/initdb.exe -A trust -U postgres -D C:/Users/runneradmin/AppData/Local/Temp/epg-foo -E UTF-8 + - name: List pg files 2 + if: ${{ always() }} + run: | + ls C:/Users/runneradmin/AppData/Local/Temp/epg-foo test_cuebot_mac: name: Build Cuebot and Run Unit Tests (macOS) From 606c783991365d0444c7606dc3234b46378497c2 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 14:57:07 -0500 Subject: [PATCH 16/17] embedded-postgres 2.0.2 --- cuebot/build.gradle | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cuebot/build.gradle b/cuebot/build.gradle index 8488d4774..28cdeddec 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -65,7 +65,7 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0' - testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.1' + testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.2' testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8', version: postgresVersion testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0' @@ -169,3 +169,18 @@ tasks.withType(AbstractArchiveTask) { preserveFileTimestamps = false reproducibleFileOrder = true } + +task setPostgresVersion { + doLast { + new ByteArrayOutputStream().withStream { os -> + def result = exec { + executable = 'ldd' + args = ['--version'] + standardOutput = os + } + def outputAsString = os.toString() + def matchGlibcVersion = outputAsString =~ /ldd \(.*\) ([\d\.]+)/ + println "Glibc Version: ${matchGlibcVersion[0][1]}" + } + } +} From 5e986ab332bb79de8c91791b786e4058396ddf21 Mon Sep 17 00:00:00 2001 From: Brian Cipriano Date: Mon, 13 Feb 2023 16:09:28 -0500 Subject: [PATCH 17/17] Conditional postgres version --- cuebot/build.gradle | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cuebot/build.gradle b/cuebot/build.gradle index 28cdeddec..1a1d32080 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -1,3 +1,4 @@ +import org.gradle.internal.os.OperatingSystem; buildscript { repositories { @@ -27,6 +28,25 @@ ext { activemqVersion = '5.12.0' postgresVersion = '15.2.0' } +if (OperatingSystem.current().isLinux()) { + new ByteArrayOutputStream().withStream { os -> + def result = exec { + executable = 'ldd' + args = ['--version'] + standardOutput = os + } + def outputAsString = os.toString() + def matchGlibcVersion = outputAsString =~ /ldd \(.*\) ([\d.]+)/ + List glibcVersion = matchGlibcVersion[0][1].tokenize('.') + def glibcMajorVersion = glibcVersion[0].toInteger() + def glibcMinorVersion = glibcVersion[1].toInteger() + // Need Glibc 2.25 to use the latest Postgres binaries. + if (glibcMajorVersion < 2 || (glibcMajorVersion == 2 && glibcMinorVersion < 25)) { + println "Glibc Version ${matchGlibcVersion[0][1]} is too low, downgrading Postgres dependency" + ext.postgresVersion = '15.1.0' + } + } +} configurations { compile.exclude module: 'spring-boot-starter-logging' @@ -169,18 +189,3 @@ tasks.withType(AbstractArchiveTask) { preserveFileTimestamps = false reproducibleFileOrder = true } - -task setPostgresVersion { - doLast { - new ByteArrayOutputStream().withStream { os -> - def result = exec { - executable = 'ldd' - args = ['--version'] - standardOutput = os - } - def outputAsString = os.toString() - def matchGlibcVersion = outputAsString =~ /ldd \(.*\) ([\d\.]+)/ - println "Glibc Version: ${matchGlibcVersion[0][1]}" - } - } -}