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

Use Docker image files in dev container config #137

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

StevenMaude
Copy link
Contributor

See opensafely-core/research-template-docker#32.

In opensafely-core/research-template-docker#57, we moved this configuration to the Docker image.

We can now update the dev container configuration here to use those Docker image files.

Note that postAttachCommand now becomes a string, instead of an object; the object format allows for running multiple commands in parallel:

https://containers.dev/implementors/json_reference/#formatting-string-vs-array-properties

However, for our use case, this is fine for now as we only run one simple script (that only starts R Studio currently).

@StevenMaude
Copy link
Contributor Author

For this updated configuration to work, we need a new Docker image built and published following a merge of opensafely-core/research-template-docker/pull/57.

@StevenMaude
Copy link
Contributor Author

StevenMaude commented Jun 19, 2024

I tested this by running the dev container tests in research-template-docker.

This edited the test workflow there to use the updated dev image built from opensafely-core/research-template-docker#57 and a dev container JSON configuration as in this PR.

Run: https://github.com/opensafely-core/research-template-docker/actions/runs/9581024301

Once the image is available, I can check that a Codespace created from this branch works as expected, as a final check.

@StevenMaude StevenMaude marked this pull request as ready for review June 20, 2024 07:50
@StevenMaude StevenMaude marked this pull request as draft June 20, 2024 08:10
@StevenMaude
Copy link
Contributor Author

Needs a rebuild and another check following opensafely-core/research-template-docker#59.

See opensafely-core/research-template-docker#32.

In opensafely-core/research-template-docker#57, we moved this
configuration to the Docker image.

We can now update the dev container configuration here to use those
Docker image files.

Note that `postAttachCommand` now becomes a string, instead of an
object; the object format allows for running multiple commands in
parallel:

https://containers.dev/implementors/json_reference/#formatting-string-vs-array-properties

However, for our use case, this is fine for now as we only run
one simple script (that only starts R Studio currently).
@StevenMaude StevenMaude force-pushed the steve/use-devcontainer-files-from-docker-image branch from 53e7f7a to c4afa09 Compare June 20, 2024 10:35
@StevenMaude StevenMaude marked this pull request as ready for review June 20, 2024 10:59
@StevenMaude
Copy link
Contributor Author

StevenMaude commented Jun 20, 2024

I checked this in Codespaces launched from this branch:

  • the end of the creation log, running the postCreate.sh shows 2024-06-20 10:42:04.839Z: devcontainer process exited with exit code 0
  • ehrQL syntax highlighting works
  • opensafely run run_all works
  • the R config files are edited/added as expected
  • R Studio is launched and accessible

@StevenMaude StevenMaude merged commit 2694785 into main Jun 20, 2024
1 check passed
@StevenMaude StevenMaude deleted the steve/use-devcontainer-files-from-docker-image branch June 20, 2024 11:04
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