CSE 390B Project 0: GitLab Setup and Course Setup Worksheet

Due on Thursday, January 6th, 2022

Learning Objectives

  • Get set up for the quarter by familiarizing yourself with infrastructure for CSE 390B.
  • This project is intended to be short and is not assigned for credit. Instead, it is meant to get your infrastructure set up for the quarter so you can complete the rest of the project series. For this project, you will run through the following instructions, which use Git to access starter code, fill out a brief worksheet, and then practice submitting your work. After these steps, you will have completed Project 0.

    If at any point in these instructions you aren't sure how to proceed in your specific setup, please post on the discussion board or email the course staff for clarification!

    Opening a Command-Line Interface

    This project is written from the perspective of a command-line interface. You may also hear the word "shell" used when referring to a command-line interface (these can be used interchangeably). If you aren't sure how to open a command-line interface on your computer, that is totally ok! UW's eScience Institute has a solid how-to on this page. If you use this link, please skip the "Download Files" and "Install Software" sections, they are not relevant for this course. All you care about is the "How to open a new shell" section found near the bottom. 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, which helps you manage 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.

    Some git terminology: A repository is a single directory (including its subdirectories) that git is keeping 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 (these instructions), or as a GUI application. Before continuing, please ensure git is installed on the computer where you intend to complete projects for this class by following the instructions at this link: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git. You should be able to complete the project series on any computer, whether Windows, MacOS, or Linux. If using Windows, please use the “Git Bash” application you just installed to run the commands below.

    Find Your 390B 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 CSE 390B repo (named cse390b-22wi-students/cse390b-22wi-<CSE NetID>) created for you already. If not, please contact your instructor as soon as possible to have one created.

    Add Your SSH Key

    This will allow you to access your repo without having to authenticate (i.e. type your password) every time and will greatly 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 "<netid>@cs.washington.edu" (include the quotes)
      2. When prompted which file to save the key in, hit enter (saves in listed default location)
      3. Hit 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. git clone <repo url from project page>
      1. Clones your repo 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.
    2. cd cse390b-22wi-<CSE NetID>
      1. Navigates into the very top-level directory of your repo, called the "root".

    Read the README.md file located in the root of your repo to learn more about the project organization.

    Complete the Course Setup Worksheet

    After cloning your repo following the steps above, navigate to projects/0 and find the file course_setup_worksheet.docx. Open with Microsoft Word, Pages, or another document editor (you can also upload to Google Docs as long as you download it again when you're done). This document is intended to help you get organized for the quarter ahead by compiling all the links for your courses in one place. We've created suggested sections for each type of link, but feel free to rearrange or delete if you find it more useful to you. When you are done, make sure the edited .docx file is located in the same spot—this is similar to how you'll submit worksheets for the rest of the quarter. Git is capable of handling a .docx file just like it can handle source code.

    Making a Commit

    From the command-line, execute the following commands:

    1. git status
      1. Prints out the status of the repo. You should see 1 edited file: zoom_links.docx
    2. git add zoom_links.docx
      1. Stages a new file/updated file for commit.
      2. Should output: git status: verify.txt staged for commit
    3. git commit -m "Finish project 0"
      1. Commits all staged files with the provided comment/message.
      2. Should output: git status: Your branch is ahead by 1 commit
    4. git push
      1. Publishes the changes to the central repo, which should now be viewable (may need to refresh) in the web interface.
      2. You might need to run git push -u origin master on the first commit (only).

    Submitting the Project

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

    1. git tag project-0
      1. Tags the most recent commit with the name "project-0".
    2. git push --tags
      1. Similar to before, this version of the git push command publishes tags to the central repo (viewable in the web interface).
      2. Don't forget this step! Otherwise, the tag will only be present in your local environment — course staff won't be able to tell which commit they should grade.

    Congratulations, you've completed project 0! You're ready to follow along with the project 1 demo in lecture on Thursday.

    Extra: Set up your Favorite Text Editor for HDL

    The course tools we distribute deal only with running, testing, and debugging your code. They are not good for editing code. To complete the coding portions of the projects in this course, you may use any text editor of your choosing. However, please note that we will be using programming languages that were invented for this course, so we don't recommend big heavy IDEs (Integrated Development Environments) like IntelliJ, Eclipse, Visual Studio, or JGrasp. They won't understand the languages well, and you won't need them to run code anyway because the course tools handle that.

    Instead, we recommend you use a lightweight text editor like VSCode, Atom, or Sublime Text. Fortunately, there are third-party extensions that can provide syntax highlighting to make your experience more pleasant. Follow the directions below if you'd like to get set up with one of these editors! Note that the extensions listed below are not created by the course staff, and may not have been thoroughly vetted.

    You are also welcome to use a command-line editor like Vim or Emacs if you prefer, although syntax highlighting support may be harder to find.

    VSCode

    Note: Visual Studio Code (this tool, lightweight editor) is different than Visual Studio (heavy IDE).

    Install VSCode

    Download the latest version at https://code.visualstudio.com/Download.

    Configure Syntax Highlighting for .hdl Files

    1. Select the "Extensions" panel on the left menu bar (look for an icon near the bottom made up of four squares)
    2. Search for roblourens.vscode-nand2tetris-hdl
    3. Click "Install" on the single result that comes up

    Atom

    Install Atom

    Download the latest version at https://atom.io/.

    Configure Syntax Highlighting for .hdl Files

    1. Navigate to the "Settings" menu, then on the bottom left select "Install"
    2. Search for language-nand2tetrisHDL
    3. Click "Install" on the extension with exactly the same name

    Sublime Text

    Install Sublime Text

    Download the latest version at https://www.sublimetext.com/3. Technically, the full editor costs money, but you may download and use a full-featured free trial for an unlimited period of time.

    Configure Syntax Highlighting for .hdl Files

    1. Navigate to this public GitHub repository: https://github.com/t17dr/sublime-nand2tetris
    2. Follow the directions there to enable syntax highlighting support
    3. Restart Sublime Text

    Acknowledgements and References