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

Use docker-compose profiles + cleanup old volume-mount cludges #4936

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

cdrini
Copy link
Collaborator

@cdrini cdrini commented Mar 29, 2021

Refactor to remove some no longer needed deploy steps now that we no longer mount the repo.

Technical

  • Profiles let us simplify the up commands needed for each searver
  • Since we're no longer using volume mounts, we no longer need to down before we up! Docker should automatically detect that oldev:latest has changed, and restart the right things.
  • Also, no longer need make i18n since the built i18n files are in the image.
  • Move dev only services to docker-compose.override.yml ; this makes things way less error prone - it's now much harder to accidentally deploy a db service to prod.
  • If a profile is not specified for a service, that service is always started! Don't want that. Added a test to make sure no one accidentally does this.

Testing

  • Only matching profiles start when so tagged
  1. Added a profiles: ["foo"] to web in docker-compose.yml, and profiles: [] to all other services (also in override)
  2. docker-compose --profile foo up -d --no-deps only starts web
  • Can still scale
  1. Added a profiles: ["foo"] to web & solr in docker-compose.yml, and profiles: [] to all other services (also in override)
  2. docker-compose --profile foo up -d --no-deps --scale web=2 starts 2 web nodes, one solr node

Screenshot

Stakeholders

@cclauss

@cdrini cdrini changed the title Experiment/dc profiles Use docker-compose profiles + cleanup old volume-mount cludges Mar 29, 2021
@cdrini cdrini added the Needs: Special Deploy This PR will need a non-standard deploy to production label Mar 29, 2021
cdrini added 2 commits March 30, 2021 17:21
- Profiles let us simplify the `up` commands needed for each searver
- Since we're no longer using volume mounts, we no longer need to `down` before we `up`! Docker should automatically detect that oldev:latest has changed, and restart the right things.
- Also, no longer need `make i18n` since the built i18n files are in the image.
- Move dev only services to docker-compose.override.yml ; this makes things _way_ less error prone - it's now much harder to accidentally deploy a db service to prod.
@cdrini cdrini force-pushed the experiment/dc-profiles branch from 111ba75 to 0727db5 Compare March 30, 2021 21:21
@cdrini cdrini merged commit d602403 into internetarchive:master Mar 30, 2021
@cdrini cdrini deleted the experiment/dc-profiles branch March 30, 2021 21:45
cclauss added a commit that referenced this pull request Apr 8, 2021
Fixes #5007
Related to #4936

Correct the docker-compose command and properly set the ___remote___ hostname.

@cdrini  @dhruvmanila
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Special Deploy This PR will need a non-standard deploy to production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants