Back to Resources

On Your Own Machine

by Tamara Nelson-Fromm, Jenny Chen, Brad Solomon

This guide will help you get started setting up an environment on your personal computer to let you do most of the labs and MPs without going into the EWS computer labs in Siebel. Choose one of the following methods to achieve this: 1) remotely connect to the EWS server or 2) work natively from your computer.

For those who are unfamiliar with these terms, here is a short explanation of what each method means and the pros and cons of each.

Working Remotely

Please Note: if you are on an off-campus network you will need to use a VPN before connecting remotely

Out of the following methods, we recommend connecting with SSH since an excessive amount of FastX sessions tends to become unstable on the EWS cluster, and FastX connections can have unexpected behavior.

Use FastX for GUI

You can run a full desktop GUI session in browser or with a client using FastX. Follow the link to learn how to use it.

Use SSH for a terminal/console session

SSH stands for secure shell. It allows you to connect to a remote server using terminal securely.

For first time shell users who don’t know how to edit files through terminal, try these common command line text editors: nano, vim, and emacs.

Working with a VM

Please Note: these instructions will not work for students using M1 Macs

1) Installing Docker

Docker is a lightweight container engine used to emulate OS-level virtual environments. For the purposes of this class, it will serve as an all-in-one tool for your local VM as there are existing addons for running a container through VSCode.

To install Docker, use the appropriate operating system installation.

2) Installing VSCode

If you have not already installed VSCode, you are encouraged to download the software at the following link: VSCode

Once it is installed, you can find the Remote-Containers extension by either searching the marketplace or using the following link: Remote-Containers

3) Create the course Dockerfile

The Dockerfile describes the base image and modifications required to match that of the EWS system. For this class, your Dockerfile will be very small (although requirements.txt will change throughout the semester):

DockerFile

FROM gradescope/auto-builds:latest
RUN apt-get install -y python3 python3-pip python3-dev
RUN pip3 install --upgrade pip
COPY requirements.txt ./
RUN pip3 install -r ./requirements.txt
ENTRYPOINT bash

requirements.txt

gradescope-utils>=0.3.1

To ‘install’ the Dockerfile correctly, make a new file with the above lines of text. Then save the file as Dockerfile with no file extension and place it in the root directory of your CS 277 Git repo. In other words it should be in the same folder as your various lab and mp folders (and not inside any particular lab or mp). Do the same for requirements.txt.

4) Create your ‘remote’ container

With the Remote-Container extension on VSCode, run the command ‘Remote-Container: Open Folder in Container’. You can do this by clicking on the bottom lefthand corner widget (the green ‘Open a Remote Window’ button) or by pressing F1 and typing the appropriate command.

The folder you want to open is your CS 277 Git repo – the first time you do this tell it to use ‘From ‘Dockerfile’. This option is only possible if you have successfully created the above Dockerfile in the correct location (inside the folder you are opening).

The first time you run this command it will take some time, as your computer will be creating a local VM container. In the future, telling VSCode to open up the folder will automatically reopen the correct image and be much faster!

If done correctly, you will be able to edit your local files using VSCode and run them using a VSCode terminal inside your local container.

Working Natively

Follow the guide for your own operating system.

Windows

The Windows Subsystem for Linux (WSL) is a tool allowing Linux to run in Windows natively.

  1. Follow Microsoft’s instructions for installing WSL, choosing Ubuntu as the distribution.
  2. Continue following Microsoft’s instructions for initializing your Ubuntu distribution
  3. Download the packages used for Python by running the following command to install the packages we will be using:
sudo apt-get update; sudo apt-get install git python3.8

Using your Windows Desktop in WSL/Ubuntu

When you start Ubuntu, your shell will begin in the Linux home directory. However, you will likely want to work with files that are inside of your Windows file system. By default, your C: drive is mounted at /mnt/c.

Some find it useful to create a shortcut to jump directly to your Windows Desktop:

  cd /mnt/c/Users/
  cd <Your-User-Name-on Windows>  // Use `ls` to find the available users in green
  cd Desktop
  ln -s `pwd` ~/desktop

Linux

You should make sure you have the following packages installed:

After installing the required packages, you should now be able to check out, build, and run assignments as described in their documentation.

MacOS

To install Homebrew: (You can skip this if you already have Homebrew installed)

In your terminal, (Applications->Utilities->Terminal) run:

xcode-select --install

to install the Xcode command line tools.

Next, we will install the Homebrew Package Manager for macOS using the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install Python3

In your terminal, (Applications->Utilities->Terminal) run:

brew install python@3.8

At this point, you should be able to run Python 3 and can test it by checking the version:

python3 --version