This section will help the onboarding process of new developers by providing lists of access and permissions you'll need, how to set up your development environments, how the production environment is set up and how you will go about submitting your changes to the StarExec repository.
Access Requirements
Below is a list of accounts and permissions you'll need and who can grant them to you.
Account / Permission | Who can grant it |
---|---|
User account on head node starexec.cs.uiowa.edu | CSG |
User account on worker nodes starexec#.star.cs.uiowa.edu | CSG |
GitHub account | Dr. Stump will need to add you to the StarExec team |
Head node personal development database and passwords | Lead developer |
Development Environment
We have two development environments that we use. The first is local to our own machines. We can do a lot of database and Java development off of the cluster and make changes locally. Each person also has the ability to host a cluster development environment which consists of your own Tomcat instance and database. This allows us to test the application in an environment as close to the production environment as possible. This also allows us to actually test things with the full cluster such as job distribution, etc. Each developer is responsible for setting up their own cluster environment however they see fit.
Local
Please note this software is not required for local development, it's just how we happen to have set things up for ourselves. You are more than welcome to use different tools etc. as long as it doesn't conflict with the repository and the structure of the project.
- Install Software
- Eclipse EE (optional)
Install Eclipse Helios Service Release 1
(Note: Eclipse Indigo will work, but some of the following settings will be named differently) - Apache Tomcat
Download version 7.0.4 of Apache Tomcat and extract it where you installed Eclipse EE - MySQL
At least version 5.5.6 is needed, for some features (LIMIT statements with procedure parameters) we use in our procedures. Install the latest version of MySQL Community Server . Remember the root username and password for later. - JDBC Connector
Download the latest version of the MySql JDBC driver
Extract the jar to Tomcat's lib folder. This is located wherever you extracted Tomcat. (Such asC:\Program Files\Eclipse EE\apache-tomcat-7.0.4\lib
) - Git
Install a subversion client. You can use the command line or a tool such as GitHub Desktop
- Eclipse EE (optional)
- Configure MySql
MySql needs to be configured to work properly with StarExec. This basically means you need to import our database schema into your instance of MySQL.- Open a command prompt
- Change your directory to the location of the starexec project you checked out from SVN (see 3a iii in these instructions)
- Within the starexec project directory change directories to
starexec\sql
- In the sql directory, confirm you see a file called NewInstall.sql
- Recall your MySQL root password and run the command
mysql -u"root" -p"password" < NewInstall.sql
- To populate the database with sample data run
mysql -u"root" -p"password" < NewInstall.sql
- You should see no output if there wasn't an error
Confirm the database was created by checking for tables and a description of an arbitrary table:
mysql -u"root" -p"password" USE starexec; SHOW TABLES; DESCRIBE users;
It is recommended you create a separate user for your database to mirror the permissions the starexec production app is running under. To do that locally, execute the following SQL commands with the desired USERNAME and PASSWORD when logged in as
root
CREATE USER 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD'; GRANT ALL ON starexec.* TO USERNAME@'localhost';
- Configure Eclipse (if you are using Eclipse for an IDE)
- Import StarExec
You may need to import the StarExec project you pulled down from SVN into your workspace. The project in the repository is a Dynamic Web Application project, which you cannot directly import to Eclipse, so we have to work around this...- Go to
File > New > Other...
then type indyn
in the search bar and selectDynamic Web Project
and hitNext
- Enter
starexec
as the project name and make sure theTarget runtime
isApache Tomcat v7.0
[you may need to look at 3b at this point to finish this part] and hitFinish
- [link no longer works???]Now on your desktop or in some temp folder do an SVN checkout from https://svn.divms.uiowa.edu/repos/clc/projects/starexec/dev/branches/fb1/starexec
- Copy everything from you checked out of the repo (
desktop/starexec/
) into the starexec dynamic web project you just created (workspace/starexec/
). Replace everything if prompted.
- Go to
- Setup Tomcat
Eclipse needs to know where you installed Tomcat.- Go to Window > Preferences
- Type in
server
in the search box - Select
Runtime Environments
under the server node - Click the
Add...
button - Under the
Apache
folder selectApache Tomcat v7.0
- Check the
Create a new local server
option - Click
Next
and leave the name field as whatever the default is - For
Tomcat installation directory
clickBrowse
and point to the folder that was created when you extracted Tomcat - Hit
Finish
- Add Apache's libraries to the project
- In Eclipse, right click the starexec project and hit
Properties
- Type
build
in the search window and clickJava Build Path
- If you see
Apache Tomcat v7.0
in the list in theLibrary
tab, you skip the rest of the steps in this section - Click
Add Library
and selectServer Runtime
- Hit
Next
and selectApache Tomcat v7.0
and hitFinish
andOk
until all dialogs are closed
Now that Eclipse can see tomcat and you have a local server, we need to configure the local server to match the production server configuration.
- In Eclipse, right click the starexec project and hit
- Import StarExec
- Configure tomcat
- Security Realm
We need to set up security realms for your local tomcat server to enable form based login. You essentially have to tell Tomcat how your database is set up so it can perform authentication for us.- Open your local
Server.xml
file. If you are using Eclipse, this file should be located in your project workspace under a specialServers
directory and within another folder containing your server's name. For example mine is:\Eclipse EE\Servers\Tomcat v7.0 Server at localhost
whereEclipseEE
is my Eclipse workspace. If you are working directly with Tomcat (no Eclipse), then you can find servers.xml in the conf/ subdirectory of the tomcat directory. The default servers.xml file has a "lockout" Realm controlling access to the Manager Application for tomcat. You can add the following
<Realm>
as a subrealm of this existing one in yourServer.xml
(or servers.xml) file, where USERNAME and PASSWORD are the username and password you established above for the starexec database on your MySql installation.<Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.JDBCRealm" driverName="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/starexec" connectionName="USERNAME" connectionPassword="PASSWORD" userTable="users" userNameCol="email" userCredCol="password" userRoleTable="user_roles" roleNameCol="role" digest="SHA-512" /> </Realm>
- Eclipse may complain when you try to run your server. You need to tell it to sync your filesystem and workspace so it's aware of external changes. Go to Window > Preferences > General > Workspace and check the
Refresh Automatically
box. Then hitApply
andOk
- Open your local
Turn off persistent sessions
By default, Tomcat will try to save sessions in between server restarts. We don't want this to happen since we cache certain objects in the session that can't be serialize and cause tomcat to spit out useless errors. To turn this off, replace theContext
tag in the server.xml file (from the previous step) with the following tag:<Context docBase="starexec" path="/starexec" reloadable="true" source="org.eclipse.jst.jee.server:starexec"> <!-- Disable persistant sessions --> <Manager className="org.apache.catalina.session.StandardManager" pathname=""/> </Context>
- Security Realm
- Configure StarExec
Everything should now be set up correctly except for StarExec configurations that are specific to your machine. By default StarExec loads a configuration file when it is started on a server. It is located along with all of the other config files in the project directory understarexec\src\com\starexec\config\starexec-config.xml
The file contains configurations for multiple users (e.g. production, tyler local dev, tyler cluster dev, etc.) to allow easy switching between configurations. You need to copy and existing<configuration>
node and paste it below another. Then change the name attribute on your configuration node to something meaningful such as "bob dev local". Then you'll need to change the appropriate fields. The only ones that need to be changed are the MySql properties (change them to match your local setup of MySql) and anything that is a PATH property. Change all paths to existing paths on your system (some such as Benchmark and Solver paths need to be created by you manually). If you need help setting this up, consult a lead developer. Finally at the very top in the starexec-configuration node, change thedefault
attribute to whatever your named your configuration node. - Set up SGE emulation (optional)
Follow the directions here to set up grid engine emulation
Cluster
Pending by CJ
- Install Tomcat
- Configure Tomcat
Configure MySql
Have another developer or yourself set up your mysql development accounts
Login under rootCREATE DATABASE dev_xy_starexec;
GRANT ALL PRIVELEGES ON dev_xy_starexec.* TO 'dev_star_root'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON dev_xy_starexec.* TO 'dev_star_app'@'localhost';- Configure StarExec
- Setup Scripts
- Run Tomcat/StarExec
1 Comment
Jensen, Tyler N
Q: I'm trying to change my apache version to 7.0.4, but I don't understand how to download it from Apache's archive. How does one?
Here's the URL: http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.4-beta/
A: Go into the bin/ folder and download the zip file that corresponds to what operating system you have (for instance I would use apache-tomcat-7.0.4-windows-x64.zip or the x86 32 bit version) Then extract it and follow the rest of the directions as normal.