-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move job cache framework into lib-orch * Use plugin manager to create the job cache * Add jobCache section to sample config files * Rename CacheEntry * Consistent naming for cache entry getters * Clean up job cache API * Start adding some basic tests for the job cache interface * Do not increment cache revision on open ticket (only on modifying operations) * Test stubs for job cache ticket mgmt * Move local cache implementation of cache test suite into its own test class * Job cache tests for openNewTicket() * Job cache fixes needed for test suite * Work on job cache tests * Let local executor unit test work on windows * Include run config for lib orch unit tests * Finish tests for openTicket() * Add a test to ensure transient members are not stored in the cache * Add a test to check caching for different data types * Change executor API to use Java Serializable for job state, rather than protobuf * Change local batch executor to match updates in executor API * Change SSH batch executor to match updates in executor API * Cache corruption error class * Update job cache interface * Rename CacheTicket for job cache * Update local job cache impl to match changes in cache API * Update job cache test suite for API changes * Update executor basic test suite for API changes * Update orch service implementation after job cache changes * Update orch API method impl for checkJob * New LocalBatchState without protobuf * Remove protobuf dependency from -lib-orch * Fix a warning in CacheTicket * Compile time type safety on the job cache * Fix imports for orch service main class * Add tests for closing cache tickets * Add illegal arg check for closing a ticket * Make superseded() return true after ticket expiry time * Handle duplicate tickets for new items in local job cache * Fix some IDEA warnings * Remove protobuf dependency for SSH executor * No longer necessary to force versions of transitive dependencies for the SSH executor (this is managed automatically in settings.gradle) * Start sketching out tests for cache CRUD operations * Introduce the concept of cache manager to create strongly-typed cache instances * Update plugin framework to give out cache manager instances rather than typed cache instances * Use the new cache manager to set up the job cache in the orchestrator * Fill in some unit tests for the job cache * Fail for tests not added yet * Job cache testing work * New exception for invalid cache operations * Test stubs for cache CRUD operations * Job cache test cases for readEntry() * First pass on CRUD unit tests for job cache * Rename job cache CRUD operations * Valid entry status in job cache * No expiry for missing cache tickets * Fix expected exception types for missing / new tickets * Fix remaining tests for job cache * Bump dependency versions for compliance * Fix use info and executor state in job cache * Force update of Nimbus JWT version for Azure SDK * Increase timeout on compliance jobs
- Loading branch information
Martin Traverse
authored
Feb 24, 2024
1 parent
4ed4e3d
commit f1204c4
Showing
40 changed files
with
3,449 additions
and
651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,10 @@ executor: | |
venvPath: C:\Dev\trac\venv | ||
|
||
|
||
jobCache: | ||
protocol: LOCAL | ||
|
||
|
||
instances: | ||
|
||
meta: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Unit tests: -lib-orch" type="JUnit" factoryName="JUnit"> | ||
<module name="tracdap.tracdap-lib-orch.test" /> | ||
<option name="MAIN_CLASS_NAME" value="" /> | ||
<option name="METHOD_NAME" value="" /> | ||
<option name="TEST_OBJECT" value="tags" /> | ||
<option name="VM_PARAMETERS" value="-ea --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true" /> | ||
<tag value="!integration & !slow" /> | ||
<method v="2"> | ||
<option name="Make" enabled="true" /> | ||
</method> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...tracdap-lib-common/src/main/java/org/finos/tracdap/common/exception/ECacheCorruption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2023 Accenture Global Solutions Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.finos.tracdap.common.exception; | ||
|
||
|
||
/** | ||
* Thrown when a cache entry has become corrupt | ||
* | ||
* <p>This error indicates that an individual cache entry has become corrupt and is no longer | ||
* readable. TRAC will try to handle this error so that individual corrupt entries do not | ||
* pollute the cache and stop it from functioning. For cache query operations corrupt | ||
* entries will be returned with no value, cacheError() will return an ECacheCorruption error. | ||
* Calls to getEntry() will throw this exception if the entry is corrupt. | ||
* | ||
* <p>One cause of cache corruption is jobs in the cache that reference old class files. | ||
* This could happen after the upgrade of an executor plugin, if there are incompatible | ||
* changes in the executor state class. Although TRAC has error handling to clean up affected | ||
* jobs, executors should take care when updating their state classes to avoid this issue.</p> | ||
*/ | ||
public class ECacheCorruption extends ECache { | ||
|
||
public ECacheCorruption(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public ECacheCorruption(String message) { | ||
super(message); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
.../tracdap-lib-common/src/main/java/org/finos/tracdap/common/exception/ECacheDuplicate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2023 Accenture Global Solutions Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.finos.tracdap.common.exception; | ||
|
||
/** | ||
* Job already exists in the orchestrator service | ||
*/ | ||
public class ECacheDuplicate extends ECache { | ||
|
||
public ECacheDuplicate(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public ECacheDuplicate(String message) { | ||
super(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.