Skip to content

Conversation

@Chroxvi
Copy link
Contributor

@Chroxvi Chroxvi commented May 26, 2025

A devcontainer.json for cotainr with a focus (for now) on VS Code with podman.

Also sets a few environment variables in the Dockerfile which are useful for both the dev conatiner setup and the Makefile setup.

@Chroxvi Chroxvi mentioned this pull request May 26, 2025
4 tasks
@Chroxvi Chroxvi requested a review from juliusroeder May 26, 2025 11:50
@joasode
Copy link
Contributor

joasode commented May 26, 2025

When I open up that PR in my vscode, the terminal spams bash: history: /commandhistory/.bash_history: cannot create: Permission denied with every terminal command, is this expected behavior?

@joasode
Copy link
Contributor

joasode commented May 26, 2025

As far as I can see, at least one of these three settings are currently mandatory in settings.json for our tests to pass, maybe we should have a short section in the documentation for these details?

    "containers.containerClient": "com.microsoft.visualstudio.containers.podman",
    "containers.containerCommand": "podman",
    "containers.composeCommand": "podman-compose"

@Chroxvi
Copy link
Contributor Author

Chroxvi commented May 28, 2025

@joasode Did you test with docker (not podman)? I am a little worried about the bash: history: /commandhistory/.bash_history: cannot create: Permission denied issue. I wonder if that is specific to docker?

As we agreed in one of our check-ins, I only cared about podman when setting it up. Hence, in my settings.json, I have "dev.containers.dockerPath": "podman" which I believe should be sufficient to run using podman. And, yes, you most likely need more securityOpt flags to run using docker - as is currently hinted in the devcontainer.json comments. But you are right that we need to document all of this. It needs to be coordinated with the documentation related to #139, so @TheBlackKoala and I agreed to do a follow-up PR with documentation for both of these PRs.

@joasode
Copy link
Contributor

joasode commented May 28, 2025

@Chroxvi I tested it again, and indeed it seems like this was an error when I was still using docker and not anymore after I changed to podman.

@Chroxvi
Copy link
Contributor Author

Chroxvi commented May 28, 2025

Alright, then I think the bash: history: /commandhistory/.bash_history: cannot create: Permission denied issue is related to microsoft/vscode-remote-release#9931. It seems that it is only a problem when using Docker. At least setting containerUser to the non-root user solved the problem for me when using podman. I guess we'll just leave it at that for now. I can link the issue in the comments in the devcontainer.json and then we can just mention in the documentation that the devcontainer is (for now) only supported with podman.

@juliusroeder
Copy link
Contributor

Hi,
I am just trying this.
I added the dockerPath stuff to my settings list and I get the following errors.
Any idea what that is about?

image

Copy link
Contributor

@joasode joasode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good. (assuming that documentation of this VScode setup follows later)

@Chroxvi
Copy link
Contributor Author

Chroxvi commented Jul 3, 2025

The documentation is in this branch: main...dev_env_docs along with lots of other documentation updates. A PR is expected today or tomorrow. The VSCode documentation include a disclaimer about the dev container setup still being experimental since we are seeing so many issues with permissions for different combinations of OS'es, container runtimes, and versions of the VSCode dev container extension.

@juliusroeder's issue is reported upstream: microsoft/vscode-remote-release#11042

I will try to make a similar report for the VSCode dev container v0.417.0 regression, I have encountered.

@Chroxvi Chroxvi merged commit ec2ff39 into main Jul 3, 2025
106 of 107 checks passed
@Chroxvi Chroxvi deleted the docker_dev_env_cotainr_devcontainer branch July 3, 2025 07:14
Chroxvi added a commit that referenced this pull request Jul 7, 2025
* First draft of devcontainer for cotainr

* Dev container pre-commit and vscode integrations.

* Cleaned up comments in devcontainer.json

* Persisted bash history and set LANG in devcontainer.json

* Updated dev container to use main branch container.

* Added missing relnotes .PHONY target in docs Makefile.

* Added common runtime env vars to Dockerfile.

* Removed env vars from devcontainer.json that are now in the Dockerfile.

* Added comment to devcontainer.json about volume mounts with docker.

* Updated devcontainer.json to persist venv in volume mount.
Chroxvi added a commit that referenced this pull request Jul 8, 2025
* New and (hopefully) more robust logging reload pytest fixture.

* Minor comment update.

* Include review suggestion.

Co-authored-by: Joachim Sødequist <[email protected]>

* Introduce dev container Makefile (#139)

* Added a makefile with what we think is reasonable

* remove test thingy

* Better singularity url

* Update makefile to non-privileged run

* Add docs building functionality and default target

* Fix building docs

* Remove userid things

* Comments, help and very explicit login

* Just a bit .PHONY

* Enhance Makefile (#156)

* Enhance Makefile

* Add review changes

* Move quotation mark

* singularity debug verbosity level

* 5th debug level added. documentation and tests adjusted.

* Cotainr devcontainer (#153)

* First draft of devcontainer for cotainr

* Dev container pre-commit and vscode integrations.

* Cleaned up comments in devcontainer.json

* Persisted bash history and set LANG in devcontainer.json

* Updated dev container to use main branch container.

* Added missing relnotes .PHONY target in docs Makefile.

* Added common runtime env vars to Dockerfile.

* Removed env vars from devcontainer.json that are now in the Dockerfile.

* Added comment to devcontainer.json about volume mounts with docker.

* Updated devcontainer.json to persist venv in volume mount.

* Move to a specific cotainr-conda location rather than a generic conda-location (#66)

* Change prefix from /opt/conda to /opt/cotainr/conda

* Linting fixes

* Change prefix of tests

* Fix comments

* Handled review comments for caplog leakage fix.

---------

Co-authored-by: Joachim Sødequist <[email protected]>
Co-authored-by: JuliusRoeder <[email protected]>
Co-authored-by: Tor Skovsgaard <[email protected]>
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.

4 participants