Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Managed VM deployment error

FROM google/debian:wheezy
MAINTAINER [email protected]

# Fetch and install Node.js
RUN apt-get update -y && apt-get install --no-install-recommends -y -q curl python build-essential git ca-certificates
RUN mkdir /nodejs && curl http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1

# Add Node.js installation to PATH
ENV PATH $PATH:/nodejs/bin

# Install redis
RUN apt-get install -y redis-server

# Install supervisor
RUN apt-get install -y supervisor

# Add Node.js installation to PATH, and set
# the current working directory to /app
# so future commands in this Dockerfile are easier to write
WORKDIR /app

ENV NODE_ENV development

ADD package.json /app/

# RUN npm install

# Adds app source
ADD . /app

ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]

Hello,

I have been trying to deploy an app on a Google Managed VM based on a Node.JS runtime. However, this seems to be a little confused to me as I still get this error while deploying :

ERROR: (gcloud.preview.app.deploy) Not enough VMs ready (0/1 ready, 1 still deploying). Deployed Version: 280815s.386747973874670759

We have been able to deploy it one week ago, so this error does not occur every time (it this reccuring for 2 days now). I guess there is something wrong with our configuration, maybe regarding our app.yaml or our Dockerfile, but I still can't figure out what is going on. Furthermore, the VM is created but is inaccessible, the SSH connection gets lost. I was wondering if this was not coming from Google. Do you have any idea ?

Here is the app.yaml :

module: default
runtime: custom
api_version: 1
vm: true
# manual_scaling:
#   instances: 1

# [START scaling]
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 5
  cool_down_period_sec: 60
  cpu_utilization:
    target_utilization: 0.5
# [END scaling]

health_check:
  enable_health_check: False
  check_interval_sec: 20
  timeout_sec: 4
  unhealthy_threshold: 2
  healthy_threshold: 2
  restart_threshold: 60

handlers:
 - url: /.*
   script: server.js

Here is the Dockerfile :

FROM google/debian:wheezy
MAINTAINER [email protected]

# Fetch and install Node.js
RUN apt-get update -y && apt-get install --no-install-recommends -y -q curl python build-essential git ca-certificates
RUN mkdir /nodejs && curl http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1

# Add Node.js installation to PATH
ENV PATH $PATH:/nodejs/bin

# Install redis
RUN apt-get install -y redis-server

# Install supervisor
RUN apt-get install -y supervisor

# Add Node.js installation to PATH, and set
# the current working directory to /app
# so future commands in this Dockerfile are easier to write
WORKDIR /app

ENV NODE_ENV development

ADD package.json /app/

# RUN npm install

# Adds app source
ADD . /app

ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]

Here is the command we run in order to deploy the app :

gcloud preview app deploy $DIR/app.yaml --version="$version" --force

Thank you for helping.

like image 534
Médric Gpr Avatar asked Aug 28 '15 09:08

Médric Gpr


1 Answers

You don't seem to be exposing any ports on the container. For managed VMS, you should expose port 8080, try adding :

EXPOSE 8080
like image 97
maciekrb Avatar answered Sep 22 '22 01:09

maciekrb