Page MenuHomePhabricator

Unable to install mysql2 using Ruby docker image on Kubernetes
Closed, ResolvedPublic

Description

I'm trying to get a Ruby application running on Kubernetes, but I'm seeing an error about not being able to find libmysqlclient.so, I think because the "ruby" docker container doesn't have the libmysqlclient-dev package installed.

I'm trying to start the service with webservice --backend=kubernetes ruby2 start /data/project/verification-pages/verification-pages/script/toolforge-start. You can see the contents of the toolforge-start script here: https://github.com/mysociety/verification-pages/blob/d03f565b1f0bf0f03e07a125746c61e49a15b0d4/script/toolforge-start.

Here's a gist of the full error I'm getting: https://gist.github.com/chrismytton/fd1e254a393ebd36be0b5d9245138aab

I notice that the "python2" docker container does have this package - https://phabricator.wikimedia.org/diffusion/ODIT/browse/master/python2/base/Dockerfile.template;bac775da7cbeb7c275ae0a6251e9401524b6a2c0$18
so I _think_ that package needs to be added to the Ruby docker container here https://phabricator.wikimedia.org/diffusion/ODIT/browse/master/ruby/base/Dockerfile.template?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 19 2018, 3:45 PM

Change 429758 had a related patch set uploaded (by Arturo Borrero Gonzalez; owner: Arturo Borrero Gonzalez):
[operations/docker-images/toollabs-images@master] ruby: install libmysqlclient-dev package in the base image

https://gerrit.wikimedia.org/r/429758

aborrero triaged this task as Normal priority.Apr 30 2018, 10:13 AM
aborrero added subscribers: Andrew, bd808, aborrero.

This is my first patch on this. Waiting ACK from @bd808 and/or @Andrew .

I guess I can simply follow the instructions at https://wikitech.wikimedia.org/wiki/Portal:Toolforge/Admin/Kubernetes#Docker_Images

Change 429758 merged by Arturo Borrero Gonzalez:
[operations/docker-images/toollabs-images@master] ruby: install libmysqlclient-dev package in the base image

https://gerrit.wikimedia.org/r/429758

Mentioned in SAL (#wikimedia-cloud) [2018-05-03T14:48:46Z] <arturo> uploaded a new ruby docker image to the registry with the libmysqlclient-dev package T192566

aborrero closed this task as Resolved.May 3 2018, 2:51 PM

Hey @chrismytton, closing task, feel free to reopen if you see something weird, or create a new one in case you need something else :-)

bd808 added a comment.May 3 2018, 3:12 PM

@chrismytton, you will need to stop and then start your webservice again for the Kubernetes system to pick up the new Docker image that has the mysql libraries installed.