Skip to content

Commit

Permalink
Container api (#69)
Browse files Browse the repository at this point in the history
* API can choose Docker container

* server fixes
  • Loading branch information
soulgalore authored Jul 31, 2024
1 parent a9b736b commit bef4d59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion server/src/routes/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ api.post(
let scriptingName = userConfig.api.scriptingName;
let label = userConfig.api.label;
let priority = userConfig.api.priority;
let container = userConfig.api.dockerContainer;

const location = userConfig.api.location;

Expand All @@ -196,7 +197,8 @@ api.post(
scriptingName,
label,
testType,
priority
priority,
container
);
response.json({ id });
} catch (error) {
Expand Down
6 changes: 4 additions & 2 deletions server/src/util/add-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ export async function addTestFromAPI(
scriptingName,
label,
testType,
priority
priority,
dockerContainer
) {
// The number of objects to keep in the queue before removal
const removeOnComplete = nconf.get('queue:removeOnComplete') || 200;
Expand Down Expand Up @@ -233,7 +234,8 @@ export async function addTestFromAPI(
config,
scripting,
scriptingName,
label
label,
dockerContainer
},
jobConfig
);
Expand Down
3 changes: 2 additions & 1 deletion testrunner/src/testrunners/docker-testrunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export default async function runJob(job) {
try {
logger.info(`Start with job ${job.id}`);
const baseWorkingDirectory = os.tmpdir();
const dockerContainer = nconf.get('docker:container');
const dockerContainer =
job.data.dockerContainer || nconf.get('docker:container');

const dockerExtraParameters = parseDockerExtraParameters(
nconf.get('docker:extraparameters')
Expand Down

0 comments on commit bef4d59

Please sign in to comment.