Skip to content

Commit 9271b34

Browse files
committed
comment targets
1 parent 6dd14a9 commit 9271b34

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

Makefile

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,31 @@ S3_BUCKET=s3://forecast-eval
77

88
build: build_dashboard
99

10+
# Build a docker image suitable for running the scoring pipeline
11+
#
12+
# `docker_build/Dockerfile` is based on `ghcr.io/cmu-delphi/covidcast:latest`.
13+
# Docker will try to fetch it from the image repository, which requires
14+
# authentication. As a workaround, locally build a docker image with the same
15+
# name and set `--pull=never`.
1016
r_build:
1117
docker build --no-cache --force-rm --pull -t forecast-eval-build docker_build
1218

19+
# Download the named file from the AWS S3 bucket
1320
%.rds: dist
1421
test -f dist/$@ || curl -o dist/$@ $(S3_URL)/$@
1522

23+
# Specify all the data files we want to download
1624
pull_data: score_cards_state_deaths.rds score_cards_state_cases.rds score_cards_nation_cases.rds score_cards_nation_deaths.rds score_cards_state_hospitalizations.rds score_cards_nation_hospitalizations.rds datetime_created_utc.rds predictions_cards.rds
1725

26+
# Create the dist directory
1827
dist:
1928
mkdir $@
2029

30+
# Remove the dist directory
2131
clean:
2232
rm -rf dist
2333

34+
# Run the scoring pipeline in a docker container
2435
score_forecast: r_build dist pull_data
2536
docker run --rm \
2637
-v ${PWD}/Report:/var/forecast-eval \
@@ -29,10 +40,16 @@ score_forecast: r_build dist pull_data
2940
forecast-eval-build \
3041
Rscript create_reports.R --dir /var/dist
3142

43+
# Post scoring pipeline output files to the AWS S3 bucket
3244
deploy: score_forecast
3345
aws s3 cp dist/ $(S3_BUCKET)/ --recursive --exclude "*" --include "*rds" --acl public-read
3446

35-
# Starts a docker image with a full preconfigured R environment
47+
# Run bash in a docker container with a full preconfigured R environment
48+
#
49+
# If `--pull=always`, docker will try to fetch the
50+
# `ghcr.io/cmu-delphi/forecast-eval:latest` image from the image repository,
51+
# which requires authentication. As a workaround, locally build a docker
52+
# image with the same name and set `--pull=never`.
3653
start_dev: r_build
3754
docker run --pull=always -ti --rm \
3855
-v ${PWD}/Report:/var/forecast-eval \
@@ -41,14 +58,18 @@ start_dev: r_build
4158
-w /var/forecast-eval \
4259
ghcr.io/cmu-delphi/forecast-eval:latest bash
4360

61+
# Build a docker image for local use
4462
build_dashboard_dev: pull_data
4563
docker build --no-cache --pull -t ghcr.io/cmu-delphi/forecast-eval:latest -f devops/Dockerfile .
4664

65+
# Run a local version of the dashboard in a docker container
66+
start_dashboard: build_dashboard_dev
67+
docker run --rm -p 3838:80 ghcr.io/cmu-delphi/forecast-eval:latest
68+
69+
# Build a docker image for production use
4770
build_dashboard: pull_data
4871
docker build --no-cache=true --pull -t ghcr.io/cmu-delphi/forecast-eval:$(imageTag) -f devops/Dockerfile .
4972

73+
# Push a production docker image to the image repository
5074
deploy_dashboard: build_dashboard
5175
docker push ghcr.io/cmu-delphi/forecast-eval:$(imageTag)
52-
53-
start_dashboard: build_dashboard_dev
54-
docker run --rm -p 3838:80 ghcr.io/cmu-delphi/forecast-eval:latest

0 commit comments

Comments
 (0)