MySQL 8 Start Time, Access containers outside of drone.yml

So I started to work with Drone this weekend and it is a interesting setup. I have some issues though, the start time for a MySQL 8.0 container is horribly long, upwards of 5 minutes. I have had to put a sleep 300 in my test run to hope the DB starts by then. That being said it sucks that the builds are that long.

I would like to be able to have an externally started docker image for things like this, MySQL, Redis, ElasticSearch and so on but I can’t seem to find the configuration I need to allow / inform the application to talk to these services running in their own containers outside the drone network it creates.

Any ideas on how I can make this happen? Would be a MASSIVE improvement on the test suite build time.

I have some issues though, the start time for a MySQL 8.0 container is horribly long, upwards of 5 minutes

as a point of reference, we use mysql as a service container in one of our projects and it takes under 30 seconds to download the image, start the container, and begin accepting connections [1]. Taking 5 minutes is definitely abnormal. Instead of attempting to find a workaround, it may be worth trying to troubleshoot your environment to understand why it is taking so long.

[1] https://cloud.drone.io/drone/autoscaler/233/1/3

Interesting, I can see in the logs it is starting a temporary server then killing and restarting, I am battling the sha2 vs native password problem at the moment. I can’t seem to get it to build with the native password now.

But ya, I have no idea why it takes so long to boot as the service.
I am running Drone in docker and with 2 runners, perhaps I need more runners?
This is all installed on a fresh ubuntu VM.

Just the section, I don’t know what would be the issue.
services:

  • name: database
    image: mysql:8.0.23
    environment:
    MYSQL_USER: root
    MYSQL_ROOT_PASSWORD: password
    MYSQL_DATABASE: db_name_test
    ports:
    • 3306

Biggest difference I can see is you are running MySQL 5.7 not MySQL 8.

Can you post your service block from drone.yml?

Interesting, I can see in the logs it is starting a temporary server then killing and restarting

Yes, you are right, it doesn’t look like it is ready to fully accept connections until around 34 seconds. It takes around 54s to download dependencies and compile our tests, so by the time we are ready to execute integration tests, the mysql server is ready to go.

Can you post your service block from drone.yml?

Biggest difference I can see is you are running MySQL 5.7 not MySQL 8.

I just ran a quick test with mysql 8 to rule out any issues with versioning. It was able to initialize and begin accepting connections in under 30 seconds (I added a 40 second sleep just to be safe). You can see the build and the yaml here:

Hmm, I am starting to wonder if this is due to the fact I am running docker containers on a virtualized Ubuntu 20.04 instance on Windows 2019 Hyper V service.
I have given it 4 CPUs and 8 GB of ram which should be more than ample.

Yet another issue, I can’t seem to get this work with native password since the sha2 one doesn’t have the plugin for it.

It would be nice to be able to see more real world working examples of configurations.

Mysql2::Error::ConnectionError:
Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory