New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databases like rethink db can't be used as a service #2020

Closed
josmo opened this Issue May 3, 2017 · 1 comment

Comments

Projects
2 participants
@josmo
Contributor

josmo commented May 3, 2017

Drone version:
.6

Repro steps:
Add rethink db to the services like
services:
database:
image: rethinkdb:2.3.5
command: [ rethinkdb, --bind, all ]
and try to connect to "database". It will error with ECONNREFUSED

from @bradrydzewski
"the rethink issue could be a chicken and egg problem. If it binds to available interface IPs (via --all), but is created before all the pipeline containers, it will never be able to bind to their networks
this doesn't impact mysql / postgres/ etc because they don't try to bind to specific addresses
a fix could be to create all containers (pipeline and service) up front, and then start them sequentially. Today we start and run them sequentially."

@bradrydzewski

This comment has been minimized.

Show comment
Hide comment
@bradrydzewski

bradrydzewski May 16, 2017

Member

This is fixed with drone/drone:latest with patch 729d759

I tested the following yaml configuration:

workspace:
    base: /go
    path: foo

pipeline:
  ping:
    image: node
    commands:
      - npm install -g recli
      - recli --host rethink 'r.tableCreate("bikes")'
      - recli --host rethink 'r.table("bikes")'

services:
  rethink:
    image: rethinkdb
    command: [ rethinkdb, --bind, all ]

Which returned the following results:

+ recli --host rethink 'r.tableCreate("bikes")'
{ config_changes: 
   [ { new_val: 
        { db: 'test',
          durability: 'hard',
          id: '78ac96c4-4773-417f-8265-30de4a29a8ee',
          indexes: [],
          name: 'bikes',
          primary_key: 'id',
          shards: 
           [ { nonvoting_replicas: [],
               primary_replica: '6d58b31563c2_0be',
               replicas: [ '6d58b31563c2_0be' ] } ],
          write_acks: 'majority' },
       old_val: null } ],
  tables_created: 1 }
+ recli --host rethink 'r.table("bikes")'
[]

also tested with mongo

pipeline:
  test:
    image: mongo:3.0
    commands:
      - sleep 5 # give mongo enough time to initialize
      - |
        mongo --host mongo --eval "{ ping: 1 }"

services:
  mongo:
    image: mongo:3.0
Member

bradrydzewski commented May 16, 2017

This is fixed with drone/drone:latest with patch 729d759

I tested the following yaml configuration:

workspace:
    base: /go
    path: foo

pipeline:
  ping:
    image: node
    commands:
      - npm install -g recli
      - recli --host rethink 'r.tableCreate("bikes")'
      - recli --host rethink 'r.table("bikes")'

services:
  rethink:
    image: rethinkdb
    command: [ rethinkdb, --bind, all ]

Which returned the following results:

+ recli --host rethink 'r.tableCreate("bikes")'
{ config_changes: 
   [ { new_val: 
        { db: 'test',
          durability: 'hard',
          id: '78ac96c4-4773-417f-8265-30de4a29a8ee',
          indexes: [],
          name: 'bikes',
          primary_key: 'id',
          shards: 
           [ { nonvoting_replicas: [],
               primary_replica: '6d58b31563c2_0be',
               replicas: [ '6d58b31563c2_0be' ] } ],
          write_acks: 'majority' },
       old_val: null } ],
  tables_created: 1 }
+ recli --host rethink 'r.table("bikes")'
[]

also tested with mongo

pipeline:
  test:
    image: mongo:3.0
    commands:
      - sleep 5 # give mongo enough time to initialize
      - |
        mongo --host mongo --eval "{ ping: 1 }"

services:
  mongo:
    image: mongo:3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment