Skip to content
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

Python 3.7 #1703

Closed
Changaco opened this issue Mar 12, 2020 · 2 comments · Fixed by #2029
Closed

Python 3.7 #1703

Changaco opened this issue Mar 12, 2020 · 2 comments · Fixed by #2029
Labels
DevX making it easier to develop and maintain Liberapay

Comments

@Changaco
Copy link
Member

Changaco commented Mar 12, 2020

This issue is about migrating the production server to Python 3.7, which is a prerequisite for #1702. The previous issue, for the migration from 2.7 to 3.6, was #1398.

AWS Elastic Beanstalk supports Python 3.7, however it's currently still marked as "beta": 64bit Amazon Linux 2 v0.1.0 running Python 3.7 (BETA).

Amazon Linux 2 was launched two years ago (Amazon Linux 2 – Modern, Stable, and Enterprise-Friendly | AWS News Blog), and Python 3.7.0 was released almost two years ago as well (PEP 537 -- Python 3.7 Release Schedule), so I'm not sure what is "beta" in this stack.

Update: aws elasticbeanstalk list-available-solution-stacks now returns 64bit Amazon Linux 2 v3.0.3 running Python 3.7.

@Changaco Changaco added the DevX making it easier to develop and maintain Liberapay label Mar 12, 2020
@Changaco
Copy link
Member Author

Changaco commented Jul 9, 2020

I'm trying the migration: aws elasticbeanstalk update-environment --solution-stack-name "64bit Amazon Linux 2 v3.0.3 running Python 3.7" --environment-name "liberapay" --region "eu-west-1".

@Changaco
Copy link
Member Author

Changaco commented Jul 9, 2020

It failed, the new instance seemed to be stuck in an infinite loop inside cloud-final.service.

Jul 09 08:45:08 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + RESULT=1
Jul 09 08:45:08 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + [[ 1 -ne 0 ]]
Jul 09 08:45:08 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + sleep_delay
Jul 09 08:45:08 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + ((  2 < 3600  ))
Jul 09 08:45:08 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + echo Sleeping 2
Jul 09 08:45:08 ip-172-31-22-174.eu-west-1.compute.internal [2619]: Sleeping 2
Jul 09 08:45:08 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + sleep 2
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + SLEEP_TIME=4
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + true
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + curl https://elasticbeanstalk-platform-assets-eu-west-1.s3.eu-west-1.amazonaws.com/stalks/eb_python37_amazon_linux_2_1.0.501.0_20200619011200/lib/UserDataScript.sh
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]:                                  Dload  Upload   Total   Spent    Left  Speed
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: [158B blob data]
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + RESULT=0
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + [[ 0 -ne 0 ]]
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + SLEEP_TIME=2
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [2619]: + /bin/bash /tmp/ebbootstrap.sh 'https://cloudformation-waitcondition-eu-west-1.s3-eu-west-1.amazonaws.com/…/AWSEBInstanceLaunchWaitHandle?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20200709T083041Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=XXXXXXXXXXXXXXXXXXXX%2F20200709%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Signature=…' arn:aws:cloudformation:eu-west-1:… 01abe027-d2fb-46a8-aa46-143edb6f4ccf https://elasticbeanstalk-health.eu-west-1.amazonaws.com '' https://elasticbeanstalk-platform-assets-eu-west-1.s3.eu-west-1.amazonaws.com/stalks/eb_python37_amazon_linux_2_1.0.501.0_20200619011200/lib/platform-engine.zip eu-west-1
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:10.907Z] Started EB Bootstrapping Script.
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:10.909Z] Received parameters:
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  RPMS =
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  TARBALLS =
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  EB_GEMS =
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  SIGNAL_URL = https://cloudformation-waitcondition-eu-west-1.s3-eu-west-1.amazonaws.com/…/AWSEBInstanceLaunchWaitHandle?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20200709T083041Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=XXXXXXXXXXXXXXXXXXXX%2F20200709%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Signature=…
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  STACK_ID = arn:aws:cloudformation:eu-west-1:…
Jul 09 08:45:10 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  REGION = eu-west-1
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  GUID =
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  HEALTHD_GROUP_ID = 01abe027-d2fb-46a8-aa46-143edb6f4ccf
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  HEALTHD_ENDPOINT = https://elasticbeanstalk-health.eu-west-1.amazonaws.com
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  PROXY_SERVER =
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  HEALTHD_PROXY_LOG_LOCATION =
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]:  ENGINE_URL = https://elasticbeanstalk-platform-assets-eu-west-1.s3.eu-west-1.amazonaws.com/stalks/eb_python37_amazon_linux_2_1.0.501.0_20200619011200/lib/platform-engine.zip
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:10.912Z] reboot of instance.
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:10.914Z] Started executing cfn_init _OnInstanceReboot.
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:10.916Z] Running cfn-init ConfigSet: _OnInstanceReboot.
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:10.919Z] Using local cached stack name for reboot.
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:11.479Z] Command Returned:
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:11.481Z] Completed executing cfn_init.
Jul 09 08:45:11 ip-172-31-22-174.eu-west-1.compute.internal [16308]: [2020-07-09T08:45:11.483Z] finished _OnInstanceReboot
… lines above repeated many times

@Changaco Changaco mentioned this issue May 21, 2021
Changaco added a commit that referenced this issue May 23, 2021
This branch upgrades the Liberapay webapp in several ways. The production servers will now run Amazon Linux v2 instead of the old v1, Python 3.8 instead of 3.6 (closes #1703), `gunicorn` instead of Apache's `httpd` with `mod_wsgi`, and `cloudflared` instead of an Amazon load balancer. This last point fixes #1093 and will zero out a part of our AWS bill, but those savings won't lower the overall bill because on the other hand I've increased the resources allocated to the database and webapp.

Although it wasn't part of the plan, this branch can be considered a step towards #1727.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevX making it easier to develop and maintain Liberapay
Development

Successfully merging a pull request may close this issue.

1 participant