mamba-org / micromamba-devcontainer Goto Github PK
View Code? Open in Web Editor NEWA micromamba-based VS Code development container image.
License: MIT License
A micromamba-based VS Code development container image.
License: MIT License
Trying to use this devcontainer on a project also using pre-commit
.
Getting the following error when committing changes, or running pre-commit
manually:
An unexpected error has occurred: PermissionError: [Errno 13] Permission denied: '/mnt/cache'
Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/pre_commit/error_handler.py", line 73, in error_handler
yield
File "/opt/conda/lib/python3.10/site-packages/pre_commit/main.py", line 340, in main
store = Store()
File "/opt/conda/lib/python3.10/site-packages/pre_commit/store.py", line 51, in __init__
os.makedirs(self.directory, exist_ok=True)
File "/opt/conda/lib/python3.10/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/opt/conda/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/mnt/cache'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/bin/pre-commit", line 11, in <module>
sys.exit(main())
File "/opt/conda/lib/python3.10/site-packages/pre_commit/main.py", line 337, in main
with error_handler(), logging_handler(args.color):
File "/opt/conda/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/opt/conda/lib/python3.10/site-packages/pre_commit/error_handler.py", line 81, in error_handler
_log_and_exit(msg, ret_code, e, traceback.format_exc())
File "/opt/conda/lib/python3.10/site-packages/pre_commit/error_handler.py", line 31, in _log_and_exit
storedir = Store().directory
File "/opt/conda/lib/python3.10/site-packages/pre_commit/store.py", line 51, in __init__
os.makedirs(self.directory, exist_ok=True)
File "/opt/conda/lib/python3.10/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/opt/conda/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/mnt/cache'
After briefly looking at the source, it might be related to the following logic:
micromamba-devcontainer/Dockerfile
Lines 171 to 177 in e56c5fc
This is reproducible by creating a Codespace from https://github.com/maresb/micromamba-devcontainer-example:
Does anyone know if Codespaces has any way of communicating your name and e-mail so that it doesn't have to be configured every time?
When I run VS Code as an application, it always seamlessly forwards my local credentials, including my GPG key.
(base) mambauser@codespaces-305e2e:/workspaces/micromamba-devcontainer-example$ git commit -m "aowfeij" --allow-empty
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'mambauser@codespaces-305e2e.(none)')
After briefly looking around, I see the environment variable GITHUB_USER=maresb
, but that's not enough. I also see VSCODE_GIT_IPC_HANDLE=/tmp/vscode-git-db9813fb72.sock
but I can't find any docs about it.
As this project has been migrated from my personal account to mamba-org, unfortunately it seems like the GHCR images are no longer accessible.
I'm not sure how to fix this, but I recommend updating to the latest image, currently:
FROM ghcr.io/mamba-org/micromamba-devcontainer:git-e56c5fc
Sorry about the inconvenience, this was a bit unexpected.
Now that there is a matrix from #28, we should modify the update script so that the matrix is kept up-to-date.
CC @basnijholt
I can not build the devcontainer which I created using cruft create https://github.com/maresb/cookiecutter-micromamba-devcontainer
:
=> [ 5/13] RUN : && micromamba config append channels conda-forge 0.5s
=> => # terminate called after throwing an instance of 'std::system_error'
=> => # what(): Operation not permitted
I tried to comment out the this step to see how far it gets, but then, the following pipx install
step fails.
VS Code log file: remoteContainers-2023-06-27T08-49-37.276Z.log
Version: 1.70.2
Commit: e4503b30fc78200f846c62cf8091b76ff5547662
Date: 2022-08-16T05:36:25.715Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Linux x64 5.15.0-75-generic
Interestingly, even running the bare docker image does not work:
$ docker run --rm -it ghcr.io/mamba-org/micromamba-devcontainer:git-d175103
Unable to find image 'ghcr.io/mamba-org/micromamba-devcontainer:git-d175103' locally
git-d175103: Pulling from mamba-org/micromamba-devcontainer
[...]
Digest: sha256:fb56b66c8993ee752840daa5b9cfdaff6e53a089bafae858b92870a9cd05c3d8
Status: Downloaded newer image for ghcr.io/mamba-org/micromamba-devcontainer:git-d175103
terminate called after throwing an instance of 'std::system_error'
what(): Operation not permitted
terminate called after throwing an instance of 'std::system_error'
what(): Operation not permitted
/usr/local/bin/_activate_current_env.sh: line 35: 14 Aborted (core dumped) micromamba activate "${ENV_NAME}"
We should use a setup similar to mamba-org/micromamba-docker.
@wholtz, would you mind if I copied a bunch of the stuff you wrote to this repo? I would of course give you commit author attribution.
In the README.md
, I don't see a pointer to where the image resides in an image repo. Currently, you have to dig into the examples or issues to find this information.
Dev Container Spec is now open and individual features (to install something or to setting something) are intended to be used in combination like Lego blocks, so it is recommended to publish them as Dev Container Features instead of writing them in the Dockerfile.
Also, by publishing Dev Container Templates, users can import templates from the Internet using the devcontainer CLI or VSCode Dev Container.
See below for published Features and Templates.
https://containers.dev/features
https://containers.dev/templates
(The reason I made this post is that I was considering publishing a Dev Container Feature for installing micromamba, on rocker-org, but I thought that if mamba-org is interested in Dev Container it would obviously be more appropriate to be managed here.)
I am familiar with Dev Container Feature and Template publishing and may be able to help if needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.