-
Notifications
You must be signed in to change notification settings - Fork 103
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
Mixed conda / private pip lock file does not install inside docker container #623
Comments
Hi @metgrahamr! This seems like a tricky one. Thanks a lot for experimenting with I think we'll need to drill down quite a bit more before we can isolate the cause of this issue.
It would help a lot with the diagnosis if you could share relevant snippets (or better the whole thing minus personally identifiable info if not confidential) from your original environment definition, the generated lockfile, and the particular |
I initially tried this in a Dockerfile as I want to use conda-lock to install all the dependencies for an AWS Lambda function. However, when it didn't work I also fired up a container with docker run and tried replicating what I was doing in the Dockerfile but got the same results.
For the Dockerfile I used ARG and supplied the CodeArtifact token as a build argument. When using docker run I created an environment variable once inside the container. I checked that it was available in the environment, e.g.
I then pass the credentials in like this
The env file looks like this
Thanks for looking into this (and the project as a whole) it's much appreciated. |
Hey @metgrahamr, thanks a lot for bearing with my questions. This seems pretty challenging to debug, and unfortunately I wasn't able to get to it over the weekend. Just wanted you to know that I haven't forgotten. Please feel free to ping me again later or continue debugging yourself. |
@maresb Thanks for the update and for keeping this under consideration. |
Hey @metgrahamr, sorry I wasn't able to address this in a timely manner. While trying to get the tests to pass for #637 I realized that the cache directory was causing problems. ( If you delete this directory, I suspect you'll be able to reproduce the issue outside of Docker. In my recent commits on that PR I change the way we pass the authentication information to Poetry, so I hope we'll be able to merge/release soon, and that this will fix the issue for you. |
@maresb Thanks, exciting that you have likely found the issue. The project that I was considering this for has had to be put aside for higher priorities but it is due to bubble back up the list soon (and I would like to use conda-lock in other projects in a similar way) so hopefully I will get a chance to test in the near future. Thanks again and I really appreciate the update. |
Cool! By the way, have you considered pixi? It's not a drop-in replacement for |
Thanks, pixi is on the list of things to look at but hadn't realised that dependency handling was more robust. Might bump up the priority! |
Checklist
What happened?
I created a lock file using a mix of conda-forge packages and private pip packages in an AWS CodeArtifact repo in a similar way to here but as I am using conda-lock version 2.5.6 I don't have the issue with the value of the CodeArtifact password being passed through.
With the CodeArtifact password set as an environment variable, I can successfully use this lock file to create a new conda environment. However, if I try to do this from within a docker container then I get the following error
I wondered whether the error was anything to do with this and tried adding
--no-capture-output
to the conda run command that gets called. This just caused the install to hang at the first package install. Running the pip install command manually with the requirements file in the /tmp directory prompted for a user and then password. If I enteredaws
and the CodeArtifact password at each prompt then pip was able to install each package.It looks like when running inside a docker container the install command is not getting the password from the environment and is trying to prompt for the information. How do I get this lock file to work inside a docker container in the same way that it works outside?
Conda Info
Conda Config
No response
Conda list
No response
Additional Context
I am using the
continuumio/miniconda3:latest
docker image and install conda-lock into the base environment using pip.The text was updated successfully, but these errors were encountered: