From 809258e4e9a38f6c15669a17d725fa313fde8b04 Mon Sep 17 00:00:00 2001 From: TYLER CARAZA-HARTER <tharter@cs544-tharter.cs.wisc.edu> Date: Sun, 26 Jan 2025 21:26:30 -0600 Subject: [PATCH] update project directions --- p1/README.md | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ projects.md | 61 ++++++++++--------------------- 2 files changed, 121 insertions(+), 41 deletions(-) create mode 100644 p1/README.md diff --git a/p1/README.md b/p1/README.md new file mode 100644 index 0000000..186abd5 --- /dev/null +++ b/p1/README.md @@ -0,0 +1,101 @@ +# DRAFT! Don't start yet. + +# P1 (4% of grade): Counting Loans with Dockerized Shell Script + +## Overview + +In this project, you'll setup your programming environment for the +first part of the semester (virtual machine, Docker). You'll practice +writing some shell commands to download a zipped file and search +(grep) through its contents. You'll automate these steps with a shell +script. The shell script may depend on other programs (like `unzip`), +so you'll deploy it as a Docker image with the necessary installs. + +Learning objectives: +* deploy a virtual machine in the cloud +* follow a complicated series of steps to install Docker +* write a shell script to automate several bash commands +* bundle a shell script up as a Docker image/container + +Before starting, please review the [general project directions](../projects.md). + +## Corrections/Clarifications + +* none yet + +## Prepare: Virtual Machine Connection + +## Part 1: Download Script + +Write a `download.sh` bash script that downloads the following: + +* https://pages.cs.wisc.edu/~harter/cs544/data/wi2021.csv.gz +* https://pages.cs.wisc.edu/~harter/cs544/data/wi2022.csv.gz +* https://pages.cs.wisc.edu/~harter/cs544/data/wi2023.csv.gz + +Your script should then decompress each of these (you can use `man gzip` to +learn more about how to do this). + +The `download.sh` file should then create a single `wi.txt` file +containing the contents of all three files consecutively. + +Your `download.sh` should have a shebang line so it runs with bash. + +## Part 2: Multi Script + +Write a `multi.sh` script first uses `download.sh` to generate wi.txt, then +counts the number of lines in wi.txt containing the text "Multifamily" +(any case). Your script should output/print the correct number; it is +OK it generates additional output. + +Your `multi.sh` should have a shebang line so it runs with bash. Make +it executable. + +## Part 3: Docker Install + +Carefully follow the directions here to install Docker 27.2.0 and Compose 2.29.2 on your virtual machine: https://docs.docker.com/engine/install/ubuntu/ + +Notes: +* there are several different approaches described under "Installation methods". Use the directions under "Install using the apt repository". Make sure you don't keep going after you reach "Install from a package" +* the first step under "Install Docker Engine" has two options: "Latest" or "Specific version". Choose **"Specific version"** +* here is the command to get the required versions: `sudo apt-get install docker-ce=5:27.5.1-1~ubuntu.24.04~noble docker-ce-cli=5:27.5.1-1~ubuntu.24.04~noble containerd.io docker-buildx-plugin docker-compose-plugin=2.32.4-1~ubuntu.24.04~noble` + +To avoid needing to run every Docker command with root, there are a +few more steps you should do here: +https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user +(don't go beyond the "Manage Docker as a non-root user" section). + +Create some more files so we can check your Docker install: + +``` +docker version > docker.txt +docker compose version > compose.txt +``` + +## Part 4: Docker Image + +Create a `Dockerfile` that starts from a base image of your choosing +and includes your `count.sh` file. The Dockerfile should do any +installs needed for your script to run. + +You should be able to create an image and container like this: + +``` +docker build . -t p1 +docker run p1 +``` + +It's OK if there is extra output besides the actual count. + +## Submission + +Read the directions [here](../projects.md) about how to create the +repo. + +At a minimum, your submission repo should contain the following: +`docker.txt`, `compose.txt`, `download.sh`, `multi.sh`, and +`Dockerfile`. + +## Tester + +Details coming soon... diff --git a/projects.md b/projects.md index 09d6233..c0c83cb 100644 --- a/projects.md +++ b/projects.md @@ -1,13 +1,6 @@ # General Project Directions -## Project Repository Creation - -At the start of each project, you must submit [this form](https://docs.google.com/forms/d/e/1FAIpQLSdbuI3DTPZoapJLmAQz-hlz5Ts5bddL2uu7neg5wa6EUmSIPg/viewform). This will indicate whether or -now you have a partner (and if so, who). Upon a valid a submission, -we'll create a repo for you and your partner (if any) on GitLab and -email you a link. - -## Collaboration/Conduct Policy +## Collaboration/Conduct Guidance Students may work alone or optionally work in groups of two. @@ -37,48 +30,34 @@ not attended.** ## Compute Setup -More details coming soon... - -<!-- -We'll be using Google cloud (GCP) for our work this semester. We'll be -sharing $50 of credit per student. Some notes about how to manage this credit: - -* some people have multiple GCP accounts, for example, one with @gmail.com and one with @wisc.edu. You must redeem the credits with your @wisc.edu, but it's fine to then use them under any account -* Google accounts have multiple "billing accounts" -- these might typically correspond to credit cards. In your case, you'll have a billing account corresponding to $50 credit we'll provide -* Virtual machines and other resources are created under "projects", which are assigned to a billing account (and can be reassigned). When your first billing count is nearly exhausted, you'll need to move your VM over (or create a new one) - -Here is a plan/budget for what VM you should have at each point during the semester: +For most projects, we'll use VMs provided by CSL. See the directions +[here](csl-vm.md) about how to access it. The first project will +involve some setup (like installing docker) on the VM. -https://docs.google.com/spreadsheets/d/14_ifSyNhkWgZ0Wq4d79-CqAfj-BplucDMvkC1LAibfo/edit?usp=sharing +For later projects, we'll share details about how to do use cloud +resources. -Please monitor your credits carefully. If you're burning through credits faster than the schedule, it is your responsibility to conserve credits (for example, by shutting down your VM overnight). - -Your VMs should always run the TODO OS (be sure it is the "x86/64" option). Here are versions for the software we'll use this semester: - -* Ubuntu 24.04 -* Docker 27.2.0 -* *more details soon* - -Be sure to backup your work regularly to a private GitLab repo, or with an `scp` to your personal computer. +## Project Repository Creation -For commands like `scp` and others you will use this semester, the -cloud console's in-browser SSH client won't work. You'll need to -setup SSH keys with `ssh-keygen` and configure it on -https://console.cloud.google.com/compute/metadata to get from your -personal computer. ---> +At the start of each project, you must submit the [partner +form](https://tyler.caraza-harter.com/cs544/s25/forms.html). This +will indicate whether or now you have a partner (and if so, who). +Upon a valid a submission, we'll create a repo for you and your +partner (if any) on GitLab and email you a link. ## Submission -You'll be doing all your work on GitLab (in private repos we'll help -you setup). Watch for Canvas announcements for further details. +You'll submit by pushing to your GitLab project repo. Be +carefull not to push after the deadline unless your intention is to +submit late (see policy below). -* if you worked with a partner, make one submission. Requirement: commit history must show at least one commit from each partner. * projects have four parts; for notebooks, use big headers to divide your work into the four parts ("# Part 1: ...") * for question based project work, (Q1, Q2, etc), include comments like ("# Q1: ...") before the answers * each project will specify some specific files you need to commit (like a p1.ipynb or server.py); in addition to those, include whatever is needed (except data) for somebody to run your code -## Late Policy +## Policies + +### Late Policy The general rule is no submissions >3 days late. Each day late suffers a 10% penalty (so a 90% submission that is 2 days late gets 70%). @@ -91,13 +70,13 @@ If you're working with a project partner who has the late penalty waived by a TA For other cases (falling very far behind, family emergencies, etc), **reach out to your instructor** to discuss possible accomodations. -## Resubmission Policy +### Resubmission Policy Resubmissions generally won't be allowed once projects have been graded, except in unusual situations, or when we made a mistake on our end (like a misleading specification). -## "Pre-grading" Policy +### "Pre-grading" Policy We won't pre-grade work, so don't ask questions like "does this all look good?" during office hours. When grading many assignments, it's -- GitLab