Updated health checks failing on GAE with custom runtime

225 views
Skip to first unread message

Mike Hardy

unread,
Sep 10, 2017, 11:51:39 AM9/10/17
to Google App Engine
Hi There, we're having problems getting our app to function correctly using a custom runtime and updated health checks. We're using the custom runtime to add tests + migrations to our deployment. Below are our Dockerfile, urls.py, and app.yaml. I'm also including a snapshot of the logs Where are we going wrong? Any suggestions? Note: if we use the standard python runtime with legacy checks, the app works fine, but no tests/migrations.

Dockerfile


# Use python 3 version of GAE base image
LABEL python_version python3.5
RUN virtualenv --no-download /env -p python3.5
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH

# Install all dependencies in requirements.txt
ADD requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt

# Add the application source code.
ADD . /app

# Run staging migrations then tests. Then run the gunicorn server
WORKDIR /app
EXPOSE 8080
CMD python manage.py migrate --settings app.settings.staging && \
    gunicorn -b :8080 app.wsgi


app.yaml
runtime: custom
env: flex
entrypoint: gunicorn -b :8080 app.wsgi

beta_settings:
    cloud_sql_instances: CONNECTION

runtime_config:
  python_version: 3

automatic_scaling:
  min_num_instances: 1
  max_num_instances: 1

resources:
  cpu: 1
  memory_gb: 0.90
  disk_size_gb: 10

liveness_check:
  path: '/liveness_check'
  timeout_sec: 4
  check_interval_sec: 30
  failure_threshold: 4
  success_threshold: 2
  initial_delay_sec: 3600

readiness_check:
  path: '/readiness_check'
  timeout_sec: 4
  check_interval_sec: 5
  failure_threshold: 2
  success_threshold: 2
  app_start_timeout_sec: 3600

urls.py
    url(r"/readiness_check", lambda r: HttpResponse("OK", status=200)),
    url(r"/liveness_check", lambda r: HttpResponse("OK", status=200)),

log
{
httpRequest: {
referer: "-" 
remoteIp: "130.211.3.140" 
requestMethod: "GET" 
requestUrl: "/readiness_check" 
responseSize: "3884" 
status: 404 
userAgent: "GoogleHC/1.0" 
}
insertId: "17auvqqf74e9ms" 
jsonPayload: {
latencySeconds: "0.009" 
time: null 
trace: "-" 
}

Kenworth (Google Cloud Platform)

unread,
Sep 10, 2017, 2:45:17 PM9/10/17
to Google App Engine
I noticed that you also posted this in StackOverflow on a tag we monitor and Public Issue Tracker. As it may potentially qualify as a defect report, we will be helping you on the issue tracker created. I recommend community users that experiences the same issue to post their feedback on the issue tracker so proper weight and attention be given to it. Please feel free to update this thread once a resolution has been reached.

Reply all
Reply to author
Forward
0 new messages