Directory contents are as follows:
/ann- Annotator files/aws- AWS user data files/web- Web application files/util- Utility scripts for notifications, archival, and restoration
- Run
python launch_instance.pyin your local machine to create an EC2 instance you can SSH later. You can add the suffixweb,ann, orutilto the instance tag once it starts for use clarity. - Add from AWS Instances console and your to your remote SSH config file, like this:
Host <PREFERED-HOST-DENOMINATION>
HostName <PUBLIC-IPv4-DNS>
IdentityFile `~/.ssh/<CNET-ID>.pem`
User ec2-user
ForwardAgent yes
Then, SSH into instance.
- Activate virtual environment
source mpcs-cc/bin/activate. - Go into the
mpcs-ccdirectory and clone the repository for the project, as:git clone https://github.com/MPCS-51083-Cloud-Computing/final-project-benjaleivas gas. This will create a foldergasin your instance with all the necessary code. - If instance handles the web app:
- Go to
/home/ec2-user/mpcs-cc/gas/weband create.envfile according to instructions infinal_project.pdf, then runsource .env. - Run
python manage.py db init, thenpython manage.py db migrate, and finallypython manage.py db upgrade(only once!). - Go to
/home/ec2-user/mpcs-cc/gas/web/config.pyand replace '' with your corresponding ID. - Download deployment certification and keys using
aws s3 cp s3://mpcs-cc-resources/ssl/privkey.pem /home/ec2-user/mpcs-ccandaws s3 cp s3://mpcs-cc-resources/ssl/fullchain.pem /home/ec2-user/mpcs-cc, and modify the.envfile to update theSSL_CERT_PATHandSSL_KEY_PATHto these new files. - Run
chmod 755 run_gas.shto make file executable, then run./run_gas.sh console, and then go to https://bleiva.mpcs-cc.com:4433, the webpage should be up.
- Go to
If you run into trouble with the instances, particularly with the web app, and need to reboot them, please follow this process. In your local machine:
-
Run
python /Users/bleiva/Desktop/CAPP/quarters/2023-2024/3_spring/cc/mpcsdomain delete --subdomain bleiva --ip <PUBLIC IPv4 ADDRESS>with the public IP address of the instance that (currently) handles the web app. -
Terminate the web app instance in the AWS Instances console.
-
Run
python launch_instance.pyand tag it as<CNETID>-gas-web. -
Once the instance is running, run
python /Users/bleiva/Desktop/CAPP/quarters/2023-2024/3_spring/cc/mpcsdomain create --subdomain bleiva --ip <PUBLIC IPv4 ADDRESS>in your local machine with the public IP adress of the new instance. -
Then, we initate an
archive-retrievaljob to bring back the result files from the user's vault back to the S3 bucket. This job is also suscribed to the thaw process' topic ARN, so that we can know when the retrieval is done and the output is ready for download. -
After initiating all these processes, we delete the message that was received by the GLACIER_RESTORE queue.
-
On the other hand,
thaw.pyhas another queue GLACER_THAW listening to the messages described in step 4. -
Once this message is received, the output is retrieved, the
s3_key_result_fileis re-generated, and the previously vaulted result files are saved back into the S3 bucket.