Skip to content

Commit

Permalink
update caracal base
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Jan 16, 2024
1 parent 3313316 commit ba3adc5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 383 deletions.
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
FROM node:16-stretch-slim
RUN apt-get update && apt-get upgrade -y && apt-get install -y git build-essential python3
FROM node:20-alpine
RUN apk add --no-cache git
RUN apk add --no-cache openssl
RUN mkdir /src
COPY . /src
WORKDIR /src
RUN npm install
ARG viewer
ARG fork
RUN git clone https://github.com/${fork:-camicroscope}/camicroscope.git --branch=${viewer:-master}
EXPOSE 8010

RUN chgrp -R 0 /src && \
chmod -R g+rwX /src

USER 1001
RUN git clone https://github.com/${fork:-camicroscope}/camicroscope.git --branch=${viewer:-master} --depth 1
EXPOSE 4010

CMD node caracal.js
33 changes: 10 additions & 23 deletions caracal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ const Agenda = require("agenda");

const {generateTableBody} = require("./service/database/util");

// TODO -- make optional
const DISABLE_TF = true; // DUE TO PRODUCTION STABILITY ISSUES WITH TFJS

if (!DISABLE_TF) {
const DataSet = require('./handlers/datasetHandler.js');
const Model = require('./handlers/modelTrainer.js');
}

const {connector} = require("./service/database/connector");

var WORKERS = process.env.NUM_THREADS || 4;
Expand Down Expand Up @@ -153,22 +145,17 @@ var HANDLERS = {
},
};

if (!DISABLE_TF) {
HANDLERS["getDataset"] = DataSet.getDataset;
HANDLERS["trainModel"] = Model.trainModel;
HANDLERS["deleteDataset"] = DataSet.deleteData;
HANDLERS["sendTrainedModel"] = Model.sendTrainedModel;
} else {
function disabledRoute() {
return function(req, res) {
res.status(500).send('{"err":"This TF route is disabled"}');
};
}
HANDLERS["getDataset"] = disabledRoute;
HANDLERS["trainModel"] = disabledRoute;
HANDLERS["deleteDataset"] = disabledRoute;
HANDLERS["sendTrainedModel"] = disabledRoute;

function disabledRoute() {
return function(req, res) {
res.status(500).send('{"err":"This TF route is disabled"}');
};
}
HANDLERS["getDataset"] = disabledRoute;
HANDLERS["trainModel"] = disabledRoute;
HANDLERS["deleteDataset"] = disabledRoute;
HANDLERS["sendTrainedModel"] = disabledRoute;


// register configurable services
// TODO verify all
Expand Down
164 changes: 0 additions & 164 deletions handlers/datasetHandler.js

This file was deleted.

Loading

0 comments on commit ba3adc5

Please sign in to comment.