-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
1,170 additions
and
398 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
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
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
22 changes: 0 additions & 22 deletions
22
core/src/main/scala/cromwell/core/callcaching/CallCachingEligibility.scala
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
core/src/main/scala/cromwell/core/callcaching/MaybeCallCachingEligible.scala
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,19 @@ | ||
package cromwell.core.callcaching | ||
|
||
sealed trait MaybeCallCachingEligible { | ||
def dockerHash: Option[String] | ||
} | ||
|
||
sealed trait CallCachingEligible extends MaybeCallCachingEligible | ||
sealed trait CallCachingIneligible extends MaybeCallCachingEligible | ||
|
||
case object NoDocker extends CallCachingEligible { | ||
override def dockerHash: Option[String] = None | ||
} | ||
case class DockerWithHash(dockerAttribute: String) extends CallCachingEligible { | ||
override def dockerHash: Option[String] = Option(dockerAttribute) | ||
} | ||
|
||
case class FloatingDockerTagWithoutHash(dockerTag: String) extends CallCachingIneligible { | ||
override def dockerHash: Option[String] = None | ||
} |
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
36 changes: 36 additions & 0 deletions
36
database/migration/src/main/resources/changesets/docker_hash_store.xml
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,36 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"> | ||
|
||
<changeSet author="tjeandet" id="DOCKER_HASH_STORE_ENTRY"> | ||
<comment> | ||
Temporary storage area for docker hashes from workflows that are still in progress. | ||
</comment> | ||
<createTable tableName="DOCKER_HASH_STORE_ENTRY"> | ||
<column autoIncrement="true" name="DOCKER_HASH_STORE_ENTRY_ID" type="INT"> | ||
<constraints primaryKey="true" primaryKeyName="PK_DOCKER_HASH_STORE_ENTRY"/> | ||
</column> | ||
<column name="WORKFLOW_EXECUTION_UUID" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="DOCKER_TAG" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="DOCKER_HASH" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
<modifySql dbms="mysql"> | ||
<append value=" ENGINE=INNODB"/> | ||
</modifySql> | ||
</changeSet> | ||
|
||
<changeSet author="tjeandet" id="docker_hash_store_uuid_unique_constraint"> | ||
<addUniqueConstraint | ||
constraintName="UC_DOCKER_HASH_STORE_ENTRY_WEU_DT" | ||
tableName="DOCKER_HASH_STORE_ENTRY" | ||
columnNames="WORKFLOW_EXECUTION_UUID, DOCKER_TAG" /> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
42 changes: 42 additions & 0 deletions
42
database/sql/src/main/scala/cromwell/database/slick/DockerHashStoreSlickDatabase.scala
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,42 @@ | ||
package cromwell.database.slick | ||
|
||
import cats.instances.future._ | ||
import cats.syntax.functor._ | ||
import cromwell.database.sql.DockerHashStoreSqlDatabase | ||
import cromwell.database.sql.tables.DockerHashStoreEntry | ||
|
||
import scala.concurrent.{ExecutionContext, Future} | ||
import scala.language.postfixOps | ||
|
||
trait DockerHashStoreSlickDatabase extends DockerHashStoreSqlDatabase { | ||
this: SlickDatabase => | ||
|
||
import dataAccess.driver.api._ | ||
|
||
/** | ||
* Adds a docker hash entry to the store. | ||
*/ | ||
override def addDockerHashStoreEntry(dockerHashStoreEntry: DockerHashStoreEntry) | ||
(implicit ec: ExecutionContext): Future[Unit] = { | ||
val action = dataAccess.dockerHashStoreEntries += dockerHashStoreEntry | ||
runTransaction(action) void | ||
} | ||
|
||
/** | ||
* Retrieves docker hash entries for a workflow. | ||
* | ||
*/ | ||
override def queryDockerHashStoreEntries(workflowExecutionUuid: String) | ||
(implicit ec: ExecutionContext): Future[Seq[DockerHashStoreEntry]] = { | ||
val action = dataAccess.dockerHashStoreEntriesForWorkflowExecutionUuid(workflowExecutionUuid).result | ||
runTransaction(action) | ||
} | ||
|
||
/** | ||
* Deletes docker hash entries related to a workflow, returning the number of rows affected. | ||
*/ | ||
override def removeDockerHashStoreEntries(workflowExecutionUuid: String)(implicit ec: ExecutionContext): Future[Int] = { | ||
val action = dataAccess.dockerHashStoreEntriesForWorkflowExecutionUuid(workflowExecutionUuid).delete | ||
runTransaction(action) | ||
} | ||
} |
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.