diff --git a/Dockerfile b/Dockerfile index 1bdb845..85e3744 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3.8.10-buster as builder WORKDIR /build/wgrib2 -# build wgrib2 +# build wgrib2, this takes a while ENV CC gcc ENV FC gfortran @@ -29,9 +29,10 @@ WORKDIR /code COPY --from=builder /usr/local/bin/wgrib2 /usr/local/bin/wgrib2 # Add and build weather forecast retrival -RUN apt-get update \ - && apt-get install -y git libeccodes-tools libgfortan5 libgomp1 \ +RUN apt-get update -y \ + && apt-get install -y git libeccodes-tools libgfortran5 libgomp1 \ && python3 -m pip install --no-cache-dir -r requirements.txt \ - && python3 setup.py install + && python3 setup.py install \ + && rm -rf /var/lib/apt/lists/* VOLUME /data \ No newline at end of file diff --git a/README.md b/README.md index 50c2366..58f4670 100755 --- a/README.md +++ b/README.md @@ -35,17 +35,16 @@ ln wgrib2/wgrib2 ~/bin/wgrib2 ## Docker -The retrieval aspect of `weather_forecast_retieval` has been built into a Docker image based on the Python 3 Alpine linux image. This allows for a docker deployment to run and retrieve HRRR data and convert to netcdf if needed. To use, first build the image +The retrieval aspect of `weather_forecast_retieval` has been built into a Docker image based Python 3.8. This allows for a docker deployment to run and retrieve HRRR data. The docker image can call any of the command line programs in `weather_forecast_retrieval`. + +For example, to run `hrrr_nomads` with docker: ``` -docker build -t usdaarsnwrc/weather_forecast_retieval . +docker run --rm usdaarsnwrs/weather_forecast_retrieval hrrr_nomads -l 3 -f 0,1,2 --bbox="-119,-118,37,38" -o /path/to/output -p /path/to/crop/output ``` -Grab a coffee as this has to compile `pandas` from source (10+ minutes of compile time). Once completed, modify or create a new `docker-compose.yml` and modify the volume attachments as necessary. There are 2 volumes to attach, a `data` drive mounted to `/data` and the config file folders at `/code/config`. To setup the download, the config file is passed to `docker-compose`: +The paths to the output directories are internal to the docker image and the necessary volume mounts are needed. -``` -docker-compose run weather_forecast_retrieval /code/config/hrrr.ini -``` # Command line usage @@ -170,7 +169,3 @@ optional arguments: --verbose increase logging verbosity --overwrite Download and overwrite existing HRRR files ``` - -## convert_grib2nc - -## run_hrrr_retrieval