GettingStartedHacking - cloudcoderdotorg/CloudCoder GitHub Wiki
Getting started (Hacking)
This page explains how to set up a development environment for hacking on CloudCoder.
Despite the length of the instructions below, getting CloudCoder running on a development machine is pretty easy. The only external requirements (that aren't automatically downloaded) are Eclipse, the Google Eclipse plugin, and MySQL.
Step 1. Visit the project page and fork the repository.
Step 2. Clone your fork to produce a development repository on your development computer.
Step 3. In the top level of your local CloudCoder repository, run the command
./fetchdeps.pl
This fetches all of the jarfiles CloudCoder needs.
Step 4. Import your local repository and the projects it contains into Eclipse. (File → Git → Import → Projects from Git → Local, select the repository directory, and import all projects from it). Note that you will need to have the Google Plugin for Eclipse installed. Only GWT is required (you can leave out the Android and Google App Engine components.)
Step 5. Your development computer should have MySQL server running. The "root" account should have username "root". (This matches the default development configuration settings.) On Ubuntu, just install mysql-server and mysql-client. On a Mac, you can use MAMP. (We have not tried running CloudCoder on Windows.)
Step 6. Create an initial cloudcoder.properties file by running the command ./configure.pl in the top-level directory. Here is an example run:
Welcome to the CloudCoder configuration script!
Please enter the information needed to configure CloudCoder for your system.
You can just hit enter to accept the default value (if there is one).
Where is your GWT SDK installed (the directory with webAppCreator in it)?
==> /home/dhovemey/linux/java/gwt-2.5.0
########################################################################
>>> Database configuration properties <<<
########################################################################
What MySQL username will the webapp use to connect to the database?
==> root
What MySQL password will the webapp use to connect to the database?
==> root
What MySQL database will contain the CloudCoder tables?
[default: cloudcoderdb] ==>
What host will CloudCoder connect to to access the MySQL database?
[default: localhost] ==>
If MySQL is running on a non-standard port, enter :XXXX (e.g, :8889 for MAMP).
Just hit enter if MySQL is running on the standard port.
==>
########################################################################
>>> Login service properties <<<
########################################################################
Which login service do you want to use (imap or database)?
[default: database] ==>
########################################################################
>>> Builder properties <<<
########################################################################
What host will the CloudCoder webapp be running on?
(This information is needed by the Builder so it knows how to connect
to the webapp.)
[default: localhost] ==>
How many threads should the Builder use? (suggestion: 1 per core)
[default: 2] ==>
What port will the CloudCoder webapp use to listen for connections from
Builders?
[default: 47374] ==>
########################################################################
>>> TLS/SSL (secure communication between webapp and builder(s) <<<
########################################################################
Do you want to use the default keystore
(Answer 'yes' for development, 'no' for production)
[default: no] ==> yes
########################################################################
>>> Web server properties (webapp) <<<
########################################################################
What port will the CloudCoder web server listen on?
[default: 8081] ==>
What context path should the webapp use?
[default: /cloudcoder] ==>
Should the CloudCoder web server accept connections only from localhost?
(Set this to 'true' if using a reverse proxy, which is recommended)
[default: true] ==>
Write configuration file (cloudcoder.properties)?
[default: yes] ==>
Writing properties...Done!
Note that if you have the Google Eclipse plugin installed, it should have the GWT SDK installed somewhere within the Eclipse plugins
directory. Look for a directory that contains webAppCreator
inside it, and use that directory as the GWT SDK directory. (Or, you can download the standalone GWT SDK and use that.)
Step 7. Create the webapp database by running the CreateWebappDatabase program as a Java application from the CloudCoderModelObjectClassesPersistence project. You will enter some details about your CloudCoder account. Example run:
Please enter some information needed to configure the Cloudcoder
database. (Hit enter to accept a default value, if there is one.)
Enter a username for your CloudCoder account:
[default: ] ==> dhovemey
Enter a password for your CloudCoder account
[default: ] ==> muffin
What is your first name?
[default: ] ==> David
What is your last name?
[default: ] ==> Hovemeyer
What is your email address?
[default: ] ==> [email protected]
What is your website URL?
[default: ] ==> http://faculty.ycp.edu/~dhovemey
What is your institution name (e.g, 'Unseen University')?
[default: ] ==> localhost
Enter the URL of the exercise repository
[default: https://cloudcoder.org/repo] ==>
Warning: loading cloudcoder.properties from filesystem
Creating database
Creating schema version table...
Creating table cc_changes
Creating table cc_configuration_settings
Creating table cc_courses
Creating table cc_course_registrations
Creating table cc_events
Creating table cc_problems
Creating table cc_submission_receipts
Creating table cc_terms
Creating table cc_test_cases
Creating table cc_test_results
Creating table cc_users
Adding configuration settings...
Creating terms...
Creating demo course...
Creating initial user...
Registering initial user for demo course...
Creating hello, world problem in demo course...
Creating test case for hello, world problem...
Success!
Step 8. Start CloudCoder webapp and builder.
Right-click on the Builder2Server.java in the CloudCoderBuilder2 project (it's in the package that ends with .server) and choose Run As → Java Application; this is the component that builds and tests submissions. Note that you will see a number of exceptions in the console window (connection refused): this is because the webapp is not running yet. When the webapp is started the builder will connect and a message similar to "2013-08-16 10:09:53,609 Builder2Server INFO - Connected!" will be shown in the console. In general, it's fine to leave the builder running and start and stop the webapp as needed.
Next, right click on CloudCoder.gwt.xml in the org.cloudcoder.app package in the CloudCoder project, then choose Run As → Web Application (GWT Super Dev Mode): this starts the web application in "super dev" mode. You should see a URL in the Development Mode tab.
Step 9. Copy the development mode URL into your web browser. When you see the login screen, enter your CloudCoder username and password and you should be in business.