campsych / concerto-platform

Concerto Platform - Open-Source Online Adaptive Testing Platform
https://concertoplatform.com/
Apache License 2.0
153 stars 88 forks source link

How to set docker config parameters for CI? #319

Closed snaeil closed 3 years ago

snaeil commented 3 years ago

Hello together,

I have to to modify values in files like parameters_test_runner.yml for CI purposes. For example I want to modify the session time for the sessions, used for Concerto API requests. I guess this value can be set in this file parameters_test_runner.yml. I do not want to change the value after deployment (e.g. by using the container's bash and modifying it with an editor) so I am looking for how to set this.

May it be possible to do this with docker volumes or even with a docker env variable?

It would be great to get some hints on how to deal with this case!

bkielczewski commented 3 years ago

You can share any file or directory between the host and container by making it a volume. There's chapter on that in Docker documentation. So for example when using docker-compose:

volumes:
  - ./parameters_test_runner.yml:/app/concerto/app/config/parameters_test_runner.yml

If you provide ./parameters_test_runner.yml (copy paste from the repo, add your modifications) then the container will use it when (re)created.

We don't have an env variable for that at the moment, maybe we should.

przemyslawlis commented 3 years ago

Actually, few variables from parameters_test_runner.yml is already exposed as env variables. You can see them, with their default values when no env variable is set, by looking at the file.


    env(CONCERTO_SESSION_STORAGE): filesystem
    env(CONCERTO_COOKIES_SAME_SITE): ""
    env(CONCERTO_COOKIES_SECURE): false
    env(REDIS_HOST): redis
    env(REDIS_PORT): 6379
    env(REDIS_PASS): ""
    env(CONCERTO_KEEP_ALIVE_INTERVAL_TIME): 900
    env(CONCERTO_KEEP_ALIVE_TOLERANCE_TIME): 0
    env(CONCERTO_SESSION_TOKEN_EXPIRY_TIME): 7200
bkielczewski commented 3 years ago

Cool, I wasn't looking at the latest source, sorry about that.

snaeil commented 3 years ago

Oh wow, that helps me a lot! Thanks :-)