Skip to content
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

Is it possible to use gh-ost as a Go library directly? #959

Closed
shakefu opened this issue Apr 23, 2021 · 6 comments
Closed

Is it possible to use gh-ost as a Go library directly? #959

shakefu opened this issue Apr 23, 2021 · 6 comments
Labels

Comments

@shakefu
Copy link

shakefu commented Apr 23, 2021

I know the main documentation is around the gh-ost CLI tool, but I'm wondering if there are any concerns about using the library directly (e.g. the MigrationContext+Migrator API which the CLI leverages), especially w/r to trying to run multiple migrations from within a single process context (e.g. are there shared globals that might have issues? thread/goroutine blocking? unsafe/unlocked vars?).

My use case is that I'd like to write a small migration management (internal) web app to integrate with gh-ost and it seems like invoking the CLI tool and then communicating over the unix/TCP socket would be a bit more wonky than just being able to import the golang lib and work with it that way.

@shlomi-noach
Copy link
Contributor

Please see the following (rather old) issues:

Personally I haven't experimented running gh-ost as a library. Happy to hear about your review/experiment.

@shakefu
Copy link
Author

shakefu commented Apr 25, 2021

Good to know!

Without using it as a library can I ask how y'all are running gh-ost in production? Some wrapper tooling maybe? Running the CLI in a container perhaps? We're trying to solve the production use case as well but in a not-quite-fully-automated fashion (hence a use case of a web app).

@shlomi-noach
Copy link
Contributor

shlomi-noach commented Apr 26, 2021 via email

@shakefu
Copy link
Author

shakefu commented Apr 27, 2021

This is how GitHub does it: https://github.blog/2020-02-14-automating-mysql-schema-migrations-with-github-actions-and-more/

Oh that's an awesome writeup! Thanks!

@shakefu shakefu closed this as completed Apr 27, 2021
@shakefu
Copy link
Author

shakefu commented Apr 27, 2021

Whoops. Leaving open to for reporting back on how it went with gh-ost as a library. Will close in a few days if that doesn't proceed.

@timvaillancourt
Copy link
Collaborator

Closing this questions as answered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants