Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mGAP/src/org/labkey/mgap/mGAPModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void doStartupAfterSpringConfig(ModuleContext moduleContext)

ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Connection, "https://code.jquery.com", "https://*.fontawesome.com");
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Style, "https://code.jquery.com", "https://www.gstatic.com");
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Font, "https://*.fontawesome.com", "https://fonts.googleapis.com");
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Font, "https://*.fontawesome.com", "https://fonts.googleapis.com", "https://fonts.gstatic.com");
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Connection, "https://oss.maxcdn.com");

new PipelineStartup();
Expand Down
3,155 changes: 2,025 additions & 1,130 deletions mcc/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mcc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"google-palette": "^1.1.1"
},
"devDependencies": {
"@labkey/build": "^8.4.0",
"@labkey/build": "^9.1.0",
"@types/chart.js": "^2.9.41",
"@types/jexl": "^2.3.4",
"@types/jquery": "^3.5.32",
Expand Down
2 changes: 2 additions & 0 deletions mcc/resources/etls/snprc-parentage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</sourceColumns>
<sourceFilters>
<sourceFilter column="sire" operator="isnonblank" value=""/>
<sourceFilter column="date" operator="isnonblank" value=""/>
</sourceFilters>
</source>
<destination schemaName="study" queryName="parentage" targetOption="truncate" bulkLoad="true">
Expand Down Expand Up @@ -41,6 +42,7 @@
</sourceColumns>
<sourceFilters>
<sourceFilter column="dam" operator="isnonblank" value=""/>
<sourceFilter column="date" operator="isnonblank" value=""/>
</sourceFilters>
</source>
<destination schemaName="study" queryName="parentage" targetOption="append" bulkLoad="true">
Expand Down
2 changes: 2 additions & 0 deletions mcc/resources/queries/study/demographics.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function onInit(event, helper){
}

function onUpsert(helper, scriptErrors, row, oldRow){
row.objectId = row.objectId || (oldRow ? oldRow.objectId : null) || LABKEY.Utils.generateUUID().toUpperCase()

if (row.status && row.status.match(/Undetermined/)) {
row.status = 'Unknown';
}
Expand Down
20 changes: 14 additions & 6 deletions mcc/src/org/labkey/mcc/query/TriggerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.labkey.api.data.ContainerManager;
import org.labkey.api.data.DbSchema;
import org.labkey.api.data.DbSchemaType;
import org.labkey.api.data.DbScope;
import org.labkey.api.data.DbSequence;
import org.labkey.api.data.DbSequenceManager;
import org.labkey.api.data.SimpleFilter;
Expand All @@ -29,6 +30,7 @@
import org.labkey.api.security.ValidEmail;
import org.labkey.api.security.permissions.DeletePermission;
import org.labkey.api.settings.AppProps;
import org.labkey.api.study.StudyService;
import org.labkey.api.util.MailHelper;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.view.UnauthorizedException;
Expand All @@ -45,6 +47,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -281,16 +284,14 @@ public void possiblySendRabNotification(int reviewerId)
}
}

private TableInfo _mappingTable = null;

private TableInfo getMappingTable()
{
if (_mappingTable == null)
if (_animalMapping == null)
{
_mappingTable = QueryService.get().getUserSchema(_user, _container, MccSchema.NAME).getTable(MccSchema.TABLE_ANIMAL_MAPPING);
_animalMapping = QueryService.get().getUserSchema(_user, _container, MccSchema.NAME).getTable(MccSchema.TABLE_ANIMAL_MAPPING);
}

return _mappingTable;
return _animalMapping;
}

public @Nullable String getMccAlias(String id) {
Expand All @@ -299,6 +300,12 @@ private TableInfo getMappingTable()

public int ensureMccAliasExists(Collection<String> rawIds, Map<Object, Object> existingAliases)
{
if (DbScope.getLabKeyScope().getCurrentTransaction() != null && Objects.requireNonNull(DbScope.getLabKeyScope().getCurrentTransaction()).isAborted())
{
_log.info("No active transaction, skipping MCC ensureMccAliasExists()");
return 0;
}

// NOTE: The incoming object can convert numeric IDs from strings to int, so manually convert:
// Also, CaseInsensitiveSet will convert the keys to lowercase, which is problematic for case-sensitive databases
final CaseInsensitiveHashMap<String> idMap = new CaseInsensitiveHashMap<>();
Expand All @@ -313,7 +320,8 @@ public int ensureMccAliasExists(Collection<String> rawIds, Map<Object, Object> e
TableInfo ti = getMappingTable();
new TableSelector(ti, PageFlowUtil.set("subjectname", "externalAlias"), filter, null).forEachResults(rs -> {
aliasesFound.add(rs.getString(FieldKey.fromString("subjectname")));
if (ciExistingAliases.containsKey(rs.getString(FieldKey.fromString("subjectname")))) {
if (ciExistingAliases.containsKey(rs.getString(FieldKey.fromString("subjectname"))))
{
if (!ciExistingAliases.get(rs.getString(FieldKey.fromString("subjectname"))).equalsIgnoreCase(rs.getString(FieldKey.fromString("externalAlias"))))
{
_log.error("Incoming MCC alias for: " + rs.getString(FieldKey.fromString("subjectname")) + "(" + ciExistingAliases.get(rs.getString(FieldKey.fromString("subjectname"))) + ") does not match existing: " + rs.getString(FieldKey.fromString("externalAlias")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public List<ToolParameterDescriptor> getParams()
ToolParameterDescriptor.create("localDisk", "Local Disk (GB)", "Do not change this unless you are certain. Each job requests and uses local space (/mnt/scratch) for temp files. If your job will require more space, consider increasing this.", "ldk-integerfield", new JSONObject(){{
put("minValue", 512);
}}, 1028),
ToolParameterDescriptor.create("localSSD", "Request Nodes With SSD Scratch", "If selected, -C ssdscratch will be added to the submit script, which limits to node with faster SSD scratch space. This might be important for I/O intense jobs.", "checkbox", null, null),
ToolParameterDescriptor.create("gpus", "GPUs", "The number of GPUs requested for this job. If non-zero, the gpu partition will be used.", "ldk-integerfield", null, null),
ToolParameterDescriptor.create("useExperimentalPartition", "Use RHEL 9.6 Partition", "If selected, jobs will be submitted to the experimental rhel96TESTING partition.", "checkbox", null, null)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ public void addExtraSubmitScriptLines(PipelineJob job, RemoteExecutionEngine<?>
possiblyAddQOS(job, engine, lines);
possiblyAddHighIO(job, engine, lines);
possiblyAddDisk(job, engine, lines);
possiblyAddSSD(job, engine, lines);
possiblyAddGpus(job, engine, lines);
possiblyAddExclusive(job, engine, lines);
}
Expand Down Expand Up @@ -490,27 +489,6 @@ private void possiblyAddExclusive(PipelineJob job, RemoteExecutionEngine<?> engi
}
}

private void possiblyAddSSD(PipelineJob job, RemoteExecutionEngine<?> engine, List<String> lines)
{
Map<String, String> params = ((HasJobParams)job).getJobParams();
String val = StringUtils.trimToNull(params.get("resourceSettings.resourceSettings.localSSD"));
if (val == null)
{
return;
}

boolean parsed = Boolean.parseBoolean(val);
if (parsed)
{
job.getLogger().info("Requiring local SSD scratch space");
String line = "#SBATCH -C ssdscratch";
if (!lines.contains(line))
{
lines.add(line);
}
}
}

private void possiblyAddQOS(PipelineJob job, RemoteExecutionEngine<?> engine, List<String> lines)
{
//first remove existing
Expand Down
Loading