envd icon indicating copy to clipboard operation
envd copied to clipboard

feat: conda/mamba create env from `env.yaml` file

Open kemingy opened this issue 3 years ago • 9 comments

Signed-off-by: Keming [email protected]

  • split "create user envd" and "chown envd"
  • fix conda/mamba create new env from env YAML file

kemingy avatar Sep 22 '22 09:09 kemingy

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kemingy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

muniu-bot[bot] avatar Sep 22 '22 09:09 muniu-bot[bot]

Also will conda install anything under current user folder?

VoVAllen avatar Sep 22 '22 10:09 VoVAllen

Do you need also chown on pip package path? Also if there's pip package in conda yaml file, is it installed under root user or envd user?

Pip package path should be under "/opt/conda/envs/envd".

Tested "install -e ." can work.

kemingy avatar Sep 22 '22 10:09 kemingy

Also will conda install anything under current user folder?

Does "current user folder" mean "/home/envd"? This one has also been chowned.

kemingy avatar Sep 22 '22 10:09 kemingy

I mean if the installation process is executed under root user, will it install anything to /root/XXXX?

VoVAllen avatar Sep 22 '22 10:09 VoVAllen

Pip package path should be under "/opt/conda/envs/envd".

Could you please verify if pip cache works after the change? I am not sure if /home/envd/.pip/cache still work

gaocegege avatar Sep 22 '22 10:09 gaocegege

I mean if the installation process is executed under root user, will it install anything to /root/XXXX?

Not sure if some libraries will modify the /root/ dir. Do you have any examples? I tried jupyter, it looks good.

Pip package path should be under "/opt/conda/envs/envd".

Could you please verify if pip cache works after the change? I am not sure if /home/envd/.pip/cache still work

The cache seems doesn't work at all. I tried to use /root/.cache/pip, /opt/conda/pkgs, but it doesn't work. Let me try to figure it out.

kemingy avatar Sep 22 '22 11:09 kemingy

You can try install pip package such as numpy in conda. And check whether user can import numpy under user envd

VoVAllen avatar Sep 22 '22 12:09 VoVAllen

And, if we use root in the building, and use envd in the runtime, there may be different cache locations between build time and runtime.

For example, pip cache in build time will be stored in /home/root/.pip, and it should be /home/envd/.pip in runtime.

I am not sure if it is possible to customise the cache location.

gaocegege avatar Sep 23 '22 00:09 gaocegege

Please rebase.

gaocegege avatar Sep 30 '22 00:09 gaocegege

https://github.com/tensorchord/envd/actions/runs/3170574497/jobs/5163236483#step:7:3192

There are some issues in CI.

gaocegege avatar Oct 03 '22 02:10 gaocegege

According to my observation, micromamba update -f env.yaml doesn't install anything from the YAML file. Instead, it only updates all the existing packages.

We'd better use conda update because it requires mounts, which means it cannot be cached.

kemingy avatar Oct 03 '22 09:10 kemingy

I removed most of the chown operations. Users can still access conda, use pip install.

  • fix actions/toolkit#644

kemingy avatar Oct 03 '22 09:10 kemingy

https://open-vsx.org/api is too fragile. Sadly, GitHub actions don't support allow-failure https://github.com/actions/runner/issues/2347.

kemingy avatar Oct 03 '22 09:10 kemingy

/lgtm

Thanks for your contribution! :tada: :+1:

gaocegege avatar Oct 04 '22 01:10 gaocegege