X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/424181391748ec018b6157574dd65e5306d19f5d..f00c2849c5cdbe179d61bcaa1374d355844c2fae:/services/crunch-run/crunchrun.go diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go index 9eee309f48..7da1beb20a 100644 --- a/services/crunch-run/crunchrun.go +++ b/services/crunch-run/crunchrun.go @@ -40,18 +40,6 @@ type IKeepClient interface { ManifestFileReader(m manifest.Manifest, filename string) (keepclient.ReadCloserWithLen, error) } -// Collection record returned by the API server. -type CollectionRecord struct { - ManifestText string `json:"manifest_text"` - PortableDataHash string `json:"portable_data_hash"` -} - -// APIClientAuthorization is an arvados#api_client_authorization resource. -type APIClientAuthorization struct { - UUID string `json:"uuid"` - APIToken string `json:"api_token"` -} - // NewLogWriter is a factory function to create a new log writer. type NewLogWriter func(name string) io.WriteCloser @@ -134,7 +122,7 @@ func (runner *ContainerRunner) LoadImage() (err error) { runner.CrunchLog.Printf("Fetching Docker image from collection '%s'", runner.Container.ContainerImage) - var collection CollectionRecord + var collection arvados.Collection err = runner.ArvClient.Get("collections", runner.Container.ContainerImage, nil, &collection) if err != nil { return fmt.Errorf("While getting container image collection: %v", err) @@ -533,7 +521,7 @@ func (runner *ContainerRunner) CaptureOutput() error { } defer file.Close() - rec := CollectionRecord{} + var rec arvados.Collection err = json.NewDecoder(file).Decode(&rec) if err != nil { return fmt.Errorf("While reading FUSE metafile: %v", err) @@ -541,7 +529,7 @@ func (runner *ContainerRunner) CaptureOutput() error { manifestText = rec.ManifestText } - var response CollectionRecord + var response arvados.Collection err = runner.ArvClient.Create("collections", arvadosclient.Dict{ "collection": arvadosclient.Dict{ @@ -605,7 +593,7 @@ func (runner *ContainerRunner) CommitLogs() error { return fmt.Errorf("While creating log manifest: %v", err) } - var response CollectionRecord + var response arvados.Collection err = runner.ArvClient.Create("collections", arvadosclient.Dict{ "collection": arvadosclient.Dict{ @@ -639,7 +627,7 @@ func (runner *ContainerRunner) ContainerToken() (string, error) { return runner.token, nil } - var auth APIClientAuthorization + var auth arvados.APIClientAuthorization err := runner.ArvClient.Call("GET", "containers", runner.Container.UUID, "auth", nil, &auth) if err != nil { return "", err