@@ -7,20 +7,31 @@ S3_BUCKET=s3://forecast-eval
7
7
8
8
build : build_dashboard
9
9
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`.
10
16
r_build :
11
17
docker build --no-cache --force-rm --pull -t forecast-eval-build docker_build
12
18
19
+ # Download the named file from the AWS S3 bucket
13
20
% .rds : dist
14
21
test -f dist/$@ || curl -o dist/$@ $(S3_URL ) /$@
15
22
23
+ # Specify all the data files we want to download
16
24
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
17
25
26
+ # Create the dist directory
18
27
dist :
19
28
mkdir $@
20
29
30
+ # Remove the dist directory
21
31
clean :
22
32
rm -rf dist
23
33
34
+ # Run the scoring pipeline in a docker container
24
35
score_forecast : r_build dist pull_data
25
36
docker run --rm \
26
37
-v ${PWD} /Report:/var/forecast-eval \
@@ -29,10 +40,16 @@ score_forecast: r_build dist pull_data
29
40
forecast-eval-build \
30
41
Rscript create_reports.R --dir /var/dist
31
42
43
+ # Post scoring pipeline output files to the AWS S3 bucket
32
44
deploy : score_forecast
33
45
aws s3 cp dist/ $(S3_BUCKET ) / --recursive --exclude " *" --include " *rds" --acl public-read
34
46
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`.
36
53
start_dev : r_build
37
54
docker run --pull=always -ti --rm \
38
55
-v ${PWD} /Report:/var/forecast-eval \
@@ -41,14 +58,18 @@ start_dev: r_build
41
58
-w /var/forecast-eval \
42
59
ghcr.io/cmu-delphi/forecast-eval:latest bash
43
60
61
+ # Build a docker image for local use
44
62
build_dashboard_dev : pull_data
45
63
docker build --no-cache --pull -t ghcr.io/cmu-delphi/forecast-eval:latest -f devops/Dockerfile .
46
64
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
47
70
build_dashboard : pull_data
48
71
docker build --no-cache=true --pull -t ghcr.io/cmu-delphi/forecast-eval:$(imageTag ) -f devops/Dockerfile .
49
72
73
+ # Push a production docker image to the image repository
50
74
deploy_dashboard : build_dashboard
51
75
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