417 - Welcome & where to start
Welcome to 417!
Below is the “recommended setup” that we will use to run automated tests on. It is your responsibility to ensure that your code works on this setup, as the operation of your code may differ based on the compiler version used, glibc version used, third-party library version used, etc. Please ensure that your code works as intended when it is run in the setup described below.
Do note that you are allowed to create your own setup as per your own preferences to work on, we are asking you to just test them in the below environment to ensure that it actually works. (Test before you submit!)
You will submit the project by committing to your assigned git repository.
Signing in to GitLab and generating SSH keys
We will be using GitLab for all submissions. Please sign in to https://gitlab.cs.umd.edu by clicking on the UMD CAS Login
button, and ensure that your GitLab username matches your directory ID (this_part
@terpmail.umd.edu
).
Then, add an SSH key to your account by following the guide here:
The file id_ed25519
(no extension) is your private key. Treat this like your password and don’t share it with anyone!
The file id_ed25519.pub
is your public key. This is the one you register on Gitlab by going to Preferences (User Settings)
> SSH Keys
.
Installing Docker
Go to https://docs.docker.com/get-docker/ to install Docker. If docker is already installed on your computer, you can skip this step.
If you’re on Windows, make sure to turn on WSL2 integration. More on that here:
Then, run our setup script by entering below commands in your command-line.
# replace `~/Desktop` with a directory you want to work on
cd ~/Desktop
# copy the 417docker.sh script from materials to here
git clone git@gitlab.cs.umd.edu:cmsc417-s24/all/materials.git
cp materials/417docker.sh .
# never run shell scripts that you don't understand!
cat 417docker.sh
# make script runnable
chmod +x 417docker.sh
# run the script
./417docker.sh
The script sets up a Debian 12 container, installs all necessary dependencies, and creates a user named student
with sudo privileges. You can code, compile, and test in this container.
You will now see a directory named CMSC417
on your ~/Desktop
(or wherever you ran the script on). This directory is shared as the home directory for student
user in the Docker container, so that you can easily move files around.
The script should have put you on a shell running inside the Docker container. Run cat /etc/os-release
in your container shell and check if the output matches exactly as below:
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="<https://www.debian.org/>"
SUPPORT_URL="<https://www.debian.org/support>"
BUG_REPORT_URL="<https://bugs.debian.org/>"
Also check if file sharing is working as expected. In the shell of your Docker container, do:
# this creates empty file named asdf.txt
cd && touch asdf.txt
And ensure that you can see this file in your host’s CMSC417
directory (you may delete this file after checking that it works.
Working with containers in VSCode
You may use any editor you’d like, but if you don’t have any preferences, I would recommend trying Visual Studio Code, as it has great Docker integration. You can get it from:
![](https://code.visualstudio.com/opengraphimg/opengraph-home.png)
Then, install remote containers plugin:
Press Ctrl+Shift+P
(Cmd+Shift+P
on macOS) to open command palette, and type attach to running container
. Press enter
.
(Linux only) if you see permission errors, run this on your host shell and reboot: sudo usermod -aG docker $USER
Select cmsc417container
and press enter. Now your VSCode runs inside the container environment!
Once you have done this, the remote indicator on the left bottom (green in default theme) should indicate that you’re running inside the container. You may have to re-run attach to running container
every time you close and re-open VSCode.
Setting up git/ssh in containers
In your container, create the .ssh
directory with command below:
mkdir -p ~/.ssh
chmod 700 ~/.ssh
Now, on your host, find the shared directory and open the .ssh
directory you just created (e.g. CMSC417/.ssh
). Then find the id_ed25519
file you created in above step (the file I told you to treat like your password) and copy it into here so your container can have access to your remote Git repository.
Then, on your shell, run:
chmod 600 ~/.ssh/*
Checking if you have access
Navigate to https://gitlab.cs.umd.edu/cmsc417-s24/students/YOUR_DIRECTORY_ID
and see if you have access (if not, make a private post ASAP)