Skip to content

Commit 6cf1b65

Browse files
committed
Create links to static directories from /tmp/static since under CWL
everything else is mounted read-only.
1 parent 3c20225 commit 6cf1b65

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

spss/Dockerfile.l1a

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@ RUN yum install -y libquadmath epel-release && \
2525
rm -rf /var/cache/yum
2626

2727
# Create directory structure for PGE files and necessary files
28-
# Change /data/static permissions so any user can make symlinks there
2928
RUN mkdir -p /pge/bin && \
3029
mkdir -p /pge/static && \
3130
mkdir -p /pge/interface && \
32-
mkdir -p /opt/packages && \
33-
mkdir -p /data/static && \
34-
chmod 777 /data/static
31+
mkdir -p /opt/packages
3532

3633
# Copy L1A PGE binary from build
3734
COPY --from=builder /build/spss/src/sips_pge/l1a_atms/pge/bin/L1AMw_main /pge/bin
@@ -61,7 +58,7 @@ RUN sed -i 's|../../../static|/pge/static|' /pge/static/SNDR.SNPP.ATMS.L1A.sfif_
6158
RUN sed -i -e 's|utcpole_20201220.dat|utcpole.dat|' -e 's|../../in/pcf|~/database/common/CSC|' /pge/static/SNDR.PGSToolkit_ProcessControlFile.pcf
6259

6360
# Modify to point DEMs to a path controlled by Docker
64-
RUN sed -i -e 's|/peate/support/static/dem|/data/static/dem|' -e 's|/ref/devstable/STORE/mcf|/data/static/mcf|' /pge/static/SNDR.PGSToolkit_ProcessControlFile.pcf
61+
RUN sed -i -e 's|/peate/support/static/dem|/tmp/static/dem|' -e 's|/ref/devstable/STORE/mcf|/tmp/static/mcf|' /pge/static/SNDR.PGSToolkit_ProcessControlFile.pcf
6562

6663
# Static files referenced in SFIF file
6764
COPY src/src/sips_pge/l1a_atms_snpp/static/SNDR.SNPP.ATMS.L1A.template.v02_02_08_201214135000.nc /pge/static

spss/Dockerfile.l1b

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@ RUN yum install -y libquadmath epel-release && \
2525
rm -rf /var/cache/yum
2626

2727
# Create directory structure for PGE files and necessary files
28-
# Change /data/static permissions so any user can make symlinks there
2928
RUN mkdir -p /pge/bin && \
3029
mkdir -p /pge/static && \
3130
mkdir -p /pge/interface && \
3231
mkdir -p /opt/packages && \
33-
mkdir -p /data/static && \
34-
chmod 777 /data/static
3532

3633
# Copy L1B PGE binary
3734
COPY --from=builder /build/spss/src/sips_pge/l1b_atms/main/bin/L1BMw_main /pge/bin
@@ -58,7 +55,7 @@ COPY src/src/sips_pge/l1b_atms_snpp/acctest/in/SNDR.SchemaParameterfile.06040112
5855
RUN sed -i 's|../../../static|/pge/static|' /pge/static/SNDR.SNPP.L1bMw.sfif.acctest.xml
5956

6057
# Modify to point DEMs to a path controlled by Docker
61-
RUN sed -i -e 's|/peate/support/static/dem|/data/static/dem|' -e 's|/ref/devstable/STORE/mcf|/data/static/mcf|' /pge/static/SNDR.PGSToolkit_ProcessControlFile.pcf
58+
RUN sed -i -e 's|/peate/support/static/dem|/tmp/static/dem|' -e 's|/ref/devstable/STORE/mcf|/tmp/static/mcf|' /pge/static/SNDR.PGSToolkit_ProcessControlFile.pcf
6259

6360
# Static files referenced in SFIF file
6461
COPY src/src/sips_pge/l1b_atms_snpp/static/SNDR.SNPP.L1bMw.template.201217000000.nc /pge/static

spss/interface/run_l1a_pge.ipynb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@
173173
" if not os.path.exists(path):\n",
174174
" raise Exception(f\"Source static data path not found: {path}\")\n",
175175
"\n",
176-
"dem_dst_path = \"/data/static/dem\"\n",
177-
"mcf_dst_path = \"/data/static/mcf\"\n",
176+
"dem_dst_path = \"/tmp/static/dem\"\n",
177+
"mcf_dst_path = \"/tmp/static/mcf\"\n",
178178
"\n",
179179
"for src_path, dst_path in [(dem_src_path, dem_dst_path), (mcf_src_path, mcf_dst_path)]:\n",
180180
" # Only error if the destination path exists and is not the same as the source\n",
@@ -183,6 +183,11 @@
183183
" \n",
184184
" # Destination path could exist if it is the same as the source path\n",
185185
" if not os.path.exists(dst_path):\n",
186+
" # Create containing directory if it does not exist, for instance if it is a temp directory\n",
187+
" dst_base = os.path.dirname(dst_path)\n",
188+
" if not os.path.exists(dst_base):\n",
189+
" os.makedirs(dst_base)\n",
190+
" \n",
186191
" logger.info(f\"Creating symbolic link to static data: {src_path} -> {dst_path}\")\n",
187192
" os.symlink(src_path, dst_path)"
188193
]

spss/interface/run_l1b_pge.ipynb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
"# Where PGE output files and log files get written\n",
6161
"output_path = \"/pge/out\"\n",
6262
"\n",
63-
"# Location of dem and mcf static files\n",
64-
"data_static_path = \"/tmp/static\"\n",
65-
"\n",
6663
"# Enable verbose logging\n",
6764
"verbose = True"
6865
]

0 commit comments

Comments
 (0)