Skip to content

Commit

Permalink
switch to tram-private in docker-compose temporarily
Browse files Browse the repository at this point in the history
* establish “pickles” directory to separate pickle files from models to avoid any overwrite issues
* add a few additional exclusions to dockerignore
  • Loading branch information
m3mike authored and mehaase committed Aug 27, 2023
1 parent 7c85302 commit f73a60e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# exclude items not needed/conflict on docker image

.git
.idea
.DS_Store
.github
venv
.venv
Expand Down
Empty file added data/pickles/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
version: '3.5'
services:
tram:
image: ghcr.io/center-for-threat-informed-defense/tram:latest
image: ghcr.io/center-for-threat-informed-defense/tram-private:swfarnsworth-bert-django-container-buildable
environment:
- DATA_DIRECTORY=/tram/data
- ALLOWED_HOSTS=["example_host1", "localhost"]
Expand All @@ -20,7 +20,7 @@ services:
- tram:/tram/data
- tram_static:/tram/src/tram/staticfiles
nginx:
image: ghcr.io/center-for-threat-informed-defense/tram-nginx:latest
image: ghcr.io/center-for-threat-informed-defense/tram-private-nginx:swfarnsworth-bert-django-container-buildable
ports:
- "8000:80"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion src/tram/ml/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def run_model(self, run_forever=False):
time.sleep(1)

def get_model_filepath(self, model_class):
filepath = settings.ML_MODEL_DIR + "/" + model_class.__name__ + ".pkl"
filepath = settings.PICKLE_DIR + "/" + model_class.__name__ + ".pkl"
return filepath

def train_model(self):
Expand Down
1 change: 1 addition & 0 deletions src/tram/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,6 @@
}

ML_MODEL_DIR = os.path.join(DATA_DIRECTORY, "ml-models")
PICKLE_DIR = os.path.join(DATA_DIRECTORY, "pickles")

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

0 comments on commit f73a60e

Please sign in to comment.