-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Bug]: Upload endpoint not available #132
Comments
looking at the java code I can see, that we're not using the port provided in the config before starting the server:
Also, with the change of the default port of 8080 that breaks the ease of use for non-k8s environments @svrnm. In k8s the service maps port 8080 from the container to port 80, but thats not available in docker-compose. We might need to revert that, what do you think? |
The port in the config is not the port that should be used here, that's why we renamed it to "exposedPort", I might need to fix that for the docker compose generator still. The port the service uses is configured via
The default port is still 8080, what I do for docker compose is that by default it is remapped to 80, such that the services can communicate via port-less URLs between each other since such a mapping is not possible with compose |
Bug Description
I'm using Docker to run the app-sim but the upload endpoint does not answer
curl http://localhost:3000/upload
curl: (7) Failed to connect to localhost port 3000 after 0 ms: Couldn't connect to server
Expected Behavior
Reason:
We did several tests with Alex - @noMoreCLI , and it seems that:
- Even if we define a specific port in the config.yaml, the value is not used in entrypoint.sh, it uses exposedPort instead
- For the java service, it always listen on port 8080 (same configuration will work if we use a nodejs service instead of Java)
example of a working configuration (extract of config.yaml)
services:
frontend:
type: nodejs
port: 3000
endpoints:
http:
/upload:
- http://processing:8080/magicByte
- http://processing:8080/virus
Non-working config:
services:
frontend:
type: java
port: 3000
endpoints:
http:
/upload:
- http://processing/magicByte
- http://processing/virus
Affected Version
v1.0.0
Steps to Reproduce
docker run --rm -t -i -v ${PWD}:/mnt ghcr.io/cisco-open/app-simulator-generators-docker-compose --config /mnt/config.yaml --output /mnt/docker-compose.yaml
Docker compose up -d
curl http://localhost:3000/upload
Config.yaml:services:
frontend:
type: java
port: 3000
endpoints:
http:
/upload:
- http://processing/magicByte
- http://processing/virus
processing:
type: java
port: 8080
endpoints:
http:
/magicByte:
- cache,128
/virus:
- http://virus-scanner/scan
virus-scanner:
type: nodejs
endpoints:
http:
scan:
- sleep,1500
- call: error,500,Scan failed
probability: 0.1
- sleep,500
loaders:
user-1:
type: curl
wait: 0
sleep: 2
urls:
- http://frontend/upload
- http://frontend/upload
- http://frontend/upload
Checklist
The text was updated successfully, but these errors were encountered: