Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Project Overview

TopCoder Competition Engine is a system used for Single Round Matches (SRM) and Marathon Matches (MM). 

Currently, Arena VM is heavily used to challenges related to TopCoder Competition Engine.

Competition Task Overview

Recently, we are in the progress of updating the TopCoder Competition Engine to work with AWS, like SQS and DynamicDB.

Previously, we have explored the way to install Fake SQS and DynamicDB local in Arena VM environment, so we can still have a working environment for TopCoder Competition Engine to continue development.

The purpose of this challenge is to update the Arena VM initialization scripts to install Fake SQS and DynamicDB local properly.

Arena VM Initialization Tutorial

For this challenge, every competitor will be grant root access to the Arena VM, so you can find the vm setup scripts at home directory of root user.

Following is the general description from my understanding for Arena VM initialization scripts.

  • /root/hook-script.sh - this is the hook script that will be called after the Arena VM allocated, it will retrieve the main-vm-script.sh to start the vm initialization - no changes should be applied to this, as it is hardly installed to the AMI image.
  • /root/main-vm-script.sh - the main vm initialization script for setting up TC VMs, not just the Arena VM, the INIT_TYPE will determine the scope for initialization, for this challenge, you just need to focus on INIT_TYPE = arena
  • /root/startup-tmp - the directory contains the shell scripts checkout by main-vm-scripts.sh.
  • /root/startup-tmp/common-init.sh - this inits the common setup like softwares.
  • /root/startup-tmp/db-init.sh - this inits the informix database and mysql database.
  • /root/startup-tmp/arena_init_script.sh - this sets up all related staff for arena (topcoder competition engine) and start service.
  • /root/startup-tmp/api-init.sh - this sets up the TC API under api account.
  • /root/startup-tmp/setup-env-variables.sh - this sets up the env variables.
  • /root/startup-tmp/clean_arena_init.sh - this will clean up the installation and setup by arena_init_script.sh, so we can re-run it.

Repeatable Test

For current situation, after running setup-env-variables.sh, you can repeatly run clean_arena_init.sh  and arena_init_script.sh.

The changes for arena related, should be added in to arena_init_script.sh.

Previous Approach

Previously, we have run PoC Assembly - Install Fake SQS and DynamoDB Local in Arena VM to figure out the way. The winning submission will be attached in forum.

Challenge Scope

The purpose of this challenge, is integrating the installation steps with VM initialization scripts. But following should be considered for review.

  • Instead of always building from scratch which takes more times, we should consider the build the binaries for one time, package and use it in VM initialization scripts.

for example, in common-init.sh (this can not repeatly executed), you can see 

# get updated Java 1.7
echo "getting updated java 1.7"
/usr/bin/scp -o StrictHostKeyChecking=no -B -i /root/.ssh/id_rsa-redhat_test-keypair root@$MASTERIP:/mnt/tcs/jdk-7u17-linux-i586.tar.gz /opt/
cd /opt
tar zxf jdk-7u17-linux-i586.tar.gz
rm /opt/jdk-7u17-linux-i586.tar.gz
cd /mnt

  • You don't need to upload it to master server. Just put in some public place, like Dropbox etc, which can be easily accessed.
  • The services should be automatically started by default.
  • Environment variables should be updated in .bash_profile, so it can be available generally

If you check arena_init_script.sh, you can see the setup of the various accounts, like apps, deployer, farm and mm account, is unzipped for package files, like 

#################################################################
# apps user initialization
#################################################################
echo 'Initializing apps user'
/usr/bin/scp -o StrictHostKeyChecking=no -B -i /root/.ssh/id_rsa-redhat_test-keypair root@$MASTERIP:/mnt/$APPS_FILE /mnt/
rm -rf /home/apps
/usr/bin/unzip -q -u /mnt/$APPS_FILE -d /home
chown -R apps.apps /home/apps
su - apps -c "ln -s jboss-4.0.5.GA jboss"
chmod 600 /home/apps/.ssh/id_rsa
chmod 600 /home/apps/.ssh/id_rsa_github

We'd like you to update the $APP_FILE or similar by updating the .bash_profile in it to setup PATH properly. the updated files can be put in some public place, like Dropbox etc.

for testing, you can replace the 

/usr/bin/scp -o StrictHostKeyChecking=no -B -i /root/.ssh/id_rsa-redhat_test-keypair root@$MASTERIP:/mnt/$APPS_FILE /mnt/

by wget command.

Generally, files reference by $MM_FILE, $APPS_FILE, $FARM_FILE and $DEPLOYER_FILE should be all updated.

Verification

if you check the winning submission, you can see there are steps for verification, please follow that for verification of the installation.

Winner Responsibility

Winner will help with updating of vm-setup scripts.

Arena VM Usage

Before asking your own VM, you need to have a public key on your profile before asking for the VM.

You can find more details on how to generate a key http://apps.topcoder.com/wiki/display/projects/Generate+SSH+Key and how to connect using it http://apps.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.

Please reference http://apps.topcoder.com/wiki/display/docs/Competition+Engine+VM+Setup for general usage.



Final Submission Guidelines

Submission Deliverables

Below is an overview of the deliverables:

  • new files for arena vm initialization
  • updated shell scripts for arena vm initialization
  • A complete and detailed documentation documented explaining how to deploy the application including configuration information.

Final Submission

For each member, the final submission should be uploaded to the Online Review Tool.

ELIGIBLE EVENTS:

2015 topcoder Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30047014