Skip to content

Commit

Permalink
Create flyteadmin client
Browse files Browse the repository at this point in the history
Signed-off-by: Hongxin Liang <[email protected]>
  • Loading branch information
honnix committed Sep 27, 2023
1 parent e81d44b commit 0290a5b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ public abstract class ExecutionConfig {

public abstract String version();

public abstract String platformUrl();

public abstract boolean platformInsecure();

public static ExecutionConfig load() {
return ExecutionConfig.builder()
.project(getenv("FLYTE_INTERNAL_PROJECT"))
.domain(getenv("FLYTE_INTERNAL_DOMAIN"))
.version(getenv("FLYTE_INTERNAL_VERSION"))
.image(getenv("FLYTE_INTERNAL_IMAGE"))
.platformUrl(getenv("FLYTE_PLATFORM_URL"))
.platformInsecure(Boolean.parseBoolean(getenv("FLYTE_PLATFORM_INSECURE")))
.build();
}

Expand All @@ -55,6 +61,10 @@ public abstract static class Builder {

public abstract Builder image(String image);

public abstract Builder platformUrl(String platformUrl);

public abstract Builder platformInsecure(boolean platformInsecure);

public abstract ExecutionConfig build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.flyte.jflyte.utils.Config;
import org.flyte.jflyte.utils.ExecutionConfig;
import org.flyte.jflyte.utils.FileSystemLoader;
import org.flyte.jflyte.utils.FlyteAdminClient;
import org.flyte.jflyte.utils.IdentifierRewrite;
import org.flyte.jflyte.utils.JFlyteCustom;
import org.flyte.jflyte.utils.PackageLoader;
Expand Down Expand Up @@ -206,6 +207,8 @@ static DynamicJobSpec rewrite(
.domain(config.domain())
.project(config.project())
.version(config.version())
.adminClient(
FlyteAdminClient.create(config.platformUrl(), config.platformInsecure(), null))
.build()
.visitor();

Expand Down

0 comments on commit 0290a5b

Please sign in to comment.