-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a38806c
commit 41143e8
Showing
10 changed files
with
49 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package pkg | ||
package v1alpha1 | ||
|
||
import ( | ||
"os" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package v1alpha2 | ||
|
||
import ( | ||
"os" | ||
|
||
experimentsv1alpha2 "github.com/kubeflow/katib/pkg/api/operators/apis/experiment/v1alpha2" | ||
) | ||
|
||
const ( | ||
KatibManagerServiceIPEnvName = "KATIB_MANAGER_PORT_6789_TCP_ADDR" | ||
KatibManagerServicePortEnvName = "KATIB_MANAGER_PORT_6789_TCP_PORT" | ||
KatibManagerServiceNamespaceEnvName = "KATIB_MANAGER_NAMESPACE" | ||
KatibManagerService = "katib-manager" | ||
KatibManagerPort = "6789" | ||
ManagerAddr = KatibManagerService + ":" + KatibManagerPort | ||
) | ||
|
||
func GetManagerAddr() string { | ||
ns := os.Getenv(experimentsv1alpha2.DefaultKatibNamespaceEnvName) | ||
if len(ns) == 0 { | ||
addr := os.Getenv(KatibManagerServiceIPEnvName) | ||
port := os.Getenv(KatibManagerServicePortEnvName) | ||
if len(addr) > 0 && len(port) > 0 { | ||
return addr + ":" + port | ||
} else { | ||
return ManagerAddr | ||
} | ||
} else { | ||
return KatibManagerService + "." + ns + ":" + KatibManagerPort | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters