@@ -4,44 +4,39 @@ FROM ${BASE_IMAGE} as bld
4
4
5
5
# build/install the fortran model
6
6
COPY external/fv3gfs-fortran/ /tmp/fortran-build
7
- RUN cd /tmp/fortran-build/FV3 && \
8
- ./configure gnu_docker && \
9
- sed -i "33i CALLPYFORT=Y" conf/configure.fv3 && \
10
- make -j 8 && \
11
- PREFIX=/usr/local make install
12
-
13
- # Python Stuff Here
14
- #
15
- # Equivalent to passing --no-cache-dir to every pip install
16
- ENV PIP_NO_CACHE_DIR=off
17
-
18
- # Install dependencies
19
- COPY docker/prognostic_run/requirements.txt /tmp/requirements.txt
20
- RUN pip install -r /tmp/requirements.txt
21
-
22
- # compile and install the wrapper. Then import fv3gfs.wrapper as a minimal test
23
- # that it works.
24
- RUN make -C /tmp/fortran-build/FV3 wrapper_build &&\
25
- pip3 install --no-dependencies /tmp/fortran-build/FV3/wrapper/dist/*.whl && \
26
- python3 -c 'import fv3gfs.wrapper'
7
+ COPY .environment-scripts/install_fv3gfs_fortran.sh .
8
+ RUN CALLPYFORT=Y bash install_fv3gfs_fortran.sh /tmp/fortran-build/FV3 gnu_docker /usr/local
27
9
10
+ # Install the Python dependencies
11
+ COPY docker/prognostic_run/requirements.txt /fv3net/docker/prognostic_run/requirements.txt
28
12
COPY external/vcm /fv3net/external/vcm
29
- RUN pip3 install --no-dependencies -e /fv3net/external/vcm
30
-
31
13
COPY external/artifacts /fv3net/external/artifacts
32
- RUN pip3 install --no-dependencies -e /fv3net/external/artifacts
33
-
34
14
COPY external/loaders /fv3net/external/loaders
35
- RUN pip3 install --no-dependencies -e /fv3net/external/loaders
36
-
37
15
COPY external/fv3fit /fv3net/external/fv3fit
38
- RUN pip3 install --no-dependencies -e /fv3net/external/fv3fit
39
-
40
16
COPY external/fv3kube /fv3net/external/fv3kube
41
- RUN pip3 install --no-dependencies -e /fv3net/external/fv3kube
42
-
43
17
COPY workflows/post_process_run /fv3net/workflows/post_process_run
44
- RUN pip3 install --no-dependencies -e /fv3net/workflows/post_process_run
18
+ COPY workflows/prognostic_c48_run/ /fv3net/workflows/prognostic_c48_run
19
+ COPY external/emulation /fv3net/external/emulation
20
+ COPY external/radiation /fv3net/external/radiation
21
+
22
+ COPY .environment-scripts/install_fv3net_python_dependencies.sh .
23
+ RUN bash install_fv3net_python_dependencies.sh \
24
+ /fv3net/docker/prognostic_run/requirements.txt \
25
+ /fv3net/external/vcm \
26
+ /fv3net/external/artifacts \
27
+ /fv3net/external/loaders \
28
+ /fv3net/external/fv3fit \
29
+ /fv3net/external/fv3kube \
30
+ /fv3net/workflows/post_process_run \
31
+ /fv3net/workflows/prognostic_c48_run \
32
+ /fv3net/external/emulation \
33
+ /fv3net/external/radiation
34
+
35
+ # compile and install the wrapper. Then import fv3gfs.wrapper as a minimal test
36
+ # that it works.
37
+ COPY .environment-scripts/install_python_wrapper.sh .
38
+ RUN CALLPYFORT=Y bash install_python_wrapper.sh /tmp/fortran-build/FV3
39
+ RUN python3 -c 'import fv3gfs.wrapper'
45
40
46
41
RUN echo "ulimit -s unlimited" >> /etc/bash.bashrc && \
47
42
mkdir /outdir && \
@@ -52,12 +47,7 @@ RUN echo "ulimit -s unlimited" >> /etc/bash.bashrc && \
52
47
ENV LC_ALL=C.UTF-8
53
48
ENV LANG=C.UTF-8
54
49
55
- COPY workflows/prognostic_c48_run/ /fv3net/workflows/prognostic_c48_run
56
- RUN pip install --no-dependencies -e /fv3net/workflows/prognostic_c48_run
57
-
58
50
# Override microphysics emulation
59
- COPY external/emulation /fv3net/external/emulation
60
- RUN pip install --no-dependencies -e /fv3net/external/emulation
61
51
ENV VAR_META_PATH=/fv3net/external/emulation/microphysics_parameter_metadata.yaml
62
52
ENV OUTPUT_FREQ_SEC=18000
63
53
@@ -66,10 +56,6 @@ COPY projects/microphysics/scripts /fv3net/projects/microphysics/scripts
66
56
RUN chmod +x /fv3net/projects/microphysics/scripts/*
67
57
ENV PATH=/fv3net/projects/microphysics/scripts:${PATH}
68
58
69
- # Add python radiation port
70
- COPY external/radiation /fv3net/external/radiation
71
- RUN pip install --no-dependencies -e /fv3net/external/radiation
72
-
73
59
ENV PYTHONPATH=/fv3net/workflows/prognostic_c48_run:/fv3net/external/fv3fit:/fv3net/external/emulation:/fv3net/external/vcm:/fv3net/external/artifacts:/fv3net/external/loaders:/fv3net/external/fv3kube:/fv3net/workflows/post_process_run:/fv3net/external/radiation:${PYTHONPATH}
74
60
WORKDIR /fv3net/workflows/prognostic_c48_run
75
61
CMD ["bash" ]
0 commit comments