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

pure-docker: move pure-docker to ./pure-docker #454

Merged
merged 5 commits into from
Jul 25, 2021
Merged

Conversation

bobheadxi
Copy link
Member

@bobheadxi bobheadxi commented Jul 20, 2021

closes https://github.com/sourcegraph/sourcegraph/issues/22427 - feature Docker Compose more prominently in this reference repository.

make docker-compose front and center, push pure-docker to a subdirectory.

❯ git merge pure-docker-move                       
Auto-merging pure-docker/deploy-prometheus.sh
Auto-merging pure-docker/deploy-grafana.sh
CONFLICT (content): Merge conflict in pure-docker/deploy-grafana.sh
Automatic merge failed; fix conflicts and then commit the result.
❯ git reset HEAD

Created the following patches:

❯ git ci "upgrade to pure-docker-move"
[pure-docker-move-customer-replica b45333d] upgrade to pure-docker-move
 31 files changed, 176 insertions(+), 5 deletions(-)
 create mode 100644 pure-docker/README.md
 rename deploy-caddy.sh => pure-docker/deploy-caddy.sh (92%)
 rename deploy-cadvisor.sh => pure-docker/deploy-cadvisor.sh (100%)
 rename deploy-codeinsights-db.sh => pure-docker/deploy-codeinsights-db.sh (100%)
 rename deploy-codeintel-db.sh => pure-docker/deploy-codeintel-db.sh (100%)
 rename deploy-frontend-internal.sh => pure-docker/deploy-frontend-internal.sh (100%)
 rename deploy-frontend.sh => pure-docker/deploy-frontend.sh (100%)
 rename deploy-github-proxy.sh => pure-docker/deploy-github-proxy.sh (100%)
 rename deploy-gitserver.sh => pure-docker/deploy-gitserver.sh (100%)
 rename deploy-grafana.sh => pure-docker/deploy-grafana.sh (74%)
 rename deploy-jaeger.sh => pure-docker/deploy-jaeger.sh (100%)
 rename deploy-minio.sh => pure-docker/deploy-minio.sh (100%)
 rename deploy-pgsql.sh => pure-docker/deploy-pgsql.sh (100%)
 rename deploy-precise-code-intel-worker.sh => pure-docker/deploy-precise-code-intel-worker.sh (100%)
 rename deploy-prometheus.sh => pure-docker/deploy-prometheus.sh (93%)
 rename deploy-query-runner.sh => pure-docker/deploy-query-runner.sh (100%)
 rename deploy-redis-cache.sh => pure-docker/deploy-redis-cache.sh (100%)
 rename deploy-redis-store.sh => pure-docker/deploy-redis-store.sh (100%)
 rename deploy-repo-updater.sh => pure-docker/deploy-repo-updater.sh (100%)
 rename deploy-searcher.sh => pure-docker/deploy-searcher.sh (100%)
 rename deploy-symbols.sh => pure-docker/deploy-symbols.sh (100%)
 rename deploy-syntect-server.sh => pure-docker/deploy-syntect-server.sh (100%)
 rename deploy-worker.sh => pure-docker/deploy-worker.sh (100%)
 rename deploy-zoekt-indexserver.sh => pure-docker/deploy-zoekt-indexserver.sh (100%)
 rename deploy-zoekt-webserver.sh => pure-docker/deploy-zoekt-webserver.sh (100%)
 rename deploy.sh => pure-docker/deploy.sh (95%)
 rename ensure-volume.sh => pure-docker/ensure-volume.sh (100%)
 rename init-jaeger-cassandra-schema.sh => pure-docker/init-jaeger-cassandra-schema.sh (100%)
 create mode 100644 pure-docker/metrics-and-tracing.md
 rename replicas.sh => pure-docker/replicas.sh (100%)
 rename teardown.sh => pure-docker/teardown.sh (96%)

@bobheadxi bobheadxi requested a review from slimsag July 20, 2021 12:49
@slimsag
Copy link
Member

slimsag commented Jul 21, 2021

question: why should these be in the same repository at all? I think this was a mistake generally, so now would be time to fix it.

I think we'd be better off moving docker compose or pure docker to a separate repo.

Or, even better - I would love if docker-compose did not rely on external configuration files at all. We could bake all configs into the images (controlled by env vars) and then literally just have docker-compose be a single file hosted on docs.sourcegraph.com

@bobheadxi
Copy link
Member Author

bobheadxi commented Jul 22, 2021

thanks for taking a look @slimsag !

question: why should these be in the same repository at all? I think this was a mistake generally, so now would be time to fix it.

I think we'd be better off moving docker compose or pure docker to a separate repo.

I wanted to do this initially, but the dependency on external config files made that complicated :( Also I think we're very dependent on the git fork workflow, and splitting repos might be a very unpleasant experience for customers (I'm already a bit concerned about this pure-docker move potentially being quite difficult for git, though I haven't gotten that far yet)

Or, even better - I would love if docker-compose did not rely on external configuration files at all. We could bake all configs into the images (controlled by env vars)

This would be great idea! But because we're stuck in this one repo (without great support effort at least, I think) I suppose there isn't much incentive for it yet

and then literally just have docker-compose be a single file hosted on docs.sourcegraph.com

This would make configuration complicated, also because of git workflow (doesn't seem to be a paradigm that we're aiming to move away from in the near future)

@slimsag
Copy link
Member

slimsag commented Jul 22, 2021 via email

@bobheadxi bobheadxi requested a review from a team July 22, 2021 09:58
@bobheadxi bobheadxi marked this pull request as ready for review July 22, 2021 09:58
@@ -31,6 +31,6 @@ docker run --detach \
-p 0.0.0.0:80:80 \
-p 0.0.0.0:443:443 \
-v $VOLUME:/caddy-storage \
--mount type=bind,source="$(pwd)"/caddy/builtins/http.Caddyfile,target=/etc/caddy/Caddyfile \
--mount type=bind,source="$(pwd)"/../caddy/builtins/http.Caddyfile,target=/etc/caddy/Caddyfile \
Copy link
Member

Choose a reason for hiding this comment

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

I think that these path changes might become problematic. They'll likely copy these over and not notice that ../ is now the wrong path. Maybe instead we could duplicate the config files into the subdirectory as well?

Copy link
Member Author

@bobheadxi bobheadxi Jul 23, 2021

Choose a reason for hiding this comment

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

Do you think moving this to a separate variable would be more clear? i.e.

REFERENCE_REPO_ROOT="$(pwd)/.."
...

--mount type=bind,source="$REFERENCE_REPO_ROOT"/caddy/foobar

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think that would be less clear potentially - because they don't have these scripts in their repo root. Maybe ../ is not so bad on second thought :)

Copy link
Member Author

@bobheadxi bobheadxi Jul 23, 2021

Choose a reason for hiding this comment

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

Oh yikes haha

I'll make sure to include a release note in the pure-docker upgrade notes to call out that there are path changes to be expected due to this move! (and leave this ../ as is)

Copy link
Member

@slimsag slimsag left a comment

Choose a reason for hiding this comment

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

I left a thought inline but generally lgtm.

@bobheadxi
Copy link
Member Author

I have added a note to https://github.com/sourcegraph/sourcegraph/issues/23112 (cc @daxmc99 ) to ping me for potential help when preparing this upgrade :) Going to merge this now!

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

Successfully merging this pull request may close these issues.

Docs: Deploying on docker-compose
2 participants