Skip to content

Commit

Permalink
Configurable default replay cache path for remote ssh devices (#2414)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qining authored Dec 3, 2018
1 parent 88118b0 commit 44f4437
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/os/device/remotessh/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type Device interface {
MakeTempDir(ctx context.Context) (string, func(ctx context.Context), error)
// WriteFile writes the given file into the given location on the remote device
WriteFile(ctx context.Context, contents io.Reader, mode os.FileMode, destPath string) error
// DefaultReplayCacheDir returns the default path for replay resource caches
DefaultReplayCacheDir() string
}

// MaxNumberOfSSHConnections defines the max number of ssh connections to each
Expand Down Expand Up @@ -279,3 +281,8 @@ func GetConnectedDevice(ctx context.Context, c Configuration) (Device, error) {

return b, nil
}

// DefaultReplayCacheDir implements Device interface
func (b *binding) DefaultReplayCacheDir() string {
return ""
}
4 changes: 4 additions & 0 deletions gapir/client/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func (s *session) newRemote(ctx context.Context, d remotessh.Device, abi *device
args = append(args, launchArgs...)
if forceEnableDiskCache {
args = append(args, "--enable-disk-cache")
if len(d.DefaultReplayCacheDir()) > 0 {
args = append(args, "--disk-cache-path", d.DefaultReplayCacheDir())
}
args = append(args, "--cleanup-on-disk-cache")
}

gapir, err := layout.Gapir(ctx, abi)
Expand Down

0 comments on commit 44f4437

Please sign in to comment.