Skip to content

Conversation

@Jongmassey
Copy link
Contributor

@Jongmassey Jongmassey commented Aug 6, 2025

re #147

Base on MS devcontainer Jammy image to match OpenSAFELY base image.

Install R/Python and their dependencies.

Use docker cp to copy the R/Python library files to the host filesystem which avoids any of the previously seen issues with mounting a running container, however the issues we saw may not apply now we're installing the executables in the host system rather than trying to mount them and their dependencies.

Mounting the libraries appears to be faster still, but there may be some more rough edges that are revealed with further testing. A sample implementation is included but commented out.

@Jongmassey Jongmassey force-pushed the Jongmassey/use-ms-devcontainer-base-image branch 2 times, most recently from 4361080 to ce61f1f Compare August 6, 2025 22:47
@Jongmassey
Copy link
Contributor Author

Jongmassey commented Aug 6, 2025

Fired up a new codespace based on this branch - got into a working vs code environment in about a minute where I could write ehrql with full syntax highlighting and autocomplete.

The rest of postcreate.sh (which sets up the full Python and R environments) didn't finish until 6 mins later which is quite slow but at least everything else is responsive in the meantime.

I've checked that the right version of Python loads (3.10) and all the expected libraries are available (help("modules")), and similarly with R.

I've added an auto-starting Rstudio instance via opensafely launch to postAttach.sh, but this won't run til after postCreate.sh is done. We could change the ordering of this, or leave it to users to start it themselves, which they could do without having to wait for all of postCreate.sh to finish.

Base on MS devcontainer Jammy image to match OpenSAFELY base image.

Install R/Python and their dependencies using the respective
requirements.txt from the `main` branch on github.
This file is not copied to the built docker action images so we cannot
copy it from their containers.

Use `docker cp` to copy the R/Python library files to the host filesystem
which avoids any of the previously seen issues with mounting a running
container.

However, these library directories don't contain any symlinks
(verified with `find . -type l`) so one of the major issues with
mounting is not of concern here so commented-out mount-based
alternative is provided here which has better performance than the
`docker cp` approach.
@Jongmassey Jongmassey force-pushed the Jongmassey/use-ms-devcontainer-base-image branch from ce61f1f to 6940b03 Compare August 8, 2025 08:09
@Jongmassey Jongmassey changed the title Use MS devcontainer base image PoC: Use MS devcontainer base image Aug 8, 2025
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

Successfully merging this pull request may close these issues.

2 participants