Scheduled MariaDB backup using GitHub action and job in Eyevinn OSC

This blog gives an example on how to run regular database backups of your MariaDB database where the result is uploaded to an S3 compatible bucket.

For the task to perform the database backup and upload the result to S3 we will be using an open source script that is made available in Eyevinn Open Source Cloud. To launch this on a regular basis we will use a scheduled GitHub workflow that uses Eyevinn OSC action to create the jobs in OSC.

Step 1: setup secrets

Navigate to the service called “MariaDB backup to S3” and select the tab “Service Secrets”.

Create a secret for the URL to the database you want to backup. In the screenshot above we have a secret for the MariaDB url that this blog is running on. A URL is in the form mariadb://root:[rootpassword]@[host]:[ip]/[database]

Then we need secrets for the credentials to the AWS S3 bucket where we will place the backup. In this example they are called “eyevinnawskeyid” and “eyevinnawssecret”.

Step 2: create a test job

To test that everything is setup correctly we will manually create a test job.

Press Create and verify that a backup is taken and the result ends up on the S3 bucket.

Step 3: create a GitHub workflow file

In this example we will be using a GitHub workflow schedule to create a backup job in Open Source Cloud.

This workflow uses the GitHub action Eyevinn OSC action available on the GitHub action marketplace.

Conclusion

This provided an example for how you can launch jobs for an open source project that is made available as a service in Eyevinn Open Source Cloud as a step in a GitHub workflow.

Leave a Reply

Your email address will not be published. Required fields are marked *