Skip to content

Commit

Permalink
Merge pull request #431 from hms-dbmi-cellenics/biomage-changes-3
Browse files Browse the repository at this point in the history
Bump workerVersion to invalidate work results
  • Loading branch information
alexvpickering authored Mar 29, 2023
2 parents 75c6819 + 638a764 commit ab00c48
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/api.v2/helpers/pipeline/getPipelineStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const gem2sPipelineSteps = [
const seuratPipelineSteps = [
'DownloadSeurat',
'ProcessSeurat',
'UploadSeuratToAWS'
'UploadSeuratToAWS',
];

// pipelineStepNames are the names of pipeline steps for which we
Expand Down Expand Up @@ -292,7 +292,7 @@ const getPipelineStatus = async (experimentId, processName) => {
let response = null;

const { executionArn = null, stateMachineArn = null, lastStatusResponse } = pipelineExecution;
const shouldRerun = await shouldPipelineRerun(experimentId, processName);
const shouldRerun = await shouldPipelineRerun(experimentId, processName);

try {
execution = await stepFunctions.describeExecution({
Expand Down
6 changes: 5 additions & 1 deletion src/api.v2/helpers/pipeline/pipelineConstruct/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ const ExperimentExecution = require('../../../model/ExperimentExecution');
const getLogger = require('../../../../utils/getLogger');

const {
getGem2sPipelineSkeleton, getQcPipelineSkeleton, getSubsetPipelineSkeleton, getSeuratPipelineSkeleton,
getGem2sPipelineSkeleton,
getQcPipelineSkeleton,
getSubsetPipelineSkeleton,
getSeuratPipelineSkeleton,
} = require('./skeletons');

const { getQcStepsToRun, qcStepsWithFilterSettings } = require('./qcHelpers');
const needsBatchJob = require('../batch/needsBatchJob');

Expand Down
4 changes: 3 additions & 1 deletion src/api.v2/helpers/pipeline/shouldPipelineRerun.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ const getPipelineParams = async (experimentId, rawSamples = undefined) => {
};

const shouldPipelineRerun = async (experimentId, pipelineType) => {
const execution = await new ExperimentExecution().findOne({ experiment_id: experimentId, pipeline_type: pipelineType });
const execution = await new ExperimentExecution()
.findOne({ experiment_id: experimentId, pipeline_type: pipelineType });

if (execution === undefined) return true;
const currentParams = await getPipelineParams(experimentId);

Expand Down
2 changes: 1 addition & 1 deletion src/config/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const config = {
// Used for Batch reporting
datadogApiKey: process.env.DD_API_KEY || '',
datadogAppKey: process.env.DD_APP_KEY || '',
workerVersion: 3, // needs to match workerVersion in UI
workerVersion: 4, // needs to match workerVersion in UI
};

// We are in permanent develop staging environment
Expand Down
2 changes: 1 addition & 1 deletion src/config/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module.exports = {
pipelineIgnoreSSLCertificate: false,
datadogApiKey: 'test-datadog-api-key', // pragma: allowlist secret
datadogAppKey: 'test-datadog-app-key',
workerVersion: 3, // needs to match workerVersion in UI
workerVersion: 4, // needs to match workerVersion in UI
};
11 changes: 8 additions & 3 deletions src/sql/migrations/20230117130009_add_last_pipeline_params.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
exports.up = async (knex) => {
await knex.schema.alterTable('experiment_execution', (table) => {
table.renameColumn('last_gem2s_params', 'last_pipeline_params');
});
// for HMS deployment last_gem2s_params was always called last_pipeline_params
const hasLastGem2sParams = await knex.schema.hasColumn('experiment_execution', 'last_gem2s_params');

if (hasLastGem2sParams) {
await knex.schema.alterTable('experiment_execution', (table) => {
table.renameColumn('last_gem2s_params', 'last_pipeline_params');
});
}
};

exports.down = async (knex) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Array [
"extraDependencies": Array [],
"extras": undefined,
"qcPipelineStartDate": "2016-03-22T04:00:00.000Z",
"workerVersion": 3,
"workerVersion": 4,
},
],
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Array [
],
"extras": undefined,
"qcPipelineStartDate": "2016-03-22T04:00:00.000Z",
"workerVersion": 3,
"workerVersion": 4,
},
],
]
Expand Down
2 changes: 1 addition & 1 deletion tests/api.v2/helpers/worker/submitEmbeddingWork.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('submitWorkEmbedding', () => {
expect(createObjectHash.mock.calls).toMatchSnapshot();
// this ETag should match exactly the one in
// loadEmbedding.defaultParams.test.js
expect(ETag).toEqual('fb7a8a67c7806fa90c69b9cdb16dd478'); // pragma: allowlist secret
expect(ETag).toEqual('163301323ab0ee82902d1574a5dcd061'); // pragma: allowlist secret
expect(validateAndSubmitWork).toBeCalledTimes(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('submitWorkEmbedding', () => {
expect(createObjectHash.mock.calls).toMatchSnapshot();
// this ETag should match exactly the one in
// loadMarkerGenes.defaultParams.test.js
expect(ETag).toEqual('a973357e8c6273f0f154a179b12c6d25'); // pragma: allowlist secret
expect(ETag).toEqual('7f2b831012fe0d6bebf8fcca49ccd057'); // pragma: allowlist secret

expect(validateAndSubmitWork).toBeCalledTimes(1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Object {
"rdsSandboxId": "default",
"sandboxId": "default",
"workerNamespace": "worker-default",
"workerVersion": 3,
"workerVersion": 4,
}
`;

Expand Down Expand Up @@ -69,6 +69,6 @@ Object {
"rdsSandboxId": "default",
"sandboxId": "default",
"workerNamespace": "worker-default",
"workerVersion": 3,
"workerVersion": 4,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Object {
"rdsSandboxId": "default",
"sandboxId": "mockedSandboxId",
"workerNamespace": "worker-mockedSandboxId",
"workerVersion": 3,
"workerVersion": 4,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Object {
"rdsSandboxId": "default",
"sandboxId": "default",
"workerNamespace": "worker-default",
"workerVersion": 3,
"workerVersion": 4,
}
`;

0 comments on commit ab00c48

Please sign in to comment.