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

Fixed docker compose issue in backup/restore #2110

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

montaniasystemab
Copy link
Contributor

The docker-compose command was hard coded in backup and restore routines. Replaced with $dc variable instead

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

The docker-compose command was hard coded in backup and restore routines. Replaced with `$dc` variable instead
@BYK
Copy link
Member

BYK commented Apr 27, 2023

Why do you need this change? $dc is there for a reason (for v1 and v2 compatibility)

@montaniasystemab
Copy link
Contributor Author

Without it I get this error when trying to run scripts/backup.sh or restore.sh:

scripts/_lib.sh: line 65: docker-compose: command not found
Error in scripts/_lib.sh:65.
'docker-compose run -v $(pwd)/sentry:/sentry-data/backup --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export /sentry-data/backup/backup.json' exited with status 127
-> ./scripts/backup.sh:main:4
--> scripts/_lib.sh:backup:65
rickard@craig ~/sentry ((23.4.0))> docker compose version
Docker Compose version v2.17.3
rickard@craig ~/sentry ((23.4.0))> docker --version
Docker version 23.0.5, build bc4487a

@BYK
Copy link
Member

BYK commented Apr 28, 2023

Oh wait I misread your PR. Yes it should have been $dc. My apologies 🤦🏻‍♂️

@BYK BYK requested a review from hubertdeng123 April 28, 2023 14:41
@BYK
Copy link
Member

BYK commented Apr 28, 2023

@hubertdeng123 I thought you used this script in CI, how did it pass without this PR?

Copy link
Member

@hubertdeng123 hubertdeng123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for submitting this!

@hubertdeng123
Copy link
Member

I do use the script in CI as part of our integration tests 🤔, maybe both docker-compose and docker compose are accepted? Investigating...

@hubertdeng123
Copy link
Member

Yeah, that's what's happening in CI as I opened a test PR. Both docker-compose and docker compose are accepted. Well, this won't happen form much longer once v1 is 🪓

@hubertdeng123 hubertdeng123 merged commit 9f191ab into getsentry:master Apr 28, 2023
@BYK
Copy link
Member

BYK commented Apr 28, 2023

@hubertdeng123 I recommend duplicating this line to have a fixed path for docker-compose:

sudo rm -f "${{ matrix.compose_path }}/docker-compose"

So we know it won't exist at all?

@hubertdeng123
Copy link
Member

Ok I did some more digging, it looks like in CI docker compose v1.29 is installed at /usr/local/bin/docker-compose. So docker-compose will use v1.29 and docker compose will use v2.

@hubertdeng123
Copy link
Member

PR up: #2114

@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants