clulab / eidos

Machine reading system for World Modelers
Apache License 2.0
36 stars 24 forks source link

[DART-1248] - Adding a way for wmexchanger to connect to DART without specifying authentication credentials #1110

Closed yanzv closed 2 years ago

yanzv commented 2 years ago

For DART in the box eidos is going to be running within the same docker network as the rest of the applications and I would like to be able to configure for wmexchanger to connect to Kafka and REST endpoints directly without authentication. @kwalcock please let me know if you have any concerns with these config changes. Also, squash merge to if you are going to accept the pr.

Thanks!

kwalcock commented 2 years ago

Cool. I'll look at it soon.

kwalcock commented 2 years ago

It looks OK to me. Thanks for dealing with the code duplication. To run on separate networks again, one would need to revert the changes to application.conf, I guess. Do you all there prefer an empty String to an Option[String] of None?

yanzv commented 2 years ago

Great. To run on a separate network you would just configure authentication via ENV variables.

username: ${?REST_PRODUCER_USERNAME}
 password: ${?REST_PRODUCER_PASSWORD}

I think Option[String] would be preferable but I didn't want to change the method signature.

kwalcock commented 2 years ago

Were these values unnecessary or wrong then? (I'm making notes in case it does need to go back one day.)

    sasl.jaas.config: "org.apache.kafka.common.security.plain.PlainLoginModule required username=\""${KAFKA_USERNAME}"\" password=\""${KAFKA_PASSWORD}"\";"
    security.protocol: SASL_SSL
yanzv commented 2 years ago

This is when you are connecting to SASL_SSL authenticated kafka endpoint otherwise the connection will fail if the protocol is PLAINTEXT

kwalcock commented 2 years ago

You might be interested in webapp/docker.sbt. Recently we've been having sbt build the docker images. It works in two stages (as your system does) and probably gets to skip some of the time-consuming intermediate steps. It has seemed fast to me.