Skip to content

Commit

Permalink
Merge pull request #6494 from hotosm/fix/pdm-develop-cherrypicked
Browse files Browse the repository at this point in the history
Fix/pdm develop cherrypicked
  • Loading branch information
dakotabenjamin authored Jul 11, 2024
2 parents 9feaf0b + 1c5f01a commit c0e7193
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion backend/models/postgis/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
)
from backend.services.grid.grid_service import GridService
from backend.models.postgis.interests import Interest, project_interests
import os

# Secondary table defining many-to-many join for projects that were favorited by users.
project_favorites = db.Table(
Expand Down Expand Up @@ -271,7 +272,8 @@ def set_country_info(self):
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/58.0.3029.110 Safari/537.3"
)
),
"Referer": os.environ.get("TM_APP_BASE_URL", "https://example.com"),
}
try:
response = requests.get(url, headers=headers)
Expand Down
7 changes: 4 additions & 3 deletions scripts/aws/cloudformation/tasking-manager.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ const Resources = {
'export DEBIAN_FRONTEND=noninteractive',
'export LC_ALL="en_US.UTF-8"',
'export LC_CTYPE="en_US.UTF-8"',
'export PATH=$PATH:/root/.local/bin',
'dpkg-reconfigure --frontend=noninteractive locales',
'sudo apt-get -q -y update',
'sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade',
Expand All @@ -437,10 +438,10 @@ const Resources = {
'cd /opt/tasking-manager/',
cf.sub('git reset --hard ${GitSha}'),
'pip install --upgrade pip pdm==2.7.4',
'pdm export --prod > requirements.txt',
'wget -6 https://s3.dualstack.us-east-1.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz -O /tmp/aws-cfn-bootstrap-py3-latest.tar.gz',
'pip install /tmp/aws-cfn-bootstrap-py3-latest.tar.gz',
'pdm install',
'eval "$(pdm venv activate)"',
'pip install --user -r requirements.txt',
'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf',
'export LC_ALL=C',
'wget -6 https://s3.dualstack.us-east-1.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb -O /tmp/amazon-cloudwatch-agent.deb',
Expand Down Expand Up @@ -474,7 +475,7 @@ const Resources = {
cf.sub('export TM_IMAGE_UPLOAD_API_KEY="${TaskingManagerImageUploadAPIKey}"'),
'psql "host=$POSTGRES_ENDPOINT dbname=$POSTGRES_DB user=$POSTGRES_USER password=$POSTGRES_PASSWORD" -c "CREATE EXTENSION IF NOT EXISTS postgis"',
cf.if('DatabaseDumpFileGiven', cf.sub('aws s3 cp ${DatabaseDump} dump.sql; sudo -u postgres psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_ENDPOINT/$POSTGRES_DB" < dump.sql'), ''),
'pdm run -vv flask db upgrade',
'flask db upgrade',
'echo "------------------------------------------------------------"',
cf.sub('export NEW_RELIC_LICENSE_KEY="${NewRelicLicense}"'),
cf.sub('export TM_SENTRY_BACKEND_DSN="${SentryBackendDSN}"'),
Expand Down

0 comments on commit c0e7193

Please sign in to comment.