From 032f8a57143a75071d7c8fb9fc63d9a70e829474 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Sat, 26 Dec 2020 17:12:08 +0100 Subject: [PATCH] Download additional resources Scrape: - https://web.stanford.edu/class/cs143/ - http://openclassroom.stanford.edu/MainFolder/courses/Compilers/docs Both contain resources not found in the edx course. Among others: - LaTeX sources for assignments - Slides (annotated and un-annotated) - Previous finals for practicing --- Dockerfile | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3956dd1..a67549d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,32 @@ RUN wget -O - https://courses.edx.org/asset-v1:StanfordOnline+SOE.YCSCS1+1T2020+ RUN wget -O - https://courses.edx.org/asset-v1:StanfordOnline+SOE.YCSCS1+1T2020+type@asset+block@pa4-grading.pl \ | tee /usr/class/assignments/PA5J/grade.pl /usr/class/assignments/PA5/grade.pl > /dev/null +# Download additional resources to `class/handouts`. We scrape the whole +# websites every time we build the container. On the other hand they could just +# provide the resources in the course ¯\_(ツ)_/¯ + +# Move the handouts in the student-dist.tar.gz to edx subfolder +RUN mkdir -p /usr/class/handouts/edx \ + && cd /usr/class/handouts \ + && mv *.pdf edx + +# Download cs143 resources. This contains e.g. latex templates for the assignments, previous finals +# https://web.stanford.edu/class/cs143/ +RUN mkdir -p /usr/class/handouts/cs143 \ + && cd /usr/class/handouts/cs143 \ + && wget -r -k -l1 https://web.stanford.edu/class/cs143/ \ + && mv web.stanford.edu/class/cs143/* . && rm -fR web.stanford.edu + +# Download openclassroom resources. this contains e.g. the annotated video slides. +# We are downloading the directory listing from +# http://openclassroom.stanford.edu/MainFolder/courses/Compilers/docs +# here, so we can use mirror (-m) without parents (-np) here. +# see also: http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=Compilers +RUN mkdir -p /usr/class/handouts/openclassroom \ + && cd /usr/class/handouts/openclassroom \ + && wget -np -m http://openclassroom.stanford.edu/MainFolder/courses/Compilers/docs \ + && mv openclassroom.stanford.edu/MainFolder/courses/Compilers/docs/* . && rm -fR openclassroom.stanford.edu + # Patch tar arguments in submission scripts # We add -o to tar command since --preserve-permissions and --same-owner # are default in tar for superuser. Since we are running as root @@ -65,7 +91,9 @@ RUN patch -u /usr/class/assignments/PA2/cool.flex -i /tmp/build/cool.flex.patch RUN mkdir -p /class WORKDIR /class -# Run entrypoint to connect working directory to mounted host volume +# Run entrypoint to connect working directory to mounted host volume. This +# copies files to the (potentially host-mounted) volume, s.t. files can be +# edited on the host and are also visible in the container. COPY entrypoint.sh /usr/bin/entrypoint.sh ENTRYPOINT ["entrypoint.sh"] CMD ["/bin/bash"]