Skip to content

Commit

Permalink
Replace docker-compose with docker compose in just scripts and docs (#…
Browse files Browse the repository at this point in the history
…4017)

* Replace docker-compose with docker compose in just scripts and docs

Signed-off-by: Olga Bulat <[email protected]>

* Update documentation/frontend/reference/playwright_tests.md

Co-authored-by: Dhruv Bhanushali <[email protected]>

* Revert the update of docker-compose.yml version

* Update ingestion_server/test/integration_test.py

---------

Signed-off-by: Olga Bulat <[email protected]>
Co-authored-by: Dhruv Bhanushali <[email protected]>
  • Loading branch information
obulat and dhruvkb authored Apr 3, 2024
1 parent 2bd852c commit e7da5d6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
3 changes: 1 addition & 2 deletions documentation/catalog/guides/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ For instructions geared specifically towards production deployments, see

### Requirements

You'll need `docker` and `docker-compose` installed on your machine, with
versions new enough to use version `3` of Docker Compose `.yml` files.
You'll need `docker` with Compose V2 installed on your machine.

You will also need the [`just`](https://github.com/casey/just#installation)
command runner installed.
Expand Down
2 changes: 1 addition & 1 deletion documentation/frontend/guides/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ and use the Openverse Plausible integration. It is not necessary to set up
Plausible for general frontend development unless specifically working on custom
events.

Running Plausible locally requires Docker and docker-compose.
Running Plausible locally requires Docker (with Compose V2).

## Plausible set up and first run

Expand Down
4 changes: 2 additions & 2 deletions documentation/frontend/reference/playwright_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ cross-platform browser differences from creating flaky test behavior. We run
both end-to-end and visual-regression tests in the same container to save from
having to run the Nuxt production build twice.

Having docker and docker-compose is a pre-requisite to running the playwright
tests locally. Please follow
Having Docker and Compose V2 is a pre-requisite to running the Playwright tests
locally. Please follow
[the relevant instructions for your operating system for how to install docker and docker-compose](https://docs.docker.com/get-docker/).
If you're on Windows 10 Home Edition, please note that you'll need to
[install and run docker inside WSL2](https://www.freecodecamp.org/news/how-to-run-docker-on-windows-10-home-edition/).
Expand Down
2 changes: 1 addition & 1 deletion documentation/meta/maintenance/elasticsearch_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ editing process.
1. Run `vim` or `nano` with `sudo` to edit the `docker-compose.yml` and make the
configuration changes identified in the first step of the overall process.
1. Save the changes.
1. Run `docker-compose up -d` to restart the node with the new settings.
1. Run `docker compose up -d` to restart the node with the new settings.
1. Mark the node as restarted in the shared document.
1. Monitor the cluster:

Expand Down
4 changes: 2 additions & 2 deletions ingestion_server/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ test-local *args:
{{ if IS_CI == "" { "just test-logs > test/ingestion_logs.txt && just test-clean-dc" } else { "" } }}

test-logs:
docker-compose --profile=ingestion_server -f test/integration-docker-compose.yml logs --no-color
docker compose --profile=ingestion_server -f test/integration-docker-compose.yml logs --no-color

# Clean integration test docker-compose stack. Is run after tests are finished locally.
test-clean-dc:
docker-compose --profile=ingestion_server -f test/integration-docker-compose.yml down -v
docker compose --profile=ingestion_server -f test/integration-docker-compose.yml down -v
3 changes: 2 additions & 1 deletion ingestion_server/test/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def _compose_cmd(compose_path, cmd: list[str], **kwargs):
"""Run a Docker Compose command"""

cmd = [
"docker-compose",
"docker",
"compose",
"--profile",
"ingestion_server",
"-f",
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ versions:
pgcli_version=$(just api/pgcli-version)
EOF
# Run `docker-compose` configured with the correct files and environment
# Run `docker compose` configured with the correct files and environment
dc *args:
@{{ if IS_CI != "" { "just env" } else { "true" } }}
env COMPOSE_PROFILES="{{ env_var_or_default("COMPOSE_PROFILES", "api,ingestion_server,frontend,catalog") }}" docker-compose {{ DOCKER_FILE }} {{ args }}
env COMPOSE_PROFILES="{{ env_var_or_default("COMPOSE_PROFILES", "api,ingestion_server,frontend,catalog") }}" docker compose {{ DOCKER_FILE }} {{ args }}
# Build all (or specified) services
build *args:
Expand Down
4 changes: 2 additions & 2 deletions setup_plausible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ PLAUSIBLE_SERVICE_NAME="${PLAUSIBLE_SERVICE_NAME:-plausible}"
PLAUSIBLE_DB_SERVICE_NAME="${PLAUSIBLE_DB_SERVICE_NAME:-plausible_db}"

# Create Plausible user
docker-compose exec -T "$PLAUSIBLE_SERVICE_NAME" \
docker compose exec -T "$PLAUSIBLE_SERVICE_NAME" \
/app/bin/plausible rpc \
'Plausible.Auth.User.new(%{name: "Deploy", email: "[email protected]", password: "deploy", password_confirmation: "deploy"}) |> Plausible.Repo.insert'

# Create an API key with '{sites:provision:*}' scope
# API key: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (that's 64 times 'a')
# Key hash: SHA256(`SECRET_KEY_BASE` + API key)
docker-compose exec -T "$PLAUSIBLE_DB_SERVICE_NAME" /bin/bash -c "psql -U deploy -d plausible <<-EOF
docker compose exec -T "$PLAUSIBLE_DB_SERVICE_NAME" /bin/bash -c "psql -U deploy -d plausible <<-EOF
INSERT INTO api_keys
(id, user_id, name, key_prefix, key_hash, inserted_at, updated_at, scopes, hourly_request_limit)
VALUES
Expand Down

0 comments on commit e7da5d6

Please sign in to comment.