magneticio / vamp

Vamp - canary releasing and autoscaling for microservice systems
http://vamp.io
Apache License 2.0
623 stars 55 forks source link

Installing VAMP on existing Mesos/Marathon Cluster #1077

Closed AbacusIntegrationPlatform closed 6 years ago

AbacusIntegrationPlatform commented 6 years ago

I am new to VAMP and I am able to import the vamp image and run it on the marathon. Below is my marathon.json file. But VAMP internally tries to run other images in marathon. It is trying to deploy magneticio/vamp-workflow-agent:0.9.5 and with folders /vamp/workflow-vga, /vamp/workflow-kibana etc.,

The problem here is, the images on the servers are pulled from a private repository and hence i need to alter the image name which vamp tried to deploy. Where should we update the image name. Or should we pass as parameter somewhere.

{
  "id": "vamp/vamp",
  "instances": 1,
  "cpus": 0.5,
  "mem": 1024,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "privateregistry/vamp-dcos",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 8080,
          "hostPort": 0,
           "protocol": "tcp",
           "servicePort": 8080
          }
        }
      ],
      "forcePullImage": true
    }
  },
  "labels": {
    "DCOS_SERVICE_NAME": "vamp",
    "DCOS_SERVICE_SCHEME": "http",
    "DCOS_SERVICE_PORT_INDEX": "0"
  },
  "env": {
    "VAMP_WAIT_FOR": "http://x.x.x.x:5601/app/kibana",
    "VAMP_ELASTICSEARCH_URL": "http://x.x.x.x:9000",
    "VAMP_DB_TYPE": "mysql",
    "VAMP_DB_URL": "jdbc:mysql://x.x.x.x:3306/vamp-${namespace}?useSSL=false",
    "VAMP_DB_CREATE_URL": "jdbc:mysql://x.x.x.x:3306?useSSL=false",
    "VAMP_DB_USER": "root",
    "VAMP_DB_PASSWORD": "root",
    "VAMP_ZOOKEEPER_SERVERS":"x.x.x.x:2181",
    "DRIVER_SYNCHRONIZATION_PERIOD":"10s",
    "VAMP_CONTAINER_DRIVER_NETWORK":"BRIDGE",
    "VAMP_CONTAINER_DRIVER_MARATHON_URL":"http://x.x.x.x:8080",
    "VAMP_CONTAINER_DRIVER_MESOS_URL":"http://x.x.x.x:5050"
  }
}
olafmol commented 6 years ago

tnx for your question! Either you need to open up your network to pull the vamp workflow agent from the public docker hub(where we placed it) or you need to modify the "vamp-workflow-javascript” breed artifact with a docker dialect that enables private repo credentials: https://vamp.io/documentation/using-vamp/v0.9.5/dialects/#dc-os-marathon-dialect

AbacusIntegrationPlatform commented 6 years ago

Thanks. All the workflow and gateway images are uploaded to the private registry. All that i need to do is to refer this images in the private registry rather than on mageticio/image name from the hub. Simply renaming the images in the .yml and .js files will suffice. Is it possible to alter the files below and build my own VAMP image with custom breeds and workflows having images with private reposittory ?

 /usr/local/vamp/artifacts/breeds/vamp-workflow-javascript.yml"
      "/usr/local/vamp/artifacts/breeds/health.js"
      "/usr/local/vamp/artifacts/breeds/metrics.js"
      "/usr/local/vamp/artifacts/breeds/allocation.js"
      "/usr/local/vamp/artifacts/breeds/kibana.js"
      "/usr/local/vamp/artifacts/breeds/vga.js"
      "/usr/local/vamp/artifacts/workflows/health.yml"
      "/usr/local/vamp/artifacts/workflows/metrics.yml"
      "/usr/local/vamp/artifacts/workflows/allocation.yml"
      "/usr/local/vamp/artifacts/workflows/kibana.yml"
      "/usr/local/vamp/artifacts/workflows/vga.yml"
jason-magnetic-io commented 6 years ago

The easiest way to do this is to use a custom Dockerfile to create a vamp docker image that includes the updated files.

  1. Edit the .yml files to refer to the docker images in your private repo.
  2. Place them in a folder called "files": For example: files/usr/local/vamp/artifacts/breeds/vamp-workflow-javascript.yml
  3. Create a Dockerfile similar to the one below (in the same folder as files/) and use that to create the new image in your private repo.
    
    FROM magneticio/vamp:<VAMP_VERSION>

RUN rm -Rf /usr/local/vamp/artifacts/breeds/vamp-workflow-javascript.yml

ADD files/ /

CMD ["/sbin/runsvinit"]

olafmol commented 6 years ago

@AbacusIntegrationPlatform did the info above help?