Skip to content

Commit

Permalink
artf/make goimports (#4651)
Browse files Browse the repository at this point in the history
make goimports
Update minio address so artifacts can find s3 in sandbox.
make helm

Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor authored Dec 29, 2023
1 parent c06527e commit 7211dbb
Show file tree
Hide file tree
Showing 36 changed files with 138 additions and 83 deletions.
18 changes: 15 additions & 3 deletions charts/flyte-sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,21 @@ A Helm chart for the Flyte local sandbox
| flyte-binary.clusterResourceTemplates.inlineConfigMap | string | `"{{ include \"flyte-sandbox.clusterResourceTemplates.inlineConfigMap\" . }}"` | |
| flyte-binary.configuration.database.host | string | `"{{ printf \"%s-postgresql\" .Release.Name | trunc 63 | trimSuffix \"-\" }}"` | |
| flyte-binary.configuration.database.password | string | `"postgres"` | |
| flyte-binary.configuration.inline.artifacts.host | string | `"localhost"` | |
| flyte-binary.configuration.inline.artifacts.insecure | bool | `true` | |
| flyte-binary.configuration.inline.artifacts.port | int | `50051` | |
| flyte-binary.configuration.inline.artifactsProcessor.cloudProvider | string | `"Sandbox"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.stow.config.access_key_id | string | `"minio"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.stow.config.auth_type | string | `"accesskey"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.stow.config.disable_ssl | bool | `true` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.stow.config.endpoint | string | `"http://flyte-sandbox-minio.flyte:9000"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.stow.config.secret_key | string | `"miniostorage"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.stow.config.v2_signing | bool | `true` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.stow.kind | string | `"s3"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactBlobStoreConfig.type | string | `"stow"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactDatabaseConfig.postgres.dbname | string | `"artifacts"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactDatabaseConfig.postgres.host | string | `"{{ printf \"%s-postgresql\" .Release.Name | trunc 63 | trimSuffix \"-\" }}"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactDatabaseConfig.postgres.options | string | `"sslmode=disable"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactDatabaseConfig.postgres.password | string | `"postgres"` | |
| flyte-binary.configuration.inline.artifactsServer.artifactDatabaseConfig.postgres.port | int | `5432` | |
| flyte-binary.configuration.inline.artifactsServer.artifactDatabaseConfig.postgres.username | string | `"postgres"` | |
| flyte-binary.configuration.inline.cloudEvents.cloudEventVersion | string | `"v2"` | |
| flyte-binary.configuration.inline.cloudEvents.enable | bool | `true` | |
| flyte-binary.configuration.inline.cloudEvents.type | string | `"sandbox"` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/flyte-sandbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ flyte-binary:
config:
disable_ssl: true
v2_signing: true
endpoint: http://localhost:30002
endpoint: http://flyte-sandbox-minio.flyte:9000
auth_type: accesskey
access_key_id: minio
secret_key: miniostorage
Expand Down
8 changes: 4 additions & 4 deletions docker/sandbox-bundled/manifests/complete-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ data:
access_key_id: minio
auth_type: accesskey
disable_ssl: true
endpoint: http://localhost:30002
endpoint: http://flyte-sandbox-minio.flyte:9000
secret_key: miniostorage
v2_signing: true
kind: s3
Expand Down Expand Up @@ -878,7 +878,7 @@ type: Opaque
---
apiVersion: v1
data:
haSharedSecret: YnZWQm1tMm9ETTY3enZUcQ==
haSharedSecret: eTJZeFhSZWF0TEVQVWlybw==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -1308,7 +1308,7 @@ spec:
metadata:
annotations:
checksum/cluster-resource-templates: 6fd9b172465e3089fcc59f738b92b8dc4d8939360c19de8ee65f68b0e7422035
checksum/configuration: c3f03f3b03d7909e7fac95f3490d43d9e50cf4759a67ac38d4c1992f08f64ce3
checksum/configuration: 45373e78f147407fbee7ae52351e92542475be8fefff767255d1b3bdc48c3a0a
checksum/configuration-secret: 09216ffaa3d29e14f88b1f30af580d02a2a5e014de4d750b7f275cc07ed4e914
labels:
app.kubernetes.io/component: flyte-binary
Expand Down Expand Up @@ -1473,7 +1473,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: db210d75941d85245039373f167036040860dde6eb2db965c9a482e496483240
checksum/secret: 101b0e951be7ace5815290755725d39275a0f550892b354b9cfa129e0a750f0f
labels:
app: docker-registry
release: flyte-sandbox
Expand Down
8 changes: 4 additions & 4 deletions docker/sandbox-bundled/manifests/complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ data:
access_key_id: minio
auth_type: accesskey
disable_ssl: true
endpoint: http://localhost:30002
endpoint: http://flyte-sandbox-minio.flyte:9000
secret_key: miniostorage
v2_signing: true
kind: s3
Expand Down Expand Up @@ -858,7 +858,7 @@ type: Opaque
---
apiVersion: v1
data:
haSharedSecret: RTRFWEhLQ1c3V3h5N1JpQg==
haSharedSecret: bkVuc0pmTEgwZEp0QUVSbQ==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -1256,7 +1256,7 @@ spec:
metadata:
annotations:
checksum/cluster-resource-templates: 6fd9b172465e3089fcc59f738b92b8dc4d8939360c19de8ee65f68b0e7422035
checksum/configuration: 3e7625f0de3a210017c0f2ab5b8ad17a9ccac048a5a06f6466b8d762d8aa27d7
checksum/configuration: 9502021d87030cfe424e840eee4c26900579d180008686827db9d9ef3f723a5b
checksum/configuration-secret: 09216ffaa3d29e14f88b1f30af580d02a2a5e014de4d750b7f275cc07ed4e914
labels:
app.kubernetes.io/component: flyte-binary
Expand Down Expand Up @@ -1421,7 +1421,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: 266445a61b2ef5d294e608c36659f8c3c6605c1b718d73870eb7e0584783504a
checksum/secret: 63b35e1a77beeb576299ff75680ecfdebf9034eab5c85af9b0c24646b1e3007c
labels:
app: docker-registry
release: flyte-sandbox
Expand Down
4 changes: 2 additions & 2 deletions docker/sandbox-bundled/manifests/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ metadata:
---
apiVersion: v1
data:
haSharedSecret: YVdudG42ZklJTWZGTmpUZw==
haSharedSecret: NDV4Z0JTUVAwRnlCYUFPWQ==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -981,7 +981,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: 460f5a9ea128429763eb9a5cc9e25c1cd84e1a2a5f032853085c8061f0e20da4
checksum/secret: 17dd6127a719e8f5716b5cbddc9f2c3ccb88560fca3dc5cad286376afc6271c0
labels:
app: docker-registry
release: flyte-sandbox
Expand Down
2 changes: 1 addition & 1 deletion flyteartifacts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../boilerplate/flyte/golang_test_targets/Makefile
include boilerplate/flyte/golang_test_targets/Makefile

.PHONY: linux_compile
linux_compile: export CGO_ENABLED ?= 0
Expand Down
4 changes: 2 additions & 2 deletions flyteartifacts/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import (
"context"
_ "net/http/pprof" // Required to serve application.

sharedCmd "github.com/flyteorg/flyte/flyteartifacts/cmd/shared"
"github.com/flyteorg/flyte/flyteartifacts/pkg/server"
"github.com/flyteorg/flyte/flytestdlib/contextutils"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
"github.com/flyteorg/flyte/flytestdlib/storage"

_ "net/http/pprof" // Required to serve application.
)

func main() {
Expand Down
4 changes: 3 additions & 1 deletion flyteartifacts/cmd/shared/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package shared

import (
"context"
"github.com/flyteorg/flyte/flytestdlib/database"

"github.com/go-gormigrate/gormigrate/v2"
"github.com/spf13/cobra"

"github.com/flyteorg/flyte/flytestdlib/database"
)

// NewMigrateCmd represents the migrate command
Expand Down
8 changes: 5 additions & 3 deletions flyteartifacts/cmd/shared/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import (
"context"
"flag"
"fmt"
"os"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/flyteorg/flyte/flyteartifacts/pkg/configuration"
"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/profutils"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"os"
)

var (
Expand Down
9 changes: 5 additions & 4 deletions flyteartifacts/cmd/shared/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ package shared

import (
"context"
"google.golang.org/grpc/reflection"
"net"
"net/http"

sharedCfg "github.com/flyteorg/flyte/flyteartifacts/pkg/configuration/shared"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
grpcMiddleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
Expand All @@ -18,6 +14,11 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/reflection"

sharedCfg "github.com/flyteorg/flyte/flyteartifacts/pkg/configuration/shared"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
)

func NewServeCmd(commandName string, serverCfg sharedCfg.ServerConfiguration, grpcHook GrpcRegistrationHook, httpHook HttpRegistrationHook) *cobra.Command {
Expand Down
4 changes: 3 additions & 1 deletion flyteartifacts/cmd/shared/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package shared

import (
"context"
"github.com/flyteorg/flyte/flytestdlib/promutils"

"github.com/grpc-ecosystem/grpc-gateway/runtime"
"google.golang.org/grpc"

"github.com/flyteorg/flyte/flytestdlib/promutils"
)

type GrpcRegistrationHook func(ctx context.Context, server *grpc.Server, scope promutils.Scope) error
Expand Down
4 changes: 3 additions & 1 deletion flyteartifacts/pkg/blob/artifact_blob_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package blob
import (
"context"
"fmt"

"github.com/golang/protobuf/ptypes/any"

"github.com/flyteorg/flyte/flyteartifacts/pkg/configuration"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/storage"
"github.com/golang/protobuf/ptypes/any"
)

type ArtifactBlobStore struct {
Expand Down
4 changes: 2 additions & 2 deletions flyteartifacts/pkg/configuration/config.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package configuration

import (
"time"

"github.com/flyteorg/flyte/flyteartifacts/pkg/configuration/shared"
"github.com/flyteorg/flyte/flytestdlib/config"
stdLibDb "github.com/flyteorg/flyte/flytestdlib/database"
stdLibStorage "github.com/flyteorg/flyte/flytestdlib/storage"

"time"
)

const artifactsServer = "artifactsServer"
Expand Down
1 change: 1 addition & 0 deletions flyteartifacts/pkg/configuration/shared/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package shared

import (
"fmt"

"github.com/flyteorg/flyte/flytestdlib/config"
)

Expand Down
8 changes: 5 additions & 3 deletions flyteartifacts/pkg/db/gorm_transformers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package db
import (
"context"
"fmt"

"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/jackc/pgx/v5/pgtype"

"github.com/flyteorg/flyte/flyteartifacts/pkg/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/artifact"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/jackc/pgx/v5/pgtype"
)

func PartitionsIdlToHstore(idlPartitions *core.Partitions) pgtype.Hstore {
Expand Down
11 changes: 6 additions & 5 deletions flyteartifacts/pkg/db/querying_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ import (
"context"
"database/sql"
"fmt"
"testing"

"github.com/DATA-DOG/go-sqlmock"
"github.com/stretchr/testify/assert"
"gorm.io/driver/postgres"
"gorm.io/gorm"

"github.com/flyteorg/flyte/flyteartifacts/pkg/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/artifact"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytestdlib/database"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/stretchr/testify/assert"
"testing"

"gorm.io/driver/postgres"
"gorm.io/gorm"
)

func getMockRds(t *testing.T) (*sql.DB, sqlmock.Sqlmock, RDSStorage) {
Expand Down
10 changes: 6 additions & 4 deletions flyteartifacts/pkg/db/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import (
"context"
"errors"
"fmt"
"strconv"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"gorm.io/gorm"

"github.com/flyteorg/flyte/flyteartifacts/pkg/configuration"
"github.com/flyteorg/flyte/flyteartifacts/pkg/lib"
"github.com/flyteorg/flyte/flyteartifacts/pkg/models"
Expand All @@ -12,10 +18,6 @@ import (
"github.com/flyteorg/flyte/flytestdlib/database"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"gorm.io/gorm"
"strconv"
)

// RDSStorage should implement StorageInterface
Expand Down
10 changes: 5 additions & 5 deletions flyteartifacts/pkg/db/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ package db
import (
"context"
"fmt"
"github.com/flyteorg/flyte/flyteartifacts/pkg/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/artifact"
"os"
"testing"

"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteartifacts/pkg/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/artifact"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/promutils"
)

func TestBasicWrite(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion flyteartifacts/pkg/lib/string_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package lib

import (
"fmt"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"strings"
"time"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
)

const DateFormat string = "2006-01-02"
Expand Down
8 changes: 5 additions & 3 deletions flyteartifacts/pkg/lib/string_converter_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package lib

import (
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/stretchr/testify/assert"
"testing"
"time"

"github.com/golang/protobuf/ptypes/timestamp"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
)

func TestRenderDate(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions flyteartifacts/pkg/lib/url_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package lib

import (
"errors"
"github.com/flyteorg/flyte/flyteartifacts/pkg/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"net/url"
"regexp"
"strings"

"github.com/flyteorg/flyte/flyteartifacts/pkg/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
)

var flyteURLNameRe = regexp.MustCompile(`(?P<name>[\w/-]+)(?:(:(?P<tag>\w+))?)(?:(@(?P<version>\w+))?)`)
Expand Down
Loading

0 comments on commit 7211dbb

Please sign in to comment.