The stata image was not based on base-action, and did not use
ACTION_EXEC to take advantage of the ability to run any executable in
the image.
So, this meant its custom entrypoint wouldn't work well with opensafely
exec if you just wanted to run stata interactively.
And whilst you could use --entrypoint /usr/bin/stata/stata, you'd a)
have to know to do that and b) lose the STATA_LICENSE env var set up.
So, this fixes that by:
switching to base-action, and using ACTION_EXEC to set the default
script to use.. This means that opensafely exec stata-mp stata or
opensafely exec stata-mp bash will just work as expected.
To work around the license issue, we add a simple stata executable
wrapper that sets the license, and is on the path, and that is our
stata executable, whether using the script-wrapper.sh or running via
CMD.
Along the way, I realised I'd accidentally regressed to using the non-mp
version of stata a long time ago. This fixes that, and makes all stata
be stata-mp. We avoid copying the non-mp binary into the image at all.
The stata image was not based on base-action, and did not use ACTION_EXEC to take advantage of the ability to run any executable in the image.
So, this meant its custom entrypoint wouldn't work well with opensafely exec if you just wanted to run stata interactively.
And whilst you could use
--entrypoint /usr/bin/stata/stata
, you'd a) have to know to do that and b) lose the STATA_LICENSE env var set up.So, this fixes that by:
switching to base-action, and using ACTION_EXEC to set the default script to use.. This means that
opensafely exec stata-mp stata
oropensafely exec stata-mp bash
will just work as expected.To work around the license issue, we add a simple stata executable wrapper that sets the license, and is on the path, and that is our stata executable, whether using the script-wrapper.sh or running via CMD.
Along the way, I realised I'd accidentally regressed to using the non-mp version of stata a long time ago. This fixes that, and makes all stata be stata-mp. We avoid copying the non-mp binary into the image at all.