Skip to content

Commit

Permalink
feat: Enable build for all languages (#738)
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege authored Aug 9, 2022
1 parent 7d405c1 commit dd609da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion base-images/remote-cache/build-and-push-remote-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ENVD_VERSION="${ENVD_VERSION:-$GIT_TAG_VERSION}"

cd ${ROOT_DIR}

envd build --export-cache type=registry,ref=docker.io/tensorchord/python-cache:3.9-envd-v${ENVD_VERSION} --force
envd build --export-cache type=registry,ref=docker.io/tensorchord/python-cache:envd-v${ENVD_VERSION} --force

cd - > /dev/null
22 changes: 5 additions & 17 deletions pkg/lang/ir/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,11 @@ func (g Graph) ExposedPorts() (map[string]struct{}, error) {
}

func (g Graph) DefaultCacheImporter() (*string, error) {
switch g.Language.Name {
case "python":
v, err := g.getAppropriatePythonVersion()
if err != nil {
return nil, errors.Wrap(err, "failed to get python version")
}
// We only support remote cache for 3.9 currently.
if v == "3.9" {
res := fmt.Sprintf(
"type=registry,ref=docker.io/tensorchord/python-cache:%s-envd-%s",
v, version.GetGitTagFromVersion())
return &res, nil
}
return nil, nil
default:
return nil, nil
}
// The base remote cache should work for all languages.
res := fmt.Sprintf(
"type=registry,ref=docker.io/tensorchord/python-cache:envd-%s",
version.GetGitTagFromVersion())
return &res, nil
}

func (g Graph) Entrypoint(buildContextDir string) ([]string, error) {
Expand Down

0 comments on commit dd609da

Please sign in to comment.