finos / legend-engine

Legend Engine module
https://legend.finos.org
Apache License 2.0
80 stars 233 forks source link

Image won't run by itself #299

Closed pedroleaoc closed 3 years ago

pedroleaoc commented 3 years ago

Hi folks, I am working on a Charmed Operator for Legend Server and I am trying to understand how the different parts of Legend interact during deployment.

Should I be able to simply pull and run the Engine image directly from dockerhub?

It seems like it's trying to access a volume that is not yet mounted. I know these images were probably design to work with Docker Compose mainly, but am I missing something obvious here (that is probably covered by the Maven install guide)?

Thanks :-)

$ docker pull finos/legend-engine-server:2.35.1
$ docker run --rm -it finos/legend-engine-server:2.35.1
15:26:30.336 [main] INFO Alloy Execution Server - {"duration":0.0,"eventType":"URL_FACTORY_REGISTERED","message":"Registered Alloy URL Factory","timeStamp":"2021-07-02 15:26:30.037","user":"_UNKNOWN_"}
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
java.io.FileNotFoundException: File /config/config.json not found
        at io.dropwizard.configuration.FileConfigurationSourceProvider.open(FileConfigurationSourceProvider.java:18)
        at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:80)
        at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:126)
        at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:74)
        at io.dropwizard.cli.Cli.run(Cli.java:78)
        at io.dropwizard.Application.run(Application.java:93)
        at org.finos.legend.engine.server.Server.main(Server.java:91)
akphi commented 3 years ago

@pedroleaoc Did you provide a config file when you try to run this?

pedroleaoc commented 3 years ago

Thanks for your answer, @akphi.

What I've done so far:

Question: Can I run engine without sdlc? Does it make sense Legend-wise?

akphi commented 3 years ago

@pedroleaoc Ah I think I see your problem now. The Dockerfile for legend-engine is like this https://github.com/finos/legend-engine/blob/333214b2a439ae751e9caea9035d90958a9d1ab2/legend-engine-server/Dockerfile#L15-L17

The last line, it was looking for the config at the location config/config.json. So you might want to modify your mounted drive to something like

-v $BUILD_DIR/generated-configs/engine/config:/config \

Or something along that line (since I don't know how you generate the configs in generated-config but I suppose you get this from the code of our AWS installers), the best way to check is to go inside the container and make sure the path /config/config.json exists.

Where is config.json created? I found a generic one and removed everything related to Mongo - is there a better way to generate/get this file?

We have mentioned in our installation guide that if you don't go the docker-compose route, you can use this config

Question: Can I run engine without sdlc? Does it make sense Legend-wise?

Yes, in our stack we make sure engine does not depend on sdlc.

pedroleaoc commented 3 years ago

Ah! Thanks for the pointers, that helped a lot!

I was looking for the (wrong) config file in the wrong place.