Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Backport 1.7 to 1.2 #420

Merged
merged 24 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b7c6bec
Adding support for structured dataset (#369)
pmahindrakar-oss Feb 22, 2023
71836cc
added dynamic_job_spec_uri to dynamic workflow metadata and node exec…
hamersaw Mar 3, 2023
5af6464
Use TokenCache in ClientCredentialsTokenSourceProvider (#377)
andrewwdye Mar 7, 2023
d059a27
Init customTokenSource.refreshTime (#381)
andrewwdye Mar 10, 2023
73e49e3
added DataLoadingConfig to K8sPod message (#368)
hamersaw Mar 13, 2023
018aa0d
Add Reasons field to TaskExecutionClosure to track time-series of rea…
hamersaw Mar 21, 2023
3edc059
Create service for runtime metrics (#367)
hamersaw Mar 21, 2023
234627c
Remove misleading token refresh logic from client credentials token s…
andrewwdye Mar 28, 2023
f8e622e
Out of core plugin (#378)
pingsutw Mar 31, 2023
44cbad6
Feat: Add `ElasticConfig` message type for torch elastic training (#394)
fg91 Apr 24, 2023
a1fbb23
Retract 1.4.x (#397)
eapolinario May 1, 2023
5a2e346
Data addresses #minor (#391)
wild-endeavor May 2, 2023
e584dd9
Refactor kf-operator plugins configs and support setting different sp…
yubofredwang May 4, 2023
2ceb09e
add user_identifier (#388)
ByronHsu May 6, 2023
49bd1f0
Add envs to execution spec (#400)
pingsutw May 9, 2023
ba1102d
Support union and none type in flyteidl (#401)
yubofredwang May 9, 2023
7d2508f
Rename user_identity to execution_identity (#402)
ByronHsu May 10, 2023
ee1a8b7
Single literal in GetDataResponse (#404)
wild-endeavor May 18, 2023
76ae152
Add namespace to execution system metadata (#406)
katrogan May 22, 2023
e9fe585
Add oauth2 http proxy client (#405)
ByronHsu May 24, 2023
7d63ef4
Rename externalPluginService to AgentService (#410)
pingsutw May 30, 2023
e3ed27b
Add external_plugin_service proto back to the idl (#413)
pingsutw Jun 2, 2023
0293e86
Rerun make generate
eapolinario Jun 27, 2023
c6d8dc6
Merge release-v1.2 and regenerate stubs
eapolinario Jun 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions clients/go/admin/auth_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package admin
import (
"context"
"fmt"
"net/http"

"github.com/flyteorg/flyteidl/clients/go/admin/cache"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flytestdlib/logger"
"golang.org/x/oauth2"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -50,6 +52,21 @@ func shouldAttemptToAuthenticate(errorCode codes.Code) bool {
return errorCode == codes.Unauthenticated
}

// Set up http client used in oauth2
func setHTTPClientContext(ctx context.Context, cfg *Config) context.Context {
httpClient := &http.Client{}

if len(cfg.HTTPProxyURL.String()) > 0 {
// create a transport that uses the proxy
transport := &http.Transport{
Proxy: http.ProxyURL(&cfg.HTTPProxyURL.URL),
}
httpClient.Transport = transport
}

return context.WithValue(ctx, oauth2.HTTPClient, httpClient)
}

// NewAuthInterceptor creates a new grpc.UnaryClientInterceptor that forwards the grpc call and inspects the error.
// It will first invoke the grpc pipeline (to proceed with the request) with no modifications. It's expected for the grpc
// pipeline to already have a grpc.WithPerRPCCredentials() DialOption. If the perRPCCredentials has already been initialized,
Expand All @@ -62,6 +79,8 @@ func shouldAttemptToAuthenticate(errorCode codes.Code) bool {
// be able to find and acquire a valid AccessToken to annotate the request with.
func NewAuthInterceptor(cfg *Config, tokenCache cache.TokenCache, credentialsFuture *PerRPCCredentialsFuture) grpc.UnaryClientInterceptor {
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
ctx = setHTTPClientContext(ctx, cfg)

err := invoker(ctx, method, req, reply, cc, opts...)
if err != nil {
logger.Debugf(ctx, "Request failed due to [%v]. If it's an unauthenticated error, we will attempt to establish an authenticated context.", err)
Expand Down
3 changes: 3 additions & 0 deletions clients/go/admin/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ type Config struct {
// find the full schema here https://github.com/grpc/grpc-proto/blob/master/grpc/service_config/service_config.proto#L625
// Note that required packages may need to be preloaded to support certain service config. For example "google.golang.org/grpc/balancer/roundrobin" should be preloaded to have round-robin policy supported.
DefaultServiceConfig string `json:"defaultServiceConfig" pdflag:",Set the default service config for the admin gRPC client"`

// HTTPProxyURL allows operators to access external OAuth2 servers using an external HTTP Proxy
HTTPProxyURL config.URL `json:"httpProxyURL" pflag:",OPTIONAL: HTTP Proxy to be used for OAuth requests."`
}

var (
Expand Down
1 change: 1 addition & 0 deletions clients/go/admin/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions clients/go/admin/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

162 changes: 162 additions & 0 deletions clients/go/admin/mocks/AgentServiceClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

139 changes: 139 additions & 0 deletions clients/go/admin/mocks/AgentServiceServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading