Skip to content
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

Feature Request: PsN Default Number of Threads #5

Closed
billdenney opened this issue Jun 21, 2017 · 6 comments
Closed

Feature Request: PsN Default Number of Threads #5

billdenney opened this issue Jun 21, 2017 · 6 comments

Comments

@billdenney
Copy link
Collaborator

PsN by default has 5 threads for NONMEM execution. While it's possible to change this on the fly, it's preferable to me to have it default to the number of licenses I've purchased. For that, I'd propose the following change to the Dockerfile:

# in the preamble
ARG NUM_THREADS=4
# After running setup.pl
  && sed s/threads=5/threads=$NUM_THREADS/ /usr/local/share/perl/*/PsN_4*/psn.conf > psn.conf.tmp \
  && mv psn.conf.tmp /usr/local/share/perl/*/PsN_4*/psn.conf \
@BretFisher
Copy link
Collaborator

Isn't this something we could set as a ENV with a default value and let someone overwrite at runtime, rather than worrying about build time? or does it affect builds/testing?

@dpastoor
Copy link
Collaborator

no should not affect builds/testing - an env variable with a default of 4 would be most reasonable, as that would be relevant for a single license pack.

@billdenney
Copy link
Collaborator Author

I set it as an ARG because users can input their number of licenses and then it becomes the default for all executions in their installation. Is there a significant downside to an ARG with a default argument as opposed to an ENV?

@billdenney
Copy link
Collaborator Author

The effect on build is related to the config file setting. Because it affects many commands within PsN, I think that this is the simplest way to do set the default number of threads (though I'm happy to be proven wrong).

@BretFisher
Copy link
Collaborator

Anything that is "environment specific" such as running on one machine vs. another should be a ENV that's changeable at runtime. An ARG is only used at build time, which is fine if the value never needs to change during runtime. Sounds like we might need a docker-entrypoint.sh, which is the standard for how to change config files during container startup. We can have docker-compose.yml have the ENV in it, and document that anyone can change that value before startup, then docker-entrypoint.sh runs on startup and writes changes to config files.

@BretFisher
Copy link
Collaborator

OK so I've updated some things in master. Latest commits fix this issue I believe.

  • I've added some getting started info to README.md that may help understand this process.
  • The assumption is the standard user is using docker-compose commands for this and using our pre-built images, but once someone knows what they are doing they can use the alternate compose file and an override file to tweak things.
  • NUM_THREADS is now an ENV that writes to /root/psn.conf at container runtime. Just update the docker-compose.yml or create a docker-compose.override.yml to modify. No need to rebuild images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants