LARA

Labs Setup

This page contains instructions on how to set up your computer such that you can:

  • program your assignments,
  • share them with your teammate via a version control system,
  • submit your labs for grading, and
  • use our black-box testing system.

Step 1) Installing and Configuring Eclipse

You are by no means required to use an IDE. If you wish to do so, we recommend that you use Eclipse with the Scala plug-in. Skip this step if you are not going to use Eclipse.

Installing Eclipse:

  1. From the Eclipse Indigo downloads page, get Eclipse IDE for Java Developers for your system.
  2. To install it, simply uncompress the archive in a directory of your choosing. There is no installer, uncompressing is enough.
  3. Launch Eclipse (your version should be called Indigo).

Note that the Scala plugin does not support eclipse versions higher than Eclipse 3.7 Indigo.

Step 1.a) Scala Plugin

Installing support for Scala:

  1. Go to Help→Install New Software…
  2. Click Add… to add a software repository.
  3. Use http://download.scala-ide.org/sdk/e37/scala210/stable/site as the Location and, e.g., “Scala plug-in repository” as the Name.
  4. In the list of packages that appears, select all three. Click Next> twice, accept the license and click Finish. (Click Ok if during installation you get a warning about content not being signed.)

Step 1.b) Git Plugin

All labs will be done in pairs. We have set up a version control system around Git, which you will use to share your project code with your partner, but also to submit your labs. You need to install a plugin in order to have git support from within Eclipse.

Installing the EGit plugin for Eclipse:

  1. Go to Help→Install New Software…
  2. In the Work with menu, choose the Indigo repository.
  3. Use the filter box to find the Eclipse EGit package, select it and install it.

Step 2) Creating a Public/Private SSH Key Pair

Authentication to the git repository works by using a SSH key. If you do not already have a private/public key combination for your computer, follow these instructions. Note that you typically generate one key pair per computer that you use.

From the Command Line

  1. Type ssh-keygen -t rsa -b 2048.
  2. Type enter to save it in the default location.
  3. Choose a passphrase, or type enter to ignore it.
  4. Your public key is now stored in a file (typically, in ~/.ssh/id_rsa.pub). You will need to copy-paste the content of this file into our webservice.

Step 3) Project Web Interface

The web interface for your project will be directly linked to your git repository. It will allow you to run tests, submit deliverables, receive feedback, etc..

The web interface is located at http://larasrv05.epfl.ch/cc13 (Tequila authentication required.)

As mentionned earlier, all labs will be done in pairs. Try to form groups of two as much as possible. You will have the choice of either creating a new group or joining an existing group.

  1. Go to http://larasrv05.epfl.ch/cc13 and authenticate yourself
  2. The first time you access this page, it will ask you to either 1) create a new group 2) join an existing group
  3. Once you are within a group, go to the Keys tab, and register the Public SSH key you just generated

Step 4) Setting up Your Project

You should start by installing Git and sbt for your platform.

From the Command Line

The first step is to clone the git repository:

$ git clone git@larasrv05.epfl.ch:cc2013-group?? 

(Exact URI is provided in the web interface under Repository > URI)

Then, use sbt (http://www.scala-sbt.org/) to compile your project:

$ cd cc2013-group??
$ sbt
> compile
> ...
> run programs/Pi.tool

Create an Eclipse Project

Configure your sbt project by adding the sbt-eclipse plugin. Add the following line to cc2013-group??/project/plugins.sbt:

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")

Then relaunch sbt and run:

> eclipse

Note: if you encounter dependencies error related to sbteclipse, make sure you are running sbt 0.13!

You can then import this project from Eclipse, under FileImport…General > Existing projects into Workspace

To run your project, you need to add a new Run Configuration based on Scala Application, use toolc.Main as Main class, and pass e.g. programs/Pi.tool as argument.

Troubleshooting

Dependency for sbt-eclipse not found

Make sure you are running sbt 0.13!

The Git repository is asking you for a password

No password will ever work. This simply means that the ssh key-pair is not properly installed.

Make sure the public key can be accessed under ~/.ssh/id_rsa.pub and that you copied the entire key to the web interface: ssh-rsa AASDFFOOBAR… foo@bar.com

Undefined method ???

This means your Scala-IDE is running Scala 2.9, not Scala 2.10.

Go to Install new software and add the 2.10 URL(http://download.scala-ide.org/sdk/e37/scala210/stable/site) and proceed with the installation/upgrade of the IDE to Scala 2.10.