OpenTracing for Fission (#1079)
Added Opentracing integration using opencensus libraries for all Fission components.
This commit is contained in:
+5
-3
@@ -18,6 +18,7 @@ package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
@@ -533,10 +534,11 @@ func createArchive(client *client.Client, includeFiles []string, noZip bool, spe
|
||||
|
||||
archivePath := makeArchiveFileIfNeeded("", includeFiles, noZip)
|
||||
|
||||
return uploadArchive(client, archivePath)
|
||||
ctx := context.Background()
|
||||
return uploadArchive(ctx, client, archivePath)
|
||||
}
|
||||
|
||||
func uploadArchive(client *client.Client, fileName string) *fission.Archive {
|
||||
func uploadArchive(ctx context.Context, client *client.Client, fileName string) *fission.Archive {
|
||||
var archive fission.Archive
|
||||
|
||||
// If filename is a URL, download it first
|
||||
@@ -552,7 +554,7 @@ func uploadArchive(client *client.Client, fileName string) *fission.Archive {
|
||||
ssClient := storageSvcClient.MakeClient(u)
|
||||
|
||||
// TODO add a progress bar
|
||||
id, err := ssClient.Upload(fileName, nil)
|
||||
id, err := ssClient.Upload(ctx, fileName, nil)
|
||||
util.CheckErr(err, fmt.Sprintf("upload file %v", fileName))
|
||||
|
||||
storageSvc, err := client.GetSvcURL("application=fission-storage")
|
||||
|
||||
+2
-1
@@ -858,7 +858,8 @@ func applyArchives(fclient *client.Client, specDir string, fr *FissionResources)
|
||||
// doesn't exist, upload
|
||||
fmt.Printf("uploading archive %v\n", name)
|
||||
// ar.URL is actually a local filename at this stage
|
||||
uploadedAr := uploadArchive(fclient, ar.URL)
|
||||
ctx := context.Background()
|
||||
uploadedAr := uploadArchive(ctx, fclient, ar.URL)
|
||||
archiveFiles[name] = *uploadedAr
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -293,7 +294,8 @@ func upgradeRestoreState(c *cli.Context) error {
|
||||
tmpfile.Close()
|
||||
|
||||
// upload
|
||||
archive := uploadArchive(client, tmpfile.Name())
|
||||
ctx := context.Background()
|
||||
archive := uploadArchive(ctx, client, tmpfile.Name())
|
||||
os.Remove(tmpfile.Name())
|
||||
|
||||
// create pkg
|
||||
|
||||
Reference in New Issue
Block a user