-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add pre- and post-exec commands. #49
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
db99d05
Add pre- and post-exec commands.
Gerrit91 8756815
Actually build.
Gerrit91 c0ae597
Merge branch 'master' into pre-and-post-exec-cmds
majst01 e2777b2
Merge branch 'master' into pre-and-post-exec-cmds
majst01 37c1edf
Merge branch 'master' into pre-and-post-exec-cmds
majst01 16992d5
Use strings.Fields.
Gerrit91 fb3aac2
Panic when logger was not initialized on root command.
Gerrit91 1f6790f
Password file was not passed to rethinkdb restore command?!
Gerrit91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,12 @@ | ||
FROM golang:1.21 as builder | ||
WORKDIR /work | ||
COPY .git .git | ||
COPY api api | ||
COPY cmd cmd | ||
COPY go.mod . | ||
COPY go.sum . | ||
COPY Makefile . | ||
RUN make | ||
|
||
# TODO: remove tini in a future release, not required anymore since pre- and post-exec-cmd flags | ||
FROM krallin/ubuntu-tini as ubuntu-tini | ||
|
||
# rethinkdb backup/restore requires the python client library | ||
# let's make small binaries of these commands in order not to blow up the image size | ||
FROM rethinkdb:2.4.1 as rethinkdb-python-client-builder | ||
WORKDIR /work | ||
RUN apt update && apt install -y python3-pip | ||
RUN pip3 install pyinstaller==4.3.0 rethinkdb | ||
COPY build/rethinkdb-dump.spec rethinkdb-dump.spec | ||
COPY build/rethinkdb-restore.spec rethinkdb-restore.spec | ||
RUN pyinstaller rethinkdb-dump.spec \ | ||
&& pyinstaller rethinkdb-restore.spec | ||
FROM ghcr.io/metal-stack/rethinkdb-backup-tools-build:v2.4.1 as rethinkdb-backup-tools | ||
|
||
FROM alpine:3.18 | ||
# TODO: remove tini in a future release, not required anymore since pre- and post-exec-cmd flags | ||
RUN apk add --no-cache tini ca-certificates | ||
COPY --from=builder /work/bin/backup-restore-sidecar /backup-restore-sidecar | ||
COPY bin/backup-restore-sidecar /backup-restore-sidecar | ||
COPY --from=ubuntu-tini /usr/local/bin/tini-static /ubuntu/tini | ||
COPY --from=rethinkdb-python-client-builder /work/dist/rethinkdb-dump /work/dist/rethinkdb-restore /rethinkdb/ | ||
COPY --from=rethinkdb-backup-tools /rethinkdb-dump /rethinkdb-restore /rethinkdb/ | ||
CMD ["/backup-restore-sidecar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried out the RethinkDB restore and forced the restore by running it manually from the CLI in the backup-restore-sidecar pod.
Before that:
So, I assume it is somehow broken already?
Here is with it:
I think, it is okay that the restore does not succeed when there is already data present. Not sure if it makes sense to add a
--force
flag.