This was essentially my approach which after a lot of debugging, testing and revising worked out nicely!
My Key Contributions
For this GSoC task, I was assigned a separate development server to work on: http://cloud-copasi.cam.uchc.edu . It is up and running and currently has multiple users spread across different countries using it for simulation purposes.
I used SSH to log in to this machine and began my work by creating a new branch dev
from master
.
Following is my commit history and descriptions for each commit.
In my first commit, I attempted to tackle the problem, by creating a SSH free version on user level instead of considering it as a server configuration. I added a enable_ssh_free_version
check field in the AccountProfileForm
and added it into the Profile model in models.py
as well. Passing it as a keyword argument from the views to the templates, I was able to modify and remove AWS content from HTML pages using conditions as mentioned earlier in the approach.
I realized the issue in my earlier approach and discussed the need for a SSH-Free Cloud Copasi version on the server level. In this commit, I modified the settings.py
file to contain details of the submit node and the version server is running on. I removed the enable_ssh_free field from Profile model and made migrations. Furthermore, I coded the addition of a predefined pool in AccountRegisterView
and tested it on my local account instead of the svc_copasi one because of some misconfigurations in the service account. I modified all HTML templates to remove AWS content from account/
and pool/
sub-folders. task_views.py
file was also modified to add log statements for debugging.
HTML Templates that attempted to generate, share or delete AWS keys were disabled by using conditions based on the ssh_free
variable passed as a keyword argument to the template.
This commit fixed a few bugs. Around this time, the svc_copasi account was running and tested thoroughly. This commit involved renaming of the pool to ‘UConn HPC Pool’ as well as editing a few other templates that had AWS remnants left.
This commit merged remote-tracking branch ‘origin/master’ into dev because a new task/model type, ‘Profile Likelihood’ had been added to cloud COPASI.
This commit merged branch ‘master’ into dev because requirements.txt
file had been updated with Django version 4.0.6.
For users running the special version of cloud COPASI, the deleting the automatically UConn HPC Pool should not be an option. This commit removed the delete button for the default pool.
As I am still working on the cloud COPASI even after the GSoC period ends, I plan to refine code further by cleaning and refactoring it and removing extra log statements that I might have added.
Going Beyond
Reviving AWS
Since I finished my main GSoC task before anticipated time, my mentors decided to put me on improving Cloud-COPASI further by upgrading its another feature of letting users run their simulations on AWS cloud computing pools. Cloud COPASI has an AWS(Amazon Web Services) module that allows users who do not have access to an HPC Pool, to launch their own AWS EC2(Elastic Compute Cloud) pool through the simple interface. The only prerequisite for this is to have an AWS account.
This part of the code was written in boto which is a python SDK/API for AWS. However, boto is now obsolete and the code written in python2 is dead and non-functional.
I was assigned the task to revive the code and migrate the code-base to boto3 which is the recommended latest AWS API library for python3.
Progress from July 20— Present
Initially, I spent two weeks understanding the existing AWS dead code, learning the basics of AWS and EC2 instances, and exploring Boto3. Since then, there has been significant progress in the AWS pool instantiation. I am currently working in aws
branch in the repository. Following are the updates:
- Users can create a keypair on AWS and enter it into the
KeysAddView
form where they need to provide the Access Key ID, Secret Access Key and the region of their key. - On submitting the form, a key-pair gets added into the database and a Virtual Private Cloud corresponding to the key is created in AWS. A routing table, security group, subnet and internet gateway gets initialized.
- Once the key is added and VPC is made, user can head over to the AddEC2Pool page. In the form, they will need to provide the Name of the pool, the type of instance worker/compute nodes of the pool should be, the number of worker nodes to be instantiated, the choice of pricing (Fixed or Spot Price). Other than these, there are options to enable smart termination and alarm to notify of excess or unnecessary use.
- After the form has been submitted, the web-server creates and saves an ssh key pair for logging into the master node that is initialized. Master node is reserved followed by the worker nodes. The instances are initialized and their statuses are refreshed regularly. Alarm notification and smart termination is catered to as well. Both the master and worker nodes are sprung up from an Amazon ami image that has condor and COPASI installed and configured.
UserData
is different for master and worker through which IPs are configured accordingly.
Commit History
- aab3c76:
Boto3
requirement added to requirements.txt file - 0c9b238:
KeysAddView
code updated to boto3
. Now users’ can add a key-pair and the VPC gets created in their AWS account. - 0d5555b: Leftover boto2 VPC API calls for updating status shifted to
boto3
. - 784d569: Key sharing and deletion fixed in
key_shareN.html
- 56c0040: AWS key addition in
boto3
requires region to be specified. This has been added into AddKeyForm
and in the model as well. - fc2fab8: all functions and code in
ec2_tools.py
migrated to boto3
- b6edf8b: Fixed all errors. AWS pools is instantiated and master and worker nodes are reserved.
- d8f6a2e: Spot Price interface fixed by updating javascript functions and updating API views.
- 6245412: Time Series Graph for past spot price rates fixed.
- e4661b5 Removed accidentally added file in instance_keypairs.
So far everything works nicely. The pool gets initialized and appears on the dashboard. However, when the pool is tested with the model file or submitted a task, it fails. The files are transferred to the submit node as the logs indicate, however processing gets halted. The debugging is under process. Once this gets accomplished, the only milestone left will be testing and error handling!
Challenges Faced
My GSoC journey had ups and downs. I faced a few challenges in debugging errors that arose due to wrong server and account settings (for example incorrect partition), Condor and Bosco related issues, etc. but I was able to navigate through them with the help of my mentors. It took me time to get accustomed to writing code on a server to whom I only had SSH access, unlike my familiar VSCode environment. The AWS revival feature that I am currently working on, is very challenging and thus all the more fun! What fun is there when there is no challenge?
Future Improvements
There are several aspects in which Cloud-COPASI can be improved.
- There is still work to do on the AWS module to make it fully functional. After that has been accomplished, it has to be thoroughly tested because of its critical nature.
- In the special version of Cloud-COPASI, a curation mechanism can be added to ensure that the user registering and utilizing UConn’s HPC facility is legitimate and will not misuse it. This can be done by sending a request to the admin as soon as a user registers. Until the admin of the server approves the request, the user can not access the dashboard.
- The website is not SSL protected. A license can be attained for http://cloud-copasi.cam.uchc.edu/.
- UI of the web application is minimal and responsive but can be updated to a more refreshing look.
Final Thoughts
GSoC 2022 was a wonderful and exciting journey for me. It was my stepping stone in the arena of open source development and I learned a lot. There have been ups and downs, consecutive weeks where I couldn’t make significant progress but then days where I finished my tasks earlier than expected. Persistence is the key and so is communication with the mentors and organizations.
A Token of Thanks
I am extremely grateful for my mentors and their constant guidance and support. They are an inspiration and I hope that I get to continue interacting with them in the future!
I am grateful for my professors for their encouragement and I would also like to thank my family and friends who uplifted me in difficult times and supported me through thick and thin!
Contact and Connect
Feel free to connect with me on the following platforms!