whole-tale / repo2docker_wholetale

Repo2docker plugin for Whole Tale
Other
0 stars 1 forks source link

Use XFCE for STATA Desktop and add `install.do` support #26

Closed craig-willis closed 3 years ago

craig-willis commented 3 years ago

Fixes https://github.com/whole-tale/whole-tale/issues/102 and https://github.com/whole-tale/repo2docker_wholetale/issues/25

Depends on/related to:

This PR:

To test locally

Clone https://github.com/whole-tale/repo2docker/pull/4 and pip install -e .

Clone this repo and pip install -e .

Encode STATA license to pass as build arg (this is done in https://github.com/whole-tale/gwvolman/pull/154):

STATA_LICENSE_ENCODED=`base64 -w 0 /home/ubuntu/deploy-dev/volumes/licenses/stata/stata.<date>.lic`

Build the image using the example config:

cd repo2docker_examples/stata
repo2docker --build-arg STATA_LICENSE_ENCODED=${STATA_LICENSE_ENCODED} --config \
/home/ubuntu/repo2docker_wholetale/repo2docker_config.py --user-name jovyan \
--user-id 1000 --debug --no-run .

You should see the following where the latab package is installed successfully to /usr/local/stata/ado/site

#48 1.756 Running /usr/local/stata/profile.do ...
#48 1.756
#48 1.756 . sysdir set PLUS /usr/local/stata/ado/site
#48 1.756
#48 1.756
#48 1.756 . ssc install latab
#48 2.420 checking latab consistency and verifying not already installed...
#48 3.121 installing into /usr/local/stata/ado/site/...
#48 3.122 installation complete.
#48 3.122
#48 3.122 . #48 DONE 4.2s

Run the image

docker run -p 10001:10000 -v /home/ubuntu/deploy-dev/volumes/licenses/stata/stata.<date>.lic:/usr/local/stata/stata.lic <image name>  xpra start-desktop --bind-tcp=0.0.0.0:10000 --html=on --daemon=no --exit-with-children=no --start=xfce4-session

Confirm latab is indeed installed

ls /usr/local/stata/ado/site/l
latab.ado  latab.hlp  latabstat.ado  latabstat.hlp

Install a package interactively:

stata do test.do

...
. ssc install outreg2
checking outreg2 consistency and verifying not already installed...
installing into /home/jovyan/ado/plus/...
installation complete.
...

ls ~/ado/plus/o/

Confirm outreg2 is installed in the PLUS sysdir.

To test on Staging My gwvolman and repo2docker_wholetale images have been deployed to staging.