From 04ec1068a80791f356d3517300eb1bb02f956ddb Mon Sep 17 00:00:00 2001 From: Ramon Figueiredo Date: Thu, 27 Jul 2023 16:13:34 -0700 Subject: [PATCH] Prevent booking frames on hosts with full temporary directory - Code refactoring - Change comments, variables and methods reference from "mcp" to "temporary directory" or "TempDir" --- .../com/imageworks/spcue/dao/HostDao.java | 6 +- .../spcue/dao/postgres/HostDaoJdbc.java | 4 +- .../spcue/dispatcher/HostReportHandler.java | 56 +++++++++---------- .../imageworks/spcue/service/HostManager.java | 6 +- .../spcue/service/HostManagerService.java | 4 +- cuebot/src/main/resources/opencue.properties | 6 +- .../test/dao/criteria/ProcSearchTests.java | 2 +- .../test/dao/postgres/BookingDaoTests.java | 2 +- .../test/dao/postgres/CommentDaoTests.java | 2 +- .../spcue/test/dao/postgres/DeedDaoTests.java | 2 +- .../dao/postgres/DispatcherDaoFifoTests.java | 2 +- .../test/dao/postgres/DispatcherDaoTests.java | 2 +- .../test/dao/postgres/FrameDaoTests.java | 2 +- .../spcue/test/dao/postgres/HostDaoTests.java | 2 +- .../spcue/test/dao/postgres/ProcDaoTests.java | 2 +- .../spcue/test/dao/postgres/ShowDaoTests.java | 2 +- .../test/dao/postgres/WhiteboardDaoTests.java | 2 +- .../CoreUnitDispatcherGpuJobTests.java | 2 +- .../CoreUnitDispatcherGpuTests.java | 2 +- .../CoreUnitDispatcherGpusJobTests.java | 2 +- .../dispatcher/CoreUnitDispatcherTests.java | 2 +- .../test/dispatcher/DispatchSupportTests.java | 2 +- .../dispatcher/FrameCompleteHandlerTests.java | 4 +- .../test/dispatcher/HistoryControlTests.java | 2 +- .../dispatcher/HostReportHandlerGpuTests.java | 2 +- .../dispatcher/HostReportHandlerTests.java | 50 ++++++++--------- .../test/dispatcher/LocalDispatcherTests.java | 2 +- .../test/dispatcher/RedirectManagerTests.java | 2 +- .../test/dispatcher/StrandedCoreTests.java | 2 +- .../test/dispatcher/TestBookingQueue.java | 2 +- .../test/service/BookingManagerTests.java | 2 +- .../spcue/test/service/HostManagerTests.java | 2 +- .../spcue/test/service/JobManagerTests.java | 2 +- .../spcue/test/service/OwnerManagerTests.java | 2 +- cuebot/src/test/resources/opencue.properties | 6 +- 35 files changed, 97 insertions(+), 97 deletions(-) diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/HostDao.java b/cuebot/src/main/java/com/imageworks/spcue/dao/HostDao.java index 5686ff1d1..5ed18947e 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/HostDao.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/HostDao.java @@ -79,12 +79,12 @@ public interface HostDao { void updateHostState(HostInterface host, HardwareState state); /** - * updates a host with the passed free Mcp + * updates a host with the passed free temporary directory * * @param host - * @param freeMcp + * @param freeTempDir */ - void updateHostFreeMcp(HostInterface host, Long freeMcp); + void updateHostFreeTempDir(HostInterface host, Long freeTempDir); /** * returns a full host detail diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java index a858be744..6fe898b44 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java @@ -524,10 +524,10 @@ public void updateHostState(HostInterface host, HardwareState state) { } @Override - public void updateHostFreeMcp(HostInterface host, Long freeMcp) { + public void updateHostFreeTempDir(HostInterface host, Long freeTempDir) { getJdbcTemplate().update( "UPDATE host_stat SET int_mcp_free=? WHERE pk_host=?", - freeMcp, host.getHostId()); + freeTempDir, host.getHostId()); } @Override diff --git a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java index 37c7179a4..2adef34fb 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java @@ -89,8 +89,8 @@ public class HostReportHandler { @Autowired private CommentManager commentManager; // Comment constants - private static final String SUBJECT_COMMENT_FULL_MCP_DIR = "Host set to REPAIR for not having enough storage " + - "space on /mcp"; + private static final String SUBJECT_COMMENT_FULL_TEMP_DIR = "Host set to REPAIR for not having enough storage " + + "space on the temporary directory (mcp)"; private static final String CUEBOT_COMMENT_USER = "cuebot"; /** @@ -233,12 +233,12 @@ public void handleHostReport(HostReport report, boolean isBoot) { } } - // The minimum amount of free space in the MCP directory to book a host - Long minBookableFreeMCP = env.getRequiredProperty("dispatcher.min_bookable_free_mcp_kb", Long.class); + // The minimum amount of free space in the temporary directory to book a host + Long minBookableFreeTempDir = env.getRequiredProperty("dispatcher.min_bookable_free_temp_dir_kb", Long.class); - if (minBookableFreeMCP != -1 && report.getHost().getFreeMcp() < minBookableFreeMCP) { - msg = String.format("%s doens't have enough free space in the /mcp directory, %dMB needs %dMB", - host.name, (report.getHost().getFreeMcp()/1024), (minBookableFreeMCP/1024)); + if (minBookableFreeTempDir != -1 && report.getHost().getFreeMcp() < minBookableFreeTempDir) { + msg = String.format("%s doens't have enough free space in the temporary directory (mcp), %dMB needs %dMB", + host.name, (report.getHost().getFreeMcp()/1024), (minBookableFreeTempDir/1024)); } else if (host.idleCores < Dispatcher.CORE_POINTS_RESERVED_MIN) { msg = String.format("%s doesn't have enough idle cores, %d needs %d", @@ -329,39 +329,39 @@ else if (!dispatchSupport.isCueBookable(host)) { * never updated via RQD. * * - * Prevent cue frames from booking on hosts with full MCP directories. + * Prevent cue frames from booking on hosts with full temporary directories. * * Change host state to REPAIR or UP according the amount of free space - * in the /mcp directory: + * in the temporary directory: * - Set the host state to REPAIR, when the amount of free space in the - * /mcp directory is less than the minimum required. Add a comment with - * subject: "Action required. Host status = Repair. Reason: Full /mcp directory". - * - Set the host state to UP, when the amount of free space in the /mcp directory + * temporary directory is less than the minimum required. Add a comment with + * subject: SUBJECT_COMMENT_FULL_TEMP_DIR + * - Set the host state to UP, when the amount of free space in the temporary directory * is greater or equals to the minimum required and the host has a comment with - * subject: "Action required. Host status = Repair. Reason: Full /mcp directory". + * subject: SUBJECT_COMMENT_FULL_TEMP_DIR * * @param host * @param reportState * @param isBoot - * @param freeMcp + * @param freeTempDir */ - private void changeHardwareState(DispatchHost host, HardwareState reportState, boolean isBoot, long freeMcp) { + private void changeHardwareState(DispatchHost host, HardwareState reportState, boolean isBoot, long freeTempDir) { - // The minimum amount of free space in the MCP directory to book a host - Long minBookableFreeMCP = env.getRequiredProperty("dispatcher.min_bookable_free_mcp_kb", Long.class); + // The minimum amount of free space in the temporary directory to book a host + Long minBookableFreeTempDir = env.getRequiredProperty("dispatcher.min_bookable_free_temp_dir_kb", Long.class); - // Prevent cue frames from booking on hosts with full MCP directories - if (minBookableFreeMCP != -1) { - if (host.hardwareState == HardwareState.UP && freeMcp < minBookableFreeMCP) { + // Prevent cue frames from booking on hosts with full temporary directories + if (minBookableFreeTempDir != -1) { + if (host.hardwareState == HardwareState.UP && freeTempDir < minBookableFreeTempDir) { - // Insert a comment indicating that the Host status = Repair with reason = Full /mcp directory + // Insert a comment indicating that the Host status = Repair with reason = Full temporary directory CommentDetail c = new CommentDetail(); - c.subject = SUBJECT_COMMENT_FULL_MCP_DIR; + c.subject = SUBJECT_COMMENT_FULL_TEMP_DIR; c.user = CUEBOT_COMMENT_USER; c.timestamp = null; - c.message = "Host " + host.getName() + " marked as REPAIR. The current amount of free space in /mcp is " + - (freeMcp/1024) + "MB. It must have at least " + (minBookableFreeMCP/1024) + - "MB of free space in /mcp"; + c.message = "Host " + host.getName() + " marked as REPAIR. The current amount of free space in the " + + "temporary directory (mcp) is " + (freeTempDir/1024) + "MB. It must have at least " + + (minBookableFreeTempDir/1024) + "MB of free space in temporary directory"; commentManager.addComment(host, c); // Set the host state to REPAIR @@ -369,11 +369,11 @@ private void changeHardwareState(DispatchHost host, HardwareState reportState, b host.hardwareState = HardwareState.REPAIR; return; - } else if (host.hardwareState == HardwareState.REPAIR && freeMcp >= minBookableFreeMCP) { - // Check if the host with REPAIR status has comments with subject=SUBJECT_COMMENT_FULL_MCP_DIR and + } else if (host.hardwareState == HardwareState.REPAIR && freeTempDir >= minBookableFreeTempDir) { + // Check if the host with REPAIR status has comments with subject=SUBJECT_COMMENT_FULL_TEMP_DIR and // user=CUEBOT_COMMENT_USER and delete the comments, if they exists boolean commentsDeleted = commentManager.deleteCommentByHostUserAndSubject(host, - CUEBOT_COMMENT_USER, SUBJECT_COMMENT_FULL_MCP_DIR); + CUEBOT_COMMENT_USER, SUBJECT_COMMENT_FULL_TEMP_DIR); if (commentsDeleted) { // Set the host state to UP diff --git a/cuebot/src/main/java/com/imageworks/spcue/service/HostManager.java b/cuebot/src/main/java/com/imageworks/spcue/service/HostManager.java index b2602bba6..aaf401688 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/service/HostManager.java +++ b/cuebot/src/main/java/com/imageworks/spcue/service/HostManager.java @@ -63,12 +63,12 @@ public interface HostManager { void setHostState(HostInterface host, HardwareState state); /** - * Updates the freeMcp of a host. + * Updates the free temporary directory (mcp) of a host. * * @param host HostInterface - * @param freeMcp Long + * @param freeTempDir Long */ - void setHostFreeMcp(HostInterface host, Long freeMcp); + void setHostFreeTempDir(HostInterface host, Long freeTempDir); /** * Return true if the host is swapping hard enough diff --git a/cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java b/cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java index 0ec348c09..a1533d695 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java +++ b/cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java @@ -94,8 +94,8 @@ public void setHostState(HostInterface host, HardwareState state) { } @Override - public void setHostFreeMcp(HostInterface host, Long freeMcp) { - hostDao.updateHostFreeMcp(host, freeMcp); + public void setHostFreeTempDir(HostInterface host, Long freeTempDir) { + hostDao.updateHostFreeTempDir(host, freeTempDir); } @Override diff --git a/cuebot/src/main/resources/opencue.properties b/cuebot/src/main/resources/opencue.properties index a01c3028e..6b2875899 100644 --- a/cuebot/src/main/resources/opencue.properties +++ b/cuebot/src/main/resources/opencue.properties @@ -110,11 +110,11 @@ dispatcher.report_queue.max_pool_size=8 # Queue capacity for handling Host Report. dispatcher.report_queue.queue_capacity=1000 -# The minimum amount of free space in the MCP directory to book a host. -# E.g: 1G = 1048576 kB => dispatcher.min_bookable_free_mcp_kb=1048576 +# The minimum amount of free space in the temporary directory (mcp) to book a host. +# E.g: 1G = 1048576 kB => dispatcher.min_bookable_free_temp_dir_kb=1048576 # Default = -1 (deactivated) # If equals to -1, it means the feature is turned off -dispatcher.min_bookable_free_mcp_kb=-1 +dispatcher.min_bookable_free_temp_dir_kb=-1 # Number of threads to keep in the pool for kill frame operation. dispatcher.kill_queue.core_pool_size=6 diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/criteria/ProcSearchTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/criteria/ProcSearchTests.java index 5b2d976ca..0daed1894 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/criteria/ProcSearchTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/criteria/ProcSearchTests.java @@ -209,7 +209,7 @@ private void launchJobs() { private RenderHost.Builder buildRenderHost() { return RenderHost.newBuilder() .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/BookingDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/BookingDaoTests.java index 015b36b40..74ee5f0d2 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/BookingDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/BookingDaoTests.java @@ -96,7 +96,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName("test_host") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/CommentDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/CommentDaoTests.java index 0f48e4b0c..506c09c57 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/CommentDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/CommentDaoTests.java @@ -140,7 +140,7 @@ public void testInsertCommentOnHost() { RenderHost host = RenderHost.newBuilder() .setName("boo") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(15290520) .setFreeSwap(2076) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DeedDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DeedDaoTests.java index 7074daff4..f00530ff6 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DeedDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DeedDaoTests.java @@ -73,7 +73,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName("test_host") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(15290520) .setFreeSwap(2076) 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 3d2d2ded6..487dc2f6e 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 @@ -147,7 +147,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoTests.java index 57a640de2..a4ec4cf78 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/DispatcherDaoTests.java @@ -146,7 +146,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/FrameDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/FrameDaoTests.java index 30d33117f..8cbda8c7f 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/FrameDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/FrameDaoTests.java @@ -114,7 +114,7 @@ public void create() { RenderHost host = RenderHost.newBuilder() .setName(HOST) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/HostDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/HostDaoTests.java index 8d91aaa44..2b50e57b2 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/HostDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/HostDaoTests.java @@ -86,7 +86,7 @@ public static RenderHost buildRenderHost(String name) { RenderHost host = RenderHost.newBuilder() .setName(name) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(15290520) .setFreeSwap((int) CueUtil.MB512) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ProcDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ProcDaoTests.java index ad6d0e7c4..803b13752 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ProcDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ProcDaoTests.java @@ -118,7 +118,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName("beta") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ShowDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ShowDaoTests.java index db251a61f..b6336f2e9 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ShowDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/ShowDaoTests.java @@ -71,7 +71,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName("test_host") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/WhiteboardDaoTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/WhiteboardDaoTests.java index a6f1eb3b5..40fff6b62 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/WhiteboardDaoTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dao/postgres/WhiteboardDaoTests.java @@ -266,7 +266,7 @@ public RenderHost getRenderHost() { RenderHost host = RenderHost.newBuilder() .setName(HOST) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) Dispatcher.MEM_RESERVED_MIN * 4) .setFreeSwap(2076) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuJobTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuJobTests.java index 77b5253db..4251b4f34 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuJobTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuJobTests.java @@ -100,7 +100,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) CueUtil.GB8) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuTests.java index e09f313f3..10487b69f 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpuTests.java @@ -100,7 +100,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) CueUtil.GB8) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpusJobTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpusJobTests.java index affbabad2..9b32a04a7 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpusJobTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherGpusJobTests.java @@ -112,7 +112,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) CueUtil.GB8) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherTests.java index a6e746d0f..decf5b523 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/CoreUnitDispatcherTests.java @@ -99,7 +99,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/DispatchSupportTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/DispatchSupportTests.java index c2a1ae19e..751b1dd96 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/DispatchSupportTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/DispatchSupportTests.java @@ -96,7 +96,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/FrameCompleteHandlerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/FrameCompleteHandlerTests.java index a9e2f94d7..224e30eaa 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/FrameCompleteHandlerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/FrameCompleteHandlerTests.java @@ -115,7 +115,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) CueUtil.GB8) .setFreeSwap(20760) @@ -140,7 +140,7 @@ public void createHost() { RenderHost host2 = RenderHost.newBuilder() .setName(HOSTNAME2) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) CueUtil.GB4) .setFreeSwap((int) CueUtil.GB4) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HistoryControlTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HistoryControlTests.java index 5bd5fd648..a31361a52 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HistoryControlTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HistoryControlTests.java @@ -102,7 +102,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) CueUtil.GB8) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerGpuTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerGpuTests.java index afb199835..e19639825 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerGpuTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerGpuTests.java @@ -81,7 +81,7 @@ private static RenderHost getRenderHost() { return RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java index 593f59eed..9fd145005 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java @@ -86,8 +86,8 @@ public class HostReportHandlerTests extends TransactionalTest { private static final String NEW_HOSTNAME = "gamma"; private String hostname; private String hostname2; - private static final String SUBJECT_COMMENT_FULL_MCP_DIR = "Host set to REPAIR for not having enough storage " + - "space on /mcp"; + private static final String SUBJECT_COMMENT_FULL_TEMP_DIR = "Host set to REPAIR for not having enough storage " + + "space on the temporary directory (mcp)"; private static final String CUEBOT_COMMENT_USER = "cuebot"; @Before @@ -122,7 +122,7 @@ private static RenderHost getRenderHost(String hostname, HardwareState state) { return RenderHost.newBuilder() .setName(hostname) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem((int) CueUtil.GB8) .setFreeSwap(20760) @@ -142,12 +142,12 @@ private static RenderHost getRenderHost(String hostname, HardwareState state) { .build(); } - private static RenderHost getRenderHost(String hostname, HardwareState state, Long freeMcp) { + private static RenderHost getRenderHost(String hostname, HardwareState state, Long freeTempDir) { return RenderHost.newBuilder() .setName(hostname) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. - .setFreeMcp(freeMcp) + // The minimum amount of free space in the temporary directory to book a host. + .setFreeMcp(freeTempDir) .setFreeMem((int) CueUtil.GB8) .setFreeSwap(20760) .setLoad(0) @@ -170,7 +170,7 @@ private static RenderHost getNewRenderHost(String tags) { return RenderHost.newBuilder() .setName(NEW_HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) @@ -298,7 +298,7 @@ public void testHandleHostReportWithNonExistentTags() { @Test @Transactional @Rollback(true) - public void testHandleHostReportWithFullMCPDirectories() { + public void testHandleHostReportWithFullTemporaryDirectories() { // Create CoreDetail CoreDetail cores = getCoreDetail(200, 200, 0, 0); @@ -307,32 +307,32 @@ public void testHandleHostReportWithFullMCPDirectories() { * Precondition: * - HardwareState=UP * Action: - * - Receives a HostReport with freeMCP < dispatcher.min_bookable_free_mcp_kb (opencue.properties) + * - Receives a HostReport with freeTempDir < dispatcher.min_bookable_free_temp_dir_kb (opencue.properties) * Postcondition: * - Host hardwareState changes to REPAIR - * - A comment is created with subject=SUBJECT_COMMENT_FULL_MCP_DIR and user=CUEBOT_COMMENT_USER + * - A comment is created with subject=SUBJECT_COMMENT_FULL_TEMP_DIR and user=CUEBOT_COMMENT_USER * */ // Create HostReport HostReport report1 = HostReport.newBuilder() .setHost(getRenderHost(hostname, HardwareState.UP, 1024L)) .setCoreInfo(cores) .build(); - // Call handleHostReport() => Create the comment with subject=SUBJECT_COMMENT_FULL_MCP_DIR and change the host's - // hardwareState to REPAIR + // Call handleHostReport() => Create the comment with subject=SUBJECT_COMMENT_FULL_TEMP_DIR and change the + // host's hardwareState to REPAIR hostReportHandler.handleHostReport(report1, false); // Get host DispatchHost host = getHost(hostname); // Get list of comments by host, user, and subject List comments = commentManager.getCommentsByHostUserAndSubject(host, CUEBOT_COMMENT_USER, - SUBJECT_COMMENT_FULL_MCP_DIR); + SUBJECT_COMMENT_FULL_TEMP_DIR); // Check if there is 1 comment assertEquals(comments.size(), 1); // Get host comment CommentDetail comment = comments.get(0); // Check if the comment has the user = CUEBOT_COMMENT_USER assertEquals(comment.user, CUEBOT_COMMENT_USER); - // Check if the comment has the subject = SUBJECT_COMMENT_FULL_MCP_DIR - assertEquals(comment.subject, SUBJECT_COMMENT_FULL_MCP_DIR); + // Check if the comment has the subject = SUBJECT_COMMENT_FULL_TEMP_DIR + assertEquals(comment.subject, SUBJECT_COMMENT_FULL_TEMP_DIR); // Check host lock state assertEquals(LockState.OPEN, host.lockState); // Check if host hardware state is REPAIR @@ -347,26 +347,26 @@ public void testHandleHostReportWithFullMCPDirectories() { * Test 2: * Precondition: * - HardwareState=REPAIR - * - There is a comment for the host with subject=SUBJECT_COMMENT_FULL_MCP_DIR and user=CUEBOT_COMMENT_USER + * - There is a comment for the host with subject=SUBJECT_COMMENT_FULL_TEMP_DIR and user=CUEBOT_COMMENT_USER * Action: - * - Receives a HostReport with freeMCP >= dispatcher.min_bookable_free_mcp_kb (opencue.properties) + * - Receives a HostReport with freeTempDir >= dispatcher.min_bookable_free_temp_dir_kb (opencue.properties) * Postcondition: * - Host hardwareState changes to UP - * - Comment with subject=SUBJECT_COMMENT_FULL_MCP_DIR and user=CUEBOT_COMMENT_USER gets deleted + * - Comment with subject=SUBJECT_COMMENT_FULL_TEMP_DIR and user=CUEBOT_COMMENT_USER gets deleted * */ - // Set the host freeMcp to the minimum size required = 1GB (1048576 KB) + // Set the host freeTempDir to the minimum size required = 1GB (1048576 KB) HostReport report2 = HostReport.newBuilder() .setHost(getRenderHost(hostname, HardwareState.UP, 1048576L)) .setCoreInfo(cores) .build(); - // Call handleHostReport() => Delete the comment with subject=SUBJECT_COMMENT_FULL_MCP_DIR and change the host's - // hardwareState to UP + // Call handleHostReport() => Delete the comment with subject=SUBJECT_COMMENT_FULL_TEMP_DIR and change the + // host's hardwareState to UP hostReportHandler.handleHostReport(report2, false); // Get host host = getHost(hostname); // Get list of comments by host, user, and subject comments = commentManager.getCommentsByHostUserAndSubject(host, CUEBOT_COMMENT_USER, - SUBJECT_COMMENT_FULL_MCP_DIR); + SUBJECT_COMMENT_FULL_TEMP_DIR); // Check if there is no comment associated with the host assertEquals(comments.size(), 0); // Check host lock state @@ -383,7 +383,7 @@ public void testHandleHostReportWithFullMCPDirectories() { @Test @Transactional @Rollback(true) - public void testHandleHostReportWithHardwareStateRepairNotRelatedToFullMCPdirectories() { + public void testHandleHostReportWithHardwareStateRepairNotRelatedToFullTempDir() { // Create CoreDetail CoreDetail cores = getCoreDetail(200, 200, 0, 0); @@ -407,12 +407,12 @@ public void testHandleHostReportWithHardwareStateRepairNotRelatedToFullMCPdirect host.hardwareState = HardwareState.REPAIR; // Get list of comments by host, user, and subject List hostComments = commentManager.getCommentsByHostUserAndSubject(host, CUEBOT_COMMENT_USER, - SUBJECT_COMMENT_FULL_MCP_DIR); + SUBJECT_COMMENT_FULL_TEMP_DIR); // Check if there is no comment assertEquals(hostComments.size(), 0); // There is no comment to delete boolean commentsDeleted = commentManager.deleteCommentByHostUserAndSubject(host, - CUEBOT_COMMENT_USER, SUBJECT_COMMENT_FULL_MCP_DIR); + CUEBOT_COMMENT_USER, SUBJECT_COMMENT_FULL_TEMP_DIR); assertFalse(commentsDeleted); // Call handleHostReport() hostReportHandler.handleHostReport(report, false); diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/LocalDispatcherTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/LocalDispatcherTests.java index 1053b5bcf..499f00b5f 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/LocalDispatcherTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/LocalDispatcherTests.java @@ -95,7 +95,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/RedirectManagerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/RedirectManagerTests.java index ba7b6c5f5..15020e29b 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/RedirectManagerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/RedirectManagerTests.java @@ -137,7 +137,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/StrandedCoreTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/StrandedCoreTests.java index 1cf59140b..eb864cae0 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/StrandedCoreTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/StrandedCoreTests.java @@ -98,7 +98,7 @@ public void createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/TestBookingQueue.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/TestBookingQueue.java index 348e1b291..25f52a5d9 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/TestBookingQueue.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/TestBookingQueue.java @@ -64,7 +64,7 @@ public void create() { RenderHost host = RenderHost.newBuilder() .setName(HOSTNAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/service/BookingManagerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/service/BookingManagerTests.java index 2235279f8..911dce125 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/service/BookingManagerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/service/BookingManagerTests.java @@ -112,7 +112,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName("test_host") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/service/HostManagerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/service/HostManagerTests.java index 1d585d149..67bbaa7da 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/service/HostManagerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/service/HostManagerTests.java @@ -101,7 +101,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName(HOST_NAME) .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(15290520) .setFreeSwap(2076) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/service/JobManagerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/service/JobManagerTests.java index 057f4eafa..fc9c9b020 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/service/JobManagerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/service/JobManagerTests.java @@ -129,7 +129,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName("test_host") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/service/OwnerManagerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/service/OwnerManagerTests.java index 93e305b7e..c96a6ad72 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/service/OwnerManagerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/service/OwnerManagerTests.java @@ -69,7 +69,7 @@ public DispatchHost createHost() { RenderHost host = RenderHost.newBuilder() .setName("test_host") .setBootTime(1192369572) - // The minimum amount of free space in the /mcp directory to book a host. + // The minimum amount of free space in the temporary directory to book a host. .setFreeMcp(1048576) .setFreeMem(53500) .setFreeSwap(20760) diff --git a/cuebot/src/test/resources/opencue.properties b/cuebot/src/test/resources/opencue.properties index db8923f00..00d0c4463 100644 --- a/cuebot/src/test/resources/opencue.properties +++ b/cuebot/src/test/resources/opencue.properties @@ -65,8 +65,8 @@ dispatcher.booking_queue.core_pool_size=6 dispatcher.booking_queue.max_pool_size=6 dispatcher.booking_queue.queue_capacity=1000 -# The minimum amount of free space in the MCP directory to book a host. -# E.g: 1G = 1048576 kB => dispatcher.min_bookable_free_mcp_kb=1048576 +# The minimum amount of free space in the temporary directory (mcp) to book a host. +# E.g: 1G = 1048576 kB => dispatcher.min_bookable_free_temp_dir_kb=1048576 # Default = 1G = 1048576 kB # If equals to -1, it means the feature is turned off -dispatcher.min_bookable_free_mcp_kb=1048576 \ No newline at end of file +dispatcher.min_bookable_free_temp_dir_kb=1048576 \ No newline at end of file