deep-foundation / deep-foundation/deeplinks

HandleRoute and HandlePort update

Open
#249 7 comments 0 reactions 1 assignee Claimed by @konard View on GitHub
enhancement
Dominant language
TypeScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

# HandleRoute ports handling
Today it is impossible to open port on server using HandleRoute because `deeplinks` is launched with single opened port, for example:
https://github.com/deep-foundation/deeplinks/blob/00a1ca0ca51b3b25ba59a31ee2b4f1f410c0f55b/docker-prod/deep/docker-compose.yml#L122

That means we can only access `deeplinks` via 3006 port.

And in order to solve it we might use:
1. Restart the container with update to `docker-compose.yml` adding new port each time (this will require to restart the orchestrator itself, which I think is a bad idea, because it will break ongoing GQL and File connections).
2. Reserver ports range for the `deep-links` container. (this is also a bad idea, because if on server we have any post that is already in use in that range the `deep-links` container will be unable to start).
3. In any case we should monitor if each port is free in order to use it.
4. And the best solution as I see it right now is to use **`HandleContainer/HandleDocker/HandlePorts`** for that.

# HandlePort ports handling
It is also not possible for HandlePort to use more than single port.

For example we could start a game server for `Ragnarok Online` that uses 3 different ports (login, char, map servers). We could also want to start an operating system with macOS, Linux, Windows and we might want to configure freely which ports are available to external network. We also might want to have universal way to monitor `healthz` of the docker container.

So the best solution would be to configure the port for `healthz` or full featured Deep-compatible controller that has rest or may be even GQL API? We need a way to transfer initial data, for example we might use `init` route to pass the token of the package that create that container to use it for operations. For example using the token passed via `init` we might create subscriptions to links that control the behaviour of docker container. Or may be we could create a mini-deep inside that would allow docker container control via the same Deep GQL API.

# HandleContainer/HandleDocker/HandlePorts

Once we have something like **HandleDocker/HandlePorts**, with support of multiple ports, we can move the responsibility for HandleRoute module there. So it in the separate docker and once port configuration is changed it may be restarted separately. It will also be better for performance scaling.

Related to https://github.com/deep-foundation/deeplinks/issues/200

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.