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

Make it possible to access public ports within starlark #1861

Open
tedim52 opened this issue Nov 27, 2023 · 4 comments
Open

Make it possible to access public ports within starlark #1861

tedim52 opened this issue Nov 27, 2023 · 4 comments
Labels
cli For bugs relating to the CLI feature request painful Painful bug

Comments

@tedim52
Copy link
Contributor

tedim52 commented Nov 27, 2023

Background & motivation

Context: ethpandaops/ethereum-package#363 (comment)

Desired behaviour

An api in starlark that exposes both private and public ports.

How important is this to you?

Painful; the lack of this feature makes using Kurtosis frictionful.

What area of the product does this pertain to?

CLI: the Command Line Interface

@mieubrisse
Copy link
Collaborator

mieubrisse commented Dec 2, 2023

Unfortunately this issue as stated isn't possible, because inside the Kurtosis cluster we have no way of resolving "whose public port?"

E.g. if Tedi and I are both connected to the enclave using our CLI, and I'm also connected to the enclave using my SDK, then there are many answers to "who's public port?", and it breaks the determinism of Starlark runs.

Instead, from what I understand of the referenced comment, when we have Traefik as the front door to Kurtosis clusters we could maybe provide future references in Starlark to Traefik-proxied URLs where the service will be running (and these will be less likely to change based on who's accessing). That way NEXT_PUBLIC_BEACON_BASE_URL and NEXT_PUBLIC_EXPLORER_BASE_URL could be set to those values (which would be the same so long as the service exists).

E.g., something like:

ServiceConfig(
    env_vars = {
        "NEXT_PUBLIC_BEACON_BASE_URL": dependency_service.ports["http"].public_url,
    }
)

FWIW we've hit this situation before, with the NEAR Explorer.

@tedim52
Copy link
Contributor Author

tedim52 commented Dec 20, 2023

Makes sense. Definitely need to account for this use case somehow - lots of web based applications are unusable in kurtosis without it.

@tedim52
Copy link
Contributor Author

tedim52 commented Apr 10, 2024

@xavier-romero
Copy link

Right now I can access:

service.ip_address
service["port_name"].number

But I'm missing very much that:
service["port_name"].public_number

Also, I would need that to be available inside the ServiceConfig itself same than ip_address to be able to set envvars with this value. This breaks many web apps that needs to know its own host/port (I already know the host) and that can not be proxied.
I guess that at the same point/with the same logic that you can preallocate the ip_address you should be able to do the same for the port as well !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli For bugs relating to the CLI feature request painful Painful bug
Projects
None yet
Development

No branches or pull requests

3 participants