Skip to content

Commit

Permalink
bug: fix explicit channel setting with conda env.yaml (#1008)
Browse files Browse the repository at this point in the history
* fix channel

Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai>

* lint

Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai>

* fix test

Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai>

Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai>
  • Loading branch information
VoVAllen committed Oct 14, 2022
1 parent bcd8029 commit d3f93a8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
9 changes: 9 additions & 0 deletions e2e/language/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,13 @@ var _ = Describe("python", Ordered, func() {
e.RunContainer()()
e.DestroyContainer()()
})

It("Should build conda with separate channel setting successfully", func() {
exampleName := "python/conda_channel"
testcase := "e2e"
e := e2e.NewExample(e2e.BuildContextDirWithName(exampleName), testcase)
e.BuildImage(true)()
e.RunContainer()()
e.DestroyContainer()()
})
})
10 changes: 10 additions & 0 deletions e2e/language/testdata/python/conda_channel/build.envd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def build():
config.conda_channel(
channel="""
channels:
- defaults
- dglteam # dgllife in env.yaml only works if specify channels here
"""
)
install.conda_packages(env_file="env.yaml")
base(os="ubuntu20.04", language="python3.8")
3 changes: 3 additions & 0 deletions e2e/language/testdata/python/conda_channel/env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: imarobot # should ignore this name
dependencies:
- dgl
2 changes: 1 addition & 1 deletion pkg/lang/ir/conda.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
var (
// this file can be used by both conda and mamba
// https://mamba.readthedocs.io/en/latest/user_guide/configuration.html#multiple-rc-files
condarc = fileutil.EnvdHomeDir(".condarc")
condarc = "/opt/conda/.condarc"
//go:embed install-conda.sh
installCondaBash string
//go:embed install-mamba.sh
Expand Down

0 comments on commit d3f93a8

Please sign in to comment.