Operating Systems

ECE344, Spring 2019
University of Toronto

Labs and website created by: Ashvin Goel
Deadlock

Quick Links

Lab AssignmentsQuercus Website

Fixing Broken Group Permissions

The old permission instructions were wrong and would eventually lead to errors after both users push. Following these commands, should fix any permission issues without needing to remake/change the git repository.
ssh ug250.eecg.utoronto.ca
cd /srv/ece344s/os-XXX
chmod -R g+rw ece344
chmod g+s `find ece344 -type d`
cd ece344
git config core.sharedRepository group
Potentially, both students/users must run the chmod commands (first 4 commands), as different files will be owned by different students. Hopefully, this resolves everything going forward. I apologize for these problems.

Submitting Lab Code

Please follow the instructions for submitting your lab code carefully.

Setup Remote Repository

You will need to do this step once and only one group member should preform this step.

Recall that you created a Git repository in ~/ece344 (see Setup Instruction 2 in Lab 1). We (i.e., the instructor and the TAs) cannot access this repository because it is within your home directory (that should no be accessible to others). Instead, you will submit your lab code by creating a clone (copy) of your repository to a remote repository location that is accessible to you and to us.

You need to run these instructions once to setup your remote repository. After that, you can update the remote repository by following the instructions in the next step.

  1. Each of you has been assigned a user number for this course. Below, we use XXX to denote your 3-digit user number.
  2. The remote repository will be located on the ug250.eecg.utoronto.ca machine. Log in this machine.
    ssh ug250.eecg.utoronto.ca
    
    Now create your repository as follows:
    cd /srv/ece344s/os-XXX
    mkdir ece344
    chmod 770 ece344
    cd ece344
    git init --bare --shared=group
    
    Make sure to replace XXX with your 3-digit (not 2-digit) user number. The chmod command above ensures that the repository will be accessible to the instructor and the TAs but not to other students. The git init command creates an empty Git repository.
  3. Now, you are done with this machine, so exit out of it.
  4. Back on your local machine, you need to tell the local repository about the location of the remote repository.
    cd ~/ece344
    git remote add origin ssh://ug250.eecg.toronto.edu/srv/ece344s/os-XXX/ece344
    
    The command shown above is run in your local repository. It associates the name origin with the remote repository. You can see that by using the git remote command.
    git remote -v
    
    It will show the following:
        origin  ssh://ug250.eecg.toronto.edu/srv/ece344s/os-XXX/ece344 (fetch)
        origin  ssh://ug250.eecg.toronto.edu/srv/ece344s/os-XXX/ece344 (push)
    
    Now you are ready to update your remote repository.

Setting Up the Partner's Repository

Once the remote repository is setup a partner can setup their local repository by cloning it. To setup the repostiory in your home directory do the following:
cd ~
git clone ssh://ug250.eecg.toronto.edu/srv/ece344s/os-XXX/ece344
This will create a local repository in ~/ece344.

Update Remote Repository

  1. Make sure that you are in your local repository.
    cd ~/ece344
    
  2. You can update your remote repository by running the git push command shown below. This command will only push the files that you have committed to your local repository, so make sure to commit all the relevant files to your local repository that you would like to push to the remote repository.
    git push -u origin master --tags
    
    When you run the command above, you will see:
        Branch master set up to track remote branch master from origin.
    
    Recall that your local repository branch is called "master" (see Setup Instruction 3 in Lab 1). The command above pushes the branch called "master" in your local repository to a new branch, also called "master", in the "origin" (or the remote) repository. The --tags option pushes your local tags to the remote repository. We will be using these tags to mark your labs, so don't forget to add the tags option. If you run git status, you should see the following:
        On branch master
        Your branch is up-to-date with 'origin/master'.
        
        nothing to commit, working directory clean
    
  3. You need to only run the push command with all the options shown above once. After that, you can push your commits in the local repository to the remote repository by typing the following commands in your local repository:
        git push
        git push --tags
    
    When you add a new tag (e.g., Lab1-end) and run the push command shown above, it will show you:
        To ssh://ug250.eecg.utoronto.ca/srv/ece344s/os-XXX/ece344
         * [new tag]         Lab1-end -> Lab1-end
    
    You may resubmit your code any number of times. For example, you may modify your code and update the end tag in the local repository (see Using Git). To resubmit this updated code, you will need to force an update to the tag on the remote repository by using the -f option. Here is the full sequence of operations:
    git tag -d Lab1-end // Deletes tag from previous submission for Lab 1
    git tag Lab1-end    // Creates tag for current submission for Lab 1
    git push --tags -f  // The "-f" option forces the tag to be pushed
                        // to the remote repository, even if the tag exist there
    
    You can update the remote repository at any time as shown above.

Submitting Code For Marking

You submit your code by simply tagging your code with the "end" tag for that lab and updating your remote repository. Then, you can test whether your submission succeeded by simulating our automated marking functionality.