From 7322e706d4f05f20d8100df3ab8074d293e4602a Mon Sep 17 00:00:00 2001 From: Nathaniel Saxe Date: Fri, 23 Aug 2024 21:46:36 -0400 Subject: [PATCH] fixes for github action --- cmd/project/functions.go | 11 ++++++----- cmd/project/project.go | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/project/functions.go b/cmd/project/functions.go index eeb6184..d8c387d 100644 --- a/cmd/project/functions.go +++ b/cmd/project/functions.go @@ -690,9 +690,10 @@ func buildEndpointConfig(projectFolder string, projectId string) (err error) { handlerPath := path.Join(remoteProjectPath, config.GetPath([]string{"runtime", "handler_path"}).(string)) pythonCmd := fmt.Sprintf("python -u %s", handlerPath) projectName := mustGetPathAs[string](config, "name") + endpointName := fmt.Sprintf("%s-endpoint-%s", projectName, projectId) templateConfig := map[string]any{ - "name": fmt.Sprintf("%s-endpoint-%s", projectName, projectId), - "image_name": mustGetPathAs[string](config, "project", "base_image"), //TODO: make it a parameter + "name": endpointName, + "image_name": endpointName, "env_vars": mustGetPathAs[*toml.Tree](config, "project", "env_vars").ToMap(), "container_disk_size_gb": mustGetPathAs[int64](config, "project", "container_disk_size_gb"), "volume_mount_path": mustGetPathAs[string](config, "project", "volume_mount_path"), @@ -798,10 +799,10 @@ func buildProjectDockerfile() (err error) { // base image: from toml dockerfile = strings.ReplaceAll(dockerfile, "<>", mustGetPathAs[string](config, "project", "base_image")) // pip requirements - dockerfile = strings.ReplaceAll(dockerfile, "<>", mustGetPathAs[string](config, "project", "requirements_path")) - dockerfile = strings.ReplaceAll(dockerfile, "<>", mustGetPathAs[string](config, "project", "python_version")) + dockerfile = strings.ReplaceAll(dockerfile, "<>", mustGetPathAs[string](config, "runtime", "requirements_path")) + dockerfile = strings.ReplaceAll(dockerfile, "<>", mustGetPathAs[string](config, "runtime", "python_version")) // cmd: start handler - dockerfile = strings.ReplaceAll(dockerfile, "<>", mustGetPathAs[string](config, "project", "handler_path")) + dockerfile = strings.ReplaceAll(dockerfile, "<>", mustGetPathAs[string](config, "runtime", "handler_path")) if includeEnvInDockerfile { dockerEnv := formatAsDockerEnv(createEnvVars(mustGetPathAs[*toml.Tree](config, "project", "env_vars"), mustGetPathAs[string](config, "project", "uuid"))) dockerfile = strings.ReplaceAll(dockerfile, "<>", "\n"+dockerEnv) diff --git a/cmd/project/project.go b/cmd/project/project.go index aebd343..fcab36a 100644 --- a/cmd/project/project.go +++ b/cmd/project/project.go @@ -359,7 +359,7 @@ var BuildProjectDockerfileCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { err := buildProjectDockerfile() if err != nil { - log.Fatalf("Error generating endpoint configuration: %v", err) + log.Fatalf("Error generating dockerfile: %v", err) return } },