Skip to content

Commit b3fd189

Browse files
[artifact tracker] Poll HTTP location for manifest (#1538)
Summary: Use an HTTP url to poll for artifact manifests in the artifact tracker server. By default the manifest is polled from github pages. Type of change: /kind cleanup Test Plan: Tested that when github pages is updated a skaffold deploy of this PR sees the manifest update, and can download the latest release. Signed-off-by: James Bartlett <jamesbartlett@pixielabs.ai>
1 parent 898e27f commit b3fd189

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

k8s/cloud/base/artifact_config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ kind: ConfigMap
44
metadata:
55
name: pl-artifact-config
66
data:
7-
PL_ARTIFACT_BUCKET: pixie-dev-public
8-
PL_ARTIFACT_MANIFEST_BUCKET: pixie-dev-public
7+
PL_ARTIFACT_MANIFEST_URL: https://artifacts.px.dev/artifacts/manifest.json
98
PL_SA_KEY_PATH: /creds/service_account.json

src/cloud/artifact_tracker/artifact_tracker_server.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ func init() {
4949
pflag.String("vizier_version", "", "If specified, the db will not be queried. The only vizier version is assumed to be the one specified.")
5050
pflag.String("cli_version", "", "If specified, the db will not be queried. The only CLI version is assumed to be the one specified.")
5151
pflag.String("operator_version", "", "If specified, the db will not be queried. The only operator version is assumed to be the one specified.")
52-
pflag.String("artifact_manifest_bucket", "pixie-dev-public", "The name of the bucket containing the artifact manifest")
53-
pflag.String("artifact_manifest_path", "manifest.json", "Path within the artifact bucket to the manifest.json")
52+
pflag.String("artifact_manifest_url", "", "The url to the artifact manifest")
53+
pflag.String("artifact_manifest_sha_url", "", "The url to the sha of the artifact manifest, "+
54+
"if not set the server will use the manifest url with '.sha256' appended.")
5455
pflag.Duration("manifest_poll_period", 1*time.Minute, "Specify how often to poll for manifest changes")
5556
}
5657

@@ -102,11 +103,14 @@ func main() {
102103

103104
// If any versions are not hardcoded, then we need to poll for the artifact manifest.
104105
if (viper.GetString("vizier_version") == "") || (viper.GetString("cli_version") == "") || (viper.GetString("operator_version") == "") {
105-
manifestBucket := viper.GetString("artifact_manifest_bucket")
106-
manifestPath := viper.GetString("artifact_manifest_path")
106+
manifestURL := viper.GetString("artifact_manifest_url")
107+
shaURL := viper.GetString("artifact_manifest_sha_url")
108+
if shaURL == "" {
109+
shaURL = manifestURL + ".sha256"
110+
}
107111
pollPeriod := viper.GetDuration("manifest_poll_period")
108-
gcsManifest := manifest.NewGCSLocation(client, manifestBucket, manifestPath)
109-
poller := manifest.NewPoller(gcsManifest, pollPeriod, svr.UpdateManifest)
112+
httpManifest := manifest.NewHTTPLocation(shaURL, manifestURL)
113+
poller := manifest.NewPoller(httpManifest, pollPeriod, svr.UpdateManifest)
110114
start := time.Now()
111115
if err := poller.Start(); err != nil {
112116
log.WithError(err).Fatal("failed to start manifest poller")

0 commit comments

Comments
 (0)