From 317b00d9279869d74a237fc0dc26b43d8b470c8b Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Sat, 29 Oct 2022 16:32:11 -0400 Subject: [PATCH] make downloaded models readable by all users (#31) Downloaded models are made with mode 0600. This is because they start out as tempfile.NamedTemporaryFile objects, which are by default made with 0600 mode. --- dockerfiles/tils.dockerfile | 2 ++ dockerfiles/tumor-brca.dockerfile | 2 ++ dockerfiles/tumor-luad.dockerfile | 2 ++ dockerfiles/tumor-paad.dockerfile | 2 ++ dockerfiles/tumor-prad.dockerfile | 2 ++ 5 files changed, 10 insertions(+) diff --git a/dockerfiles/tils.dockerfile b/dockerfiles/tils.dockerfile index a91cc17..99e7c9a 100644 --- a/dockerfiles/tils.dockerfile +++ b/dockerfiles/tils.dockerfile @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-TILs-v1" # Download the weights. RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")" +# Downloaded models are mode 0600. Make them readable by all users. +RUN chmod -R +r $TORCH_HOME/hub/checkpoints/ diff --git a/dockerfiles/tumor-brca.dockerfile b/dockerfiles/tumor-brca.dockerfile index f9a5699..36f2f65 100644 --- a/dockerfiles/tumor-brca.dockerfile +++ b/dockerfiles/tumor-brca.dockerfile @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-BRCA-v1" # Download the weights. RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")" +# Downloaded models are mode 0600. Make them readable by all users. +RUN chmod -R +r $TORCH_HOME/hub/checkpoints/ diff --git a/dockerfiles/tumor-luad.dockerfile b/dockerfiles/tumor-luad.dockerfile index a88dbf2..d4b3729 100644 --- a/dockerfiles/tumor-luad.dockerfile +++ b/dockerfiles/tumor-luad.dockerfile @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-LUAD-v1" # Download the weights. RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")" +# Downloaded models are mode 0600. Make them readable by all users. +RUN chmod -R +r $TORCH_HOME/hub/checkpoints/ diff --git a/dockerfiles/tumor-paad.dockerfile b/dockerfiles/tumor-paad.dockerfile index 8a85b4e..b5ffbf6 100644 --- a/dockerfiles/tumor-paad.dockerfile +++ b/dockerfiles/tumor-paad.dockerfile @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-PAAD-v1" # Download the weights. RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")" +# Downloaded models are mode 0600. Make them readable by all users. +RUN chmod -R +r $TORCH_HOME/hub/checkpoints/ diff --git a/dockerfiles/tumor-prad.dockerfile b/dockerfiles/tumor-prad.dockerfile index 6cf3d18..1c9b287 100644 --- a/dockerfiles/tumor-prad.dockerfile +++ b/dockerfiles/tumor-prad.dockerfile @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-PRAD-v1" # Download the weights. RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")" +# Downloaded models are mode 0600. Make them readable by all users. +RUN chmod -R +r $TORCH_HOME/hub/checkpoints/