Challenge Overview
Background
Topcoder is considering to refactor the TC Direct application by using RESTful APIs instead of calling various EJBs and directly contacting the underline database, which will allow us to begin decoupling TC Direct from its existing backend and provide exposure to some of its core services. As a first step, we want to avoid rewriting some of the complex business logic.
For the initial stage, we'd like to use AWS Lambda Function and AWS API Gateway to wrap around the EJB calls and database calls, and make the TC Direct to call the AWS API gateway instead. This way we isolate the depenencies between TC Direct and EJB services/informix, then we can move ahead quickly.
Scope
Previously in we have launched severeal challenges like Proof Of Concept - AWS Lambda Function to Invoke Direct EJB Service etc, and sorted out the way to use AWS Lambda Function to wrap arround the EJB calls and Database calls.
For this challenge, we'd like to follow the same approach to create AWS Lambda Function for add/remove copilot.
Requirements
1. We'd like to mimic the similar logic in Topcoder Direct, please learn from the existing logic to implement properly.
2. There will be two aws lambda functions to be created, in the same codebase.
- Add Copilot (The input should be projectId and userId).
- Remove Copilot (The input should be projectId and userId).
3. Currently, in TC Direct, we are using a complex mangement UI for copilot (add and remove in the same time), but for this AWS Lambda functions, the Lambda function will do single responsibilty, which mean Add Copilot will just do add copilot and grant permissions, Remove Copilot will remove copilot and revoke the permissions.
5. Please create the swagger api doc for the created aws lambda functions, please following the example provided in forum.
6. Please use AWS lambda swagger https://github.com/awslabs/aws-apigateway-importer to create api gateway endpoint using the created swagger api doc, and hook it with the aws lambda function
7. The json response should be simple and clear, and properly handle the error cases with proper messages.
Code Reference
You are not supposed to directly call ContestServiceFacadeBean, but need to split the logic in
com.topcoder.service.facade.contest.ejb.ContestServiceFacadeBean#updateCopilotProjects(TCSubject currentUser,
List<CopilotProject> copilotProjects, List<Boolean> removeFlags)
throws PermissionServiceException, ContestServiceException
Reference
1. Competitors need to request your own VM for development and testing.
2. For testing the getting general project info operation, you can directly create in Topcoder Direct for testing purpose.
3. You can visit http://<<vm-ip>>:8580/ to find the JNDI lookup name for remote EJB calls.
4. Please reuse any components in TC Direct instead of creating your own if possible.
5. The previous challenges will be provided in forum for reference.
VM ENVIRONMENT
If you need a Topcoder VM to work on this challenge, Please request the VM in the challenge forum.
Information about VM can be found below:
VM specific information is found here: http://www.topcoder.com/wiki/display/docs/VM+Image+2.5
Upon registration as a submitter or reviewer you will need to request a VM based on the new TopCoder Cockpit/Direct image. To request your image, please use the forum. Before requesting your VM, you need to ensure that you have an SSH key created and in your member profile. Instructions to do so are here: http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key, and instructions to connect afterwards are here:http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.
Final Submission Guidelines
- Complete source code for aws lambda function
- Working VM and aws lambda function for testing
- Deployment Guide and Verification Documentation