Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Conversation

emidoots
Copy link
Member

@emidoots emidoots commented Jun 30, 2023

Apparently VS Code's Python support uses port 9000, so as long as we use it most VS Code Python devs can't run the app due to the port conflict with our services.

This PR switches the app's blobstore to listen on :49000 instead of :9000. My thinking for now is that we can centralize all "default endpoint" and "what host/port should I listen on?" into the deploy package, and for now just change ports to have a 4 in front of them to reduce the change of conflicts.

Later, once we have them centralized in the deploy package we can easily modify that code to pick an unavailable port.

This also binds blobstore to 127.0.0.1 (more secure), previously it was bound to localhost.

Test plan

To test this I did the following:

  1. Methodically searched our codebase for 9000 and vetted each instance, to ensure I didn't miss anything.
  2. Tested with sg start app and confirmed sudo lsof -i -P | grep LISTEN | grep :9000 reported nothing while sudo lsof -i -P | grep LISTEN | grep :49000 did.
  3. Created an app build with ./enterprise/dev/app/build.sh and tested it:
    • Confirmed embeddings generation (which get stored in blobstore) still works through the setup wizard
  4. Confirmed sg start enterprise-codeintel starts and runs

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
@emidoots emidoots requested a review from a team June 30, 2023 00:50
@cla-bot cla-bot bot added the cla-signed label Jun 30, 2023
@sourcegraph-bot
Copy link
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 79bddb9...87dde75.

Notify File(s)
@Strum355 enterprise/internal/codeintel/shared/lsifuploadstore/BUILD.bazel
enterprise/internal/codeintel/shared/lsifuploadstore/config.go
@efritz enterprise/internal/codeintel/shared/lsifuploadstore/BUILD.bazel
enterprise/internal/codeintel/shared/lsifuploadstore/config.go

@Strum355
Copy link
Contributor

This looks like it shouldn't be an issue, but could we get a startup on sg start just to make sure that non-app is fine (at least locally 👀).

@emidoots
Copy link
Member Author

Good catch, I meant to list that in the test plan - will update!

@emidoots emidoots merged commit fc76a9c into main Jul 4, 2023
@emidoots emidoots deleted the sg/port-conflicts branch July 4, 2023 20:06
davejrt added a commit that referenced this pull request Jul 4, 2023
emidoots pushed a commit that referenced this pull request Jul 4, 2023
…main' CI)

We still use `sourcegraph/server` to run our integration tests in our CI
pipelines (yuck) and in my change #54466 I failed to realize that
`IsSingleBinary()` and `IsDeployTypeSingleDockerContainer(Type())` report
different things.

This fixes the issue, and likely fixes `main` on our CI pipelines.

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
emidoots pushed a commit that referenced this pull request Jul 4, 2023
…main' CI) (#54601)

We still use `sourcegraph/server` to run our integration tests in our CI
pipelines (yuck) and in my change #54466 I failed to realize that
`IsSingleBinary()` and `IsDeployTypeSingleDockerContainer(Type())`
report different things.

This fixes the issue, and likely fixes `main` on our CI pipelines. If
not, then both this change and the other should be reverted.

## Test plan

CI

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants