diff --git a/base-images/build.sh b/base-images/build.sh index a2dfcad28..861031731 100755 --- a/base-images/build.sh +++ b/base-images/build.sh @@ -2,7 +2,8 @@ ROOT_DIR=`dirname $0` -ENVD_VERSION="${ENVD_VERSION:-0.0.1}" +GIT_TAG_VERSION=$(git describe --tags --abbrev=0) +ENVD_VERSION="${ENVD_VERSION:-$GIT_TAG_VERSION}" DOCKER_HUB_ORG="${DOCKER_HUB_ORG:-tensorchord}" PYTHON_VERSION="${PYTHON_VERSION:-3.9}" ENVD_OS="${ENVD_OS:-ubuntu20.04}" diff --git a/pkg/lang/ir/python.go b/pkg/lang/ir/python.go index b6b458bc6..d4710afc8 100644 --- a/pkg/lang/ir/python.go +++ b/pkg/lang/ir/python.go @@ -113,12 +113,13 @@ func (g Graph) compilePyPIPackages(root llb.State) llb.State { // Compose the package install command. var sb strings.Builder // Always use the conda's pip. - sb.WriteString("/opt/conda/bin/conda run -n envd pip install") + sb.WriteString("/opt/conda/envs/envd/bin/python -m pip install") for _, pkg := range g.PyPIPackages { sb.WriteString(fmt.Sprintf(" %s", pkg)) } cmd := sb.String() + logrus.Debugf("pip command: %s", cmd) root = llb.User("envd")(root) // Refer to https://github.com/moby/buildkit/blob/31054718bf775bf32d1376fe1f3611985f837584/frontend/dockerfile/dockerfile2llb/convert_runmount.go#L46 cache := root.File(llb.Mkdir("/cache",