-
Notifications
You must be signed in to change notification settings - Fork 18
Removing start, stop with ec2.py, adding validations #1191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8f297b5 to
2542232
Compare
scripts/aws/ec2.py
Outdated
| self.__setup_vsockproxy(log_level) | ||
| self.__run_config_server() | ||
| self.__run_socks_proxy() | ||
| time.sleep(5) #TODO: Change to while loop if required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to sleep here? doesn't subprocess.run already run the command synchronously and will wait for its completion? For config server, it would be run as separate process so will never need to wait for it anyway?
or is this to wait for config server to startup so you could do validations? if so, you might wanna consider making it more robust (are we 100% sure 5 seconds wait is enough?), or at the very least, logs something during this 5 second wait to inform the customer this script is still running but waiting for something.
or maybe it should be in a loop and every 5 seconds the validation script will try to connect to the server until it's successful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or is this to wait for config server to startup so you could do validations? i
Yes. we can "Change to while loop if required. " as mentioned in comment.
ccb3374 to
061050d
Compare
5a127a3 to
9ee0d14
Compare
e2ed6d5 to
a6650e0
Compare
fe85a1a to
53495aa
Compare
1664a3c to
607fe20
Compare
Changes enclave start script to Python, to improve readability, remove duplications, and add more validations while starting enclave.
HOSTNAME, IDENTITY_SCOPE, CORE + OPTOUT_URLS fetched from userdata
Testing
Code is tested by creating an EC2 instance using "ami-0df2894e3f4971bda" (the recently published AMI) and copying the python files onto the instance and starting with python files.
You can change the values in secret manager to see errors thrown based on validations added
Sample run