Skip to content
Open
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 nodejs/conf/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ module.exports = {
runnerTemplate: 'crunner0',
memTarget: 15,
minAvailableRunners: 10,
domian: 'prod.718it.codeland.us',
domian: 'cl-worker-3.718it.codeland.us',
},
};
2 changes: 1 addition & 1 deletion nodejs/controller/codeland.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const clworker = new CodelandController({ssh, ...conf.clworker});
clworker.__log('memory', await clworker.ssh.memory())
}catch{}
}, 2000, clworker)
await clworker.deleteUntracedRunners();
await clworker.deleteUntrackedRunners();
await clworker.runnerOven(10*1000);

clworker.__log('df', (await clworker.ssh.df())['/'])
Expand Down
10 changes: 4 additions & 6 deletions nodejs/lib/codeland.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ class CodeLandWorker{
instances.
*/
async init(){


this.runnerTemplate = await LXC.get({
name: this.runnerTemplate,
execInstance: this.ssh
Expand All @@ -129,7 +127,6 @@ class CodeLandWorker{
environment: conf.environment,
}), 1000)


return this;
}

Expand Down Expand Up @@ -168,12 +165,13 @@ class CodeLandWorker{
}

/*
getCurrentCopies and deleteUntracedRunners clean up zombie runners from
getCurrentCopies and deleteUntrackedRunners clean up zombie runners from
old instances of Codeland
*/
async getCurrentCopies(){
let containers = await this.runnerTemplate.list();
let runners = {};

for(let container of containers){
if(container.name.startsWith(this.runnerPrefix ) ){
if(container.name === this.runnerTemplate) continue;
Expand All @@ -187,7 +185,7 @@ class CodeLandWorker{
return runners;
}

async deleteUntracedRunners(){
async deleteUntrackedRunners(){
for(let [name, runner] of Object.entries(await this.getCurrentCopies())){
if(!this.__runners[name]){
(async ()=>{
Expand Down Expand Up @@ -455,7 +453,7 @@ if (require.main === module){(async function(){try{

// await clworker.ssh.exec('bash ~/clean_crunners.sh');

// await clworker.deleteUntracedRunners();
// await clworker.deleteUntrackedRunners();
await clworker.runnerOven();

console.log('mem info:', await clworker.memory())
Expand Down
Loading