Skip to content

Commit

Permalink
Remove code to parse env vars into kaniko arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Oct 20, 2024
1 parent 4400f7b commit 6e94c22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
7 changes: 6 additions & 1 deletion api/turing/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,12 @@ type MLPConfig struct {
}

type MlflowConfig struct {
TrackingURL string `validate:"required_if=ArtifactServiceType gcs ArtifactServiceType s3"`
TrackingURL string `validate:"required_if=ArtifactServiceType gcs ArtifactServiceType s3"`
// Note that the Kaniko image builder needs to be configured correctly to have the necessary credentials to download
// the artifacts from the blob storage tool depending on the artifact service type selected (gcs/s3). For gcs, the
// credentials can be provided via a k8s service account or a secret but for s3, the credentials can be provided via
// additional arguments in the config KanikoAdditionalArgs e.g.
// --build-arg=[AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_DEFAULT_REGION/AWS_ENDPOINT_URL]=xxx
ArtifactServiceType string `validate:"required,oneof=nop gcs s3"`
}

Expand Down
11 changes: 0 additions & 11 deletions api/turing/imagebuilder/imagebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net/http"
"os"
"sort"
"strings"
"time"
Expand Down Expand Up @@ -298,16 +297,6 @@ func (ib *imageBuilder) createKanikoJob(
"--single-snapshot",
}

if ib.artifactServiceType == "s3" {
kanikoArgs = append(
kanikoArgs,
fmt.Sprintf("--build-arg=%s=%s", "AWS_ACCESS_KEY_ID", os.Getenv("AWS_ACCESS_KEY_ID")),
fmt.Sprintf("--build-arg=%s=%s", "AWS_SECRET_ACCESS_KEY", os.Getenv("AWS_SECRET_ACCESS_KEY")),
fmt.Sprintf("--build-arg=%s=%s", "AWS_DEFAULT_REGION", os.Getenv("AWS_DEFAULT_REGION")),
fmt.Sprintf("--build-arg=%s=%s", "AWS_ENDPOINT_URL", os.Getenv("AWS_ENDPOINT_URL")),
)
}

annotations := make(map[string]string)
if !ib.imageBuildingConfig.SafeToEvict {
// The image-building jobs are timing out. We found that one of the root causes is the node pool got scaled down
Expand Down

0 comments on commit 6e94c22

Please sign in to comment.