Project 1: Course Resources and GitLab Setup

Due Date: Friday, January 5, 2024 at 11:59pm

Learning Objectives

  • Set up a text editor for coding in a Hardware Descriptive Langugage (HDL).
  • Become familiar with your courses and the resources you have available for each class.
  • Gain practice submitting a CSE 390B project using GitLab and Gradescope.
  • Introduction

    This project is intended for you to become familiar with the infrastructure for this course and the rest of the projects for this course. In Project 1, you will walk through the following instructions, use GitLab to access starter code, complete a worksheet, and then practice submitting your work. After these steps, you will have completed Project 1.

    If you become unsure of how to proceed at any point in this project and all future projects, please post on the Ed discussion board or email the course staff for clarification.

    Instructions

    Navigate to the Project 1 assignment on Canvas. Download the document template titled Project 1.docx. Open the document, read the instructions for each part of the project listed on the first page, and estimate the amount of time you think it will take you to complete this project. Then, complete parts I, II, and III of the project.

    Part I: Course Resources Worksheet (5 points)

    Complete the course resources part of the worksheet that you downloaded earlier. This activity is intended to help you get organized for the quarter ahead by compiling class times and resources for your courses.

    Part II: GitLab Setup (5 points)

    Opening a Command-Line Interface

    This project is written from the perspective of a command-line interface (used interchangeably with the word "shell"). If you aren't sure how to open a command-line interface on your computer, UW's eScience Institute has a tutorial on this page that will help familiarize yourself with the command-line interface. If you use this link, skip the "Download Files" and "Install Software" sections, as they are not relevant for this course. Only the "How to open a new shell" section near the bottom is relevant for us. Once you have a shell open, you can move onto the next steps.

    Using Git

    This project will require you to use a tool called git, a tool that manages changes to files and handles syncing them with a server (GitLab). If you're already familiar with git, you can skip to the next section.

    Here is some terminology for using git: A repository is a single directory (including its subdirectories) that git can keep track of. One version is stored on the server (sometimes called the remote or origin) and you use the git program, installed on your computer, to create a local copy (clone) of that repository. The real power of git is that it tracks changes to files, where a commit is a set of those changes.

    You can use git as a command-line tool (which are outlined in these instructions), or as a GUI application. Before continuing, ensure git is installed on the computer where you intend to complete projects for this class by following the instructions at this link. You should be able to complete the project series on any computer operating system, whether that's Windows, MacOS, or Linux. If you are using Windows, use the “Git Bash” application you just installed to run the commands below.

    Finding Your CSE 390B GitLab Repository

    1. Navigate to https://gitlab.cs.washington.edu/. If you have a CSE NetID, use the green “CSE NetID” button. Otherwise, use the white “UW NetID” button.
    2. In your list of Projects, you should see a repository for CSE 390B (named cse390b-24wi-students/cse390b-24wi-[CSE NetID]) created for you already. If not, please contact your instructor as soon as possible so that we can create one for you.

    Adding Your SSH Key

    SSH stands for "Secure Shell." SSH keys serve as an access credential to connect to a server. This will allow you to access your GitLab repository without having to authenticate (i.e., type your password) every time you connect to your GitLab repository. This allows you to speed up your workflow.

    1. Check to see if your environment already has an SSH key
      1. On the command line, run cat ~/.ssh/id_rsa.pub.
      2. If you see a long string starting with ssh-rsa or ssh-dsa, skip to Step 3.
    2. Generate a new SSH key
      1. Run ssh-keygen -t rsa -C "[CSE NetID]@cs.washington.edu" (include the quotes).
      2. When prompted which file to save the key in, hit enter (this saves the key in the listed default location).
      3. Press enter when prompted for passphrase (empty for no passphrase).
      4. Hit enter again to confirm no passphrase.
      5. Your SSH key is now created and stored.
    3. Copy your SSH key
      1. Run cat ~/.ssh/id_rsa.pub.
      2. Copy the complete key (starting with ssh- and ending with your username and host).
    4. Add your SSH key to GitLab
      1. Navigate to your SSH Keys page by clicking your avatar in the upper-right, then “Settings,” then “SSH Keys” in the left-side menu.
      2. Paste into the “Key” text box and give a “Title” to identify what machine the key is for.
      3. Click the green “Add key” button below “Title.”

    Exploring the Starter Code

    From the command-line, execute the following commands:

    1. cd [Preferred local directory to store your repository]
      1. For example, cd /Users/ericfan/Documents/
    2. git clone [Clone with SSH URL]
        Clones your repository so a copy of it exists in your local environment—find the URL by clicking the blue “Clone” button in the upper-right of your project’s Details page.
    3. cd cse390b-24wi-[CSE NetID]
        Navigates to the top-most directory of your repository, called the "root directory."

    Read the README.md file located in the root of your repository to learn more about Project 1.

    Changing Files

    1. Open your computer's file manager (i.e., File Explorer for Windows and Finder for macOS). Then, navigate to the Project 1 directory: /cse390b-24wi-[CSE NetID]/projects/p1/.
    2. Open the file about_me.txt.
    3. Please tell us a little about yourself in this file. Related to CSE 390B, you can talk about how you learn the best, what your learning style is, how your TA can best support you, what you are most excited or anxious about in taking CSE 390B this quarter, or your goals for taking this class. You can also talk about your cultural background, what commitments you have this quarter, any previous computing experiences, what your journey into computer science has been like, what you are excited or anxious about for this quarter, etc. No need to address all of these questions; they are merely here to get you thinking about what you can share about yourself. Please write at least three sentences describing yourself in this file.

    Making a Commit

    Now, from the command-line, execute the following commands:

    1. git status
      1. Prints out the status of the repository. You should see a message informing you that the changes you made to the file have not been staged for commit yet: modified: about_me.txt
    2. git add about_me.txt
      1. This command stages a new file or an updated file for the commit phase.
      2. Now, when you run git status, you should see the message: Changes to be committed: with your modified about_me.txt file: modified: about_me.txt
    3. git commit -m "Update about_me.txt"
      1. Commits all staged files (files that you ran git add on) with the provided message.
      2. You should receive a message informing you that one file has been changed with the number of characters that have been inserted and deleted.
      3. Commit messages are somewhat arbitary, but they should be informative and reflect what the changes made since the last commit look like. This webpage includes a few general guidelines for writing commit messages.
    4. git push
      1. Publishes the changes to the repository on the GitLab server, which should now be viewable (you may need to refresh the page) in the web interface.
      2. You may need to run git push -u origin master on the first commit (only).

    Make commits often! They allow you to make checkpoints in your projects that you can always revisit.

    Submitting Part II

    Whenever you submit a project in this course, you’ll “tag” the last commit so the course staff knows what version of your code you would like us to grade. The following instructions are for Project 1 but can be adapted for every project:

    1. Make sure you have committed and pushed your latest changes for Project 1.
    2. git tag project-1
      1. Tags the most recent commit with the name "project-1".
    3. git push --tags
      1. Similar to before, this version of the git push command publishes tags to the GitLab server (viewable in the web interface).
      2. Don't forget this step! Otherwise, the tag will only be present in your local environment. The course staff won't be able to tell which commit they should grade without a tag.
    4. Please confirm that you have successfully added a tag to your commit and that your tag is associated with the proper commit with your work (i.e., the about_me.txt file that you edited earlier). You can do so by following these steps:
      1. Navigate to your CSE 390B GitLab repository.
      2. Click on "Tags". The link is located towards the top left of the page. (Tip: If you Ctrl+F or Cmd+F "tags", it should highlight the right link as the first result it finds.)
      3. Find the name of the tag that you just tagged (for this project, "project-1").
      4. Right below the name of the project, you will find the commit that the tag is assocated with.
      5. Click on the commit, and ensure that it contains your expected changes (for this project, it should include the changes you made to about_me.txt).

    Part III: Project 1 Reflection (5 points)

    Each project will include a reflection component on the last page of the project's template document. In the document titled Project 1.docx, record an estimation of how long you think the project will take (this step should be completed after reading through the instructions of each project), how long the project actually took, and a short, written reflection on the project went for you.

    Submitting Your Work

    Make sure you have submitted your about_me.txt file on GitLab by following the instructions in the heading above titled "Submitting Part II." Then, save your Project 1.docx document as a PDF and submit the document to the assignment titled "Project 1: Course Resources & GitLab Setup" on Gradescope. Project 1 will be considered completed once you have followed these steps.

    Optional: Set Up a Text Editor

    If you feel like getting ahead, you may look into setting up a text editor for this course by perusing this resource. A text editor will be handy in Project 2 and onward.