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

feat: all-in-one mirror configs function #14

Closed
kemingy opened this issue Nov 23, 2022 · 7 comments · Fixed by #17
Closed

feat: all-in-one mirror configs function #14

kemingy opened this issue Nov 23, 2022 · 7 comments · Fixed by #17
Assignees

Comments

@kemingy
Copy link
Member

kemingy commented Nov 23, 2022

Includes:

  • pypi index
  • conda channel
  • apt source
@gaocegege
Copy link
Member

LGTM!

@cutecutecat
Copy link
Member

I have an idea of this issue:
We provide

mirror_pip(source='tuna')

equals to

config.pip_index(url="https://pypi.tuna.tsinghua.edu.cn/simple")

and

mirror_apt(source = "sjtu", os = "20.04")

equals to

config.apt_source(source="""
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb https://mirror.sjtu.edu.cn/ubuntu focal main restricted
# deb-src https://mirror.sjtu.edu.cn/ubuntu focal main restricted
deb https://mirror.sjtu.edu.cn/ubuntu focal-updates main restricted
# deb-src https://mirror.sjtu.edu.cn/ubuntu focal-updates main restricted
deb https://mirror.sjtu.edu.cn/ubuntu focal universe
# deb-src https://mirror.sjtu.edu.cn/ubuntu focal universe
deb https://mirror.sjtu.edu.cn/ubuntu focal-updates universe
# deb-src https://mirror.sjtu.edu.cn/ubuntu focal-updates universe
deb https://mirror.sjtu.edu.cn/ubuntu focal multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu focal multiverse
deb https://mirror.sjtu.edu.cn/ubuntu focal-updates multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu focal-updates multiverse
deb https://mirror.sjtu.edu.cn/ubuntu focal-backports main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu focal-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner
deb https://mirror.sjtu.edu.cn/ubuntu focal-security main restricted universe multiverse
# deb-src ht

and

mirror_conda(source = "tuna")

equals to

config.conda_channel(channel="""
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
""")

And the all-in-one mirror configs function:

mirror(pip="tuna", apt= "sjtu", os = "20.04", conda="tuna")

equals to above.

@gaocegege
Copy link
Member

The approach works for me, but I prefer not to flatten the arguments:

mirror(pip="tuna", apt={source="tuna", os="20.04"})

Or we can infer the os version from the base.

/cc @kemingy @VoVAllen

@kemingy
Copy link
Member Author

kemingy commented Dec 5, 2022

We can start exposing some internal graph information like OS, Cuda version, and CUDNN version.

Then the interface will be clean: mirror(pip="tuna", apt="tuna", conda="tuna").

@cutecutecat
Copy link
Member

I would create a issue and PR of envd first about exposed starlark interface.
This issue will continue after that.

@kemingy
Copy link
Member Author

kemingy commented Dec 6, 2022

I think you can work on this one without knowing about the OS. Since the current implementation cannot change the base image. It's always Ubuntu20.04.

tensorchord/envd#1267 may take some time to discuss.

@cutecutecat
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants