Skip to content

Commit

Permalink
Remove heroku v2 (#7271)
Browse files Browse the repository at this point in the history
* update dockerfile and remove post_compile
* remove more heroku mentions
* remove redis heroku ref
* update middleware and CSP
* remove irrelevant test and script references to heroku
remove tox heroku command from circleCI config
* more references removed
* remove prototype2 reference
* remove old TLS check for redis
  • Loading branch information
sarah-clements authored Sep 16, 2021
1 parent a8b46b6 commit 7ea0760
Show file tree
Hide file tree
Showing 25 changed files with 25 additions and 529 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
keys:
- node-deps-v1-{{ .Branch }}
- run: pip install tox
- run:
command: tox -e heroku
name: Run heroku builds and release checks
- run:
command: tox -e docs
name: Build docs
Expand Down
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ browserslist text eol=lf
Makefile text eol=lf
makefile text eol=lf

## HEROKU
Procfile text eol=lf
.slugignore text eol=lf

## GRAPHICS
*.ai binary
Expand Down
9 changes: 0 additions & 9 deletions .slugignore

This file was deleted.

53 changes: 0 additions & 53 deletions Procfile

This file was deleted.

106 changes: 0 additions & 106 deletions app.json

This file was deleted.

31 changes: 0 additions & 31 deletions bin/post_compile

This file was deleted.

5 changes: 0 additions & 5 deletions bin/pre_deploy
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/usr/bin/env bash

# This script is for running tasks that are 'release' rather than 'build' specific:
# https://devcenter.heroku.com/articles/runtime-principles#build-release-run
# It is referenced via the `release` entry in `Procfile`, and is run after the
# buildpack compile but prior to new code being deployed:
# https://devcenter.heroku.com/articles/release-phase
# NB: Changes made to the filesystem will not be preserved (use `post_compile` instead).

# Make non-zero exit codes & other errors fatal.
set -euo pipefail
Expand Down
7 changes: 7 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@ COPY --from=frontend /app/.build/ /app/.build/

RUN python manage.py collectstatic --noinput

# Generate gzipped versions of files that would benefit from compression, that
# WhiteNoise can then serve in preference to the originals. This is required
# since WhiteNoise's Django storage backend only gzips assets handled by
# collectstatic, and so does not affect files in the `.build/` directory
# since they are instead generated by Neutrino/webpack.
RUN python -m whitenoise.compress .build

ENTRYPOINT ["/bin/bash", "/app/docker/entrypoint_prod.sh"]
CMD ["web"]
2 changes: 0 additions & 2 deletions docker/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Use the same Python version as in Heroku (see runtime.txt)
FROM python:3.7.11

# Variables that are not specific to a particular environment.
Expand Down Expand Up @@ -27,6 +26,5 @@ ADD . /app
WORKDIR /app

# Common and dev deps installed separately to prove that common.txt works standalone
# (given that dev.txt is not installed on Heroku)
RUN pip install --no-cache-dir --disable-pip-version-check --require-hashes -r requirements/common.txt
RUN pip install --no-cache-dir --disable-pip-version-check --require-hashes -r requirements/dev.txt
15 changes: 1 addition & 14 deletions docker/entrypoint_prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,19 @@

# The `release` process type specifies the command to run during deployment, and is where
# we run DB migrations and other tasks that are 'release' rather than 'build' specific:
# https://devcenter.heroku.com/articles/release-phase
# https://devcenter.heroku.com/articles/runtime-principles#build-release-run
if [ "$1" == "release" ]; then
exec ./bin/pre_deploy

# The `web` process type is the only one that receives external traffic from Heroku's routers.
# We set the maximum request duration to 20 seconds, to ensure that poorly performing API
# queries do not consume a gunicorn worker for unbounded lengths of time. See:
# https://devcenter.heroku.com/articles/python-gunicorn
# The Heroku Python buildpack sets some sensible gunicorn defaults via environment variables:
# https://github.com/heroku/heroku-buildpack-python/blob/master/vendor/python.gunicorn.sh
# https://github.com/heroku/heroku-buildpack-python/blob/master/vendor/WEB_CONCURRENCY.sh
# TODO: Experiment with different dyno sizes and gunicorn concurrency/worker types (bug 1175472).
# queries do not consume a gunicorn worker for unbounded lengths of time.
elif [ "$1" == "web" ]; then
exec newrelic-admin run-program gunicorn treeherder.config.wsgi:application --timeout 20 --bind 0.0.0.0

# All other process types can have arbitrary names.
# The Celery options such as `--without-heartbeat` are from the recommendations here:
# https://www.cloudamqp.com/docs/celery.html
# The REMAP_SIGTERM is as recommended by:
# https://devcenter.heroku.com/articles/celery-heroku#using-remap_sigterm

# This schedules (but does not run itself) the cron-like tasks listed in `CELERY_BEAT_SCHEDULE`.
# However we're moving away from using this in favour of the Heroku scheduler addon.
# NB: This should not be scaled up to more than 1 dyno otherwise duplicate tasks will be scheduled.
# TODO: Move the remaining tasks to the addon and remove this process type (deps of bug 1176492).
elif [ "$1" == "celery_scheduler" ]; then
export REMAP_SIGTERM=SIGQUIT
exec newrelic-admin run-program celery beat -A treeherder
Expand Down
49 changes: 0 additions & 49 deletions lints/queuelint.py

This file was deleted.

2 changes: 1 addition & 1 deletion misc/compare_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def print_url_to_taskcluster(job_guid):
(decoded_task_id, _) = job_guid.split("/")
# As of slugid v2, slugid.encode() returns a string not bytestring under Python 3.
taskId = slugid.encode(uuid.UUID(decoded_task_id))
logger.info("https://taskcluster-ui.herokuapp.com/tasks/%s", taskId)
logger.info("https://firefox-ci-tc.services.mozilla.com/tasks/%s", taskId)


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"codecov": "rm -rf coverage && node ./node_modules/codecov/bin/codecov",
"format": "node ./node_modules/prettier/bin-prettier.js --write \"**/*.{css,html,js,jsx,json,md,yaml,yml}\"",
"format:check": "node ./node_modules/prettier/bin-prettier.js --check \"**/*.{css,html,js,jsx,json,md,yaml,yml}\"",
"heroku-postbuild": "yarn build",
"lint": "node ./node_modules/eslint/bin/eslint.js --report-unused-disable-directives --max-warnings 0 --format codeframe --ext js,jsx \".*.js\" \"*.js\" ui/ tests/ui/",
"lint-with-cache": "node ./node_modules/eslint/bin/eslint.js --cache --report-unused-disable-directives --max-warnings 0 --format codeframe --ext js,jsx \".*.js\" \"*.js\" ui/ tests/ui/",
"markdownlint": "npx markdownlint-cli -c .markdownlint.json -p .markdownlintignore .",
Expand Down
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion runtime.txt

This file was deleted.

Loading

0 comments on commit 7ea0760

Please sign in to comment.