heavyai / mapd_on_azure

Installation scripts for MapD on Microsoft Azure
Apache License 2.0
3 stars 3 forks source link

https support #2

Open 0xsaxit opened 5 years ago

0xsaxit commented 5 years ago

After running provided scripts, docker image is forwarding its port to outer port "9092". Is there any way to change it to https(443 port)?

randyzwitch commented 5 years ago

You can change the port here: https://github.com/omnisci/mapd_on_azure/blob/master/StartMapD.sh#L19

Please keep in mind that Community Edition is no longer supported. So while these instructions should still work, it doesn't represent the current state of the OmniSci project.

0xsaxit commented 5 years ago

There must be also some configurations for setting up ssl. Only change port to 443 doesn't mean to use HTTPS. Any ideas?

randyzwitch commented 5 years ago

To set up HTTPS, you need to create certificates:

https://www.omnisci.com/docs/latest/5_secure_server.html

The example shows how to make a self-signed example, which should be fine for using locally with a Docker container.

0xsaxit commented 5 years ago

i am getting "start_omnisci_server command not found". can you please let me know what I have to fix this error? Thanks

0xsaxit commented 5 years ago

https://www.omnisci.com/docs/latest/5_secure_server.html The steps which were mentioned on this article is for running inside of docker image? Or outside of docker?

randyzwitch commented 5 years ago

That's actually the wrong link, my apologies. This is the correct one:

https://www.omnisci.com/docs/latest/4_configuration.html#configuration-parameters-for-omnisci-web-server

To answer your question, you have to modify the code inside the docker container, as this is where the OmniSci code is running.

0xsaxit commented 5 years ago
docker run --runtime=nvidia \
-v $HOME/mapd-docker-storage:/mapd-storage \
-p 9090-9092:9090-9092 \
mapd/mapd-ce-cuda

if I understood properly, this code is for running docker image and the docker image forwards inner port number (9092) to outer port number (9092). To enable https, do I have to stop omnisci server in the running docker image and start it after proper settings for https?

andrewseidl commented 5 years ago

If it exists, the Docker image will use the config file at /mapd-storage/mapd.conf if version < 4.6, /omnisci-storage/omnisci.conf if >= 4.6.

Based on your run command, create file $HOME/mapd-docker-storage/mapd.conf with something like:

[web]
enable-https = true
key = "/mapd-storage/server.key"
cert = "/mapd-storage/server.cert"

then place your https key and cert at $HOME/mapd-docker-storage/server.{key,cert} on the host.

Note: you'll still want to use port 9092 inside the container as the scripts to used to start the server inside the container may override it. Outside the container you can use whatever port you want.

0xsaxit commented 5 years ago

So here are the things what I did. In docker image, created file at /mapd-storage/mapd.conf. Copied the contents to mapd.conf file. Generated server.key and server.cert files at mapd-storage folder. After that, do I have to restart server? What commands should I use for this? Thanks

andrewseidl commented 5 years ago

Restart the container, either with docker kill ... and then re-run the docker run ..., or use docker stop / docker start.

0xsaxit commented 5 years ago
Backend TCP:  localhost:9091
Backend HTTP: localhost:9090
Frontend Web: localhost:9092
Calcite TCP: localhost:9093
- sleeping for 5s while server starts
Navigate to: http://localhost:9092
Thrift: Thu Jun  6 18:16:04 2019 TSocket::open() connect() <Host: localhost Port: 9093>Connection refused
Thrift: Thu Jun  6 18:16:04 2019 TSocket::open() connect() <Host: localhost Port: 9093>Connection refused

After restarting docker, it doesn't take me to https. http also doesn't work. But if I remove mapd.conf, http works and https doesn't work. I think mapd.conf file is wrong.

[web]
enable-https = true
key = "/mapd-storage/server.key"
cert = "/mapd-storage/server.cert"

Any ideas?