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

Add ability to install custom Stata packages #25

Open
craig-willis opened this issue Sep 8, 2021 · 3 comments
Open

Add ability to install custom Stata packages #25

craig-willis opened this issue Sep 8, 2021 · 3 comments

Comments

@craig-willis
Copy link
Collaborator

For environments and package managers other than STATA, custom packages can be declared and installed at image build time instead of run time (e.g., apt.txt, requirements.txt, install.R, toolboxes.txt).

We need to support both ssc and net install commands. Both of these appear to use the PLUS system directory, which is by default in ~/ado/plus/.

. sysdir
   STATA:  /usr/local/stata/
    BASE:  /usr/local/stata/ado/base/
    SITE:  /usr/local/ado/
    PLUS:  ~/ado/plus/
PERSONAL:  ~/ado/personal/
OLDPLACE:  ~/ado/

I propose that we add support for an install.do file (similar to install.R) that would be run at build time. Each line can be an arbitrary Stata command, but intended for ssc or net install. For example:

install.do:

ssc install [`pkg', replace]
net install pkgname [, all replace force from(directory or url)]

I think it might make sense to change the PLUS sysdir to something outside of ~, such as:

sysdir set PLUS /usr/local/stata/ado/site
@larsvilhuber
Copy link

PLUS should be set to within the project space, so it can be seen by the researcher running the code, though a fully encapsulated docker image wouldn't care where it is installed. This is more for transparency than reproducibility.

cap mkdir "/home/jovyan/workdir/ado"
sysdir set PLUS "/home/jovyan/workdir/ado"
(run all install commands)

@craig-willis
Copy link
Collaborator Author

Does "project space" equate to our "tale workspace"? Because our workspace is mounted at runtime, to be built into the Docker image any packages would need to be installed outside of the workspace. Packages can be installed into the workspace at run time and would be included when exporting/publishing, etc, but not as part of the the built image. But I may have misunderstood.

@larsvilhuber
Copy link

sorry for confusion. Any installed packages should be installed for a given tale, not for a given user, at build time of the Docker image (not at runtime of the code running within the Docker). In essence, best practice is NOT to install live, but install only once, when building the Docker image.

Note that this should be the same paradigm as for Python, R, etc.

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

2 participants