Re: Operator ReadFile API

2018-05-06 Thread Pascal Gillet
 Ok, thank you very much. I will give it a try.
Pascal GILLET
Le dimanche 6 mai 2018 à 01:19:36 UTC+2, Benjamin Mahler 
 a écrit :  
 
 Yes, it's base64 encoded.
The protobuf schema defines this field of type 
"bytes":https://github.com/apache/mesos/blob/1.5.0/include/mesos/v1/agent/agent.proto#L460
When converted to JSON, this follows the standard protobuf -> JSON conversion 
by converting "bytes" fields into base64 encoded strings:
https://developers.google.com/protocol-buffers/docs/proto3#json
Ben
On Sat, May 5, 2018 at 3:42 AM Pascal Gillet  wrote:

Hi All,
I try to read the stderr/stdout files from the Mesos sandbox with the READ_FILE 
call in the Operator HTTP API.

I get a well-formatted json response as follows:

{
   'type': 'READ_FILE',
   'read_file': {
      'data': 'SDFtyfytgh4TR67RFY8',
      'size': 19
   }
} 

But I'm just getting a sequence of letters and numbers that has nothing to do 
with the file contents. 

Is the returned data encoded or compressed?

Thanks,
Pascal GILLET


  

Re: Operator ReadFile API

2018-05-05 Thread Benjamin Mahler
Yes, it's base64 encoded.

The protobuf schema defines this field of type "bytes":
https://github.com/apache/mesos/blob/1.5.0/include/mesos/v1/agent/agent.proto#L460

When converted to JSON, this follows the standard protobuf -> JSON
conversion by converting "bytes" fields into base64 encoded strings:

https://developers.google.com/protocol-buffers/docs/proto3#json

Ben

On Sat, May 5, 2018 at 3:42 AM Pascal Gillet  wrote:

> Hi All,
>
> I try to read the stderr/stdout files from the Mesos sandbox with the
> READ_FILE call in the Operator HTTP API.
>
> I get a well-formatted json response as follows:
>
> {
>'type': 'READ_FILE',
>'read_file': {
>   'data': 'SDFtyfytgh4TR67RFY8',
>   'size': 19
>}
> }
>
> But I'm just getting a sequence of letters and numbers that has nothing to
> do with the file contents.
>
> Is the returned data encoded or compressed?
>
> Thanks,
>
> Pascal GILLET
>
>


Re: Operator ReadFile API

2018-05-05 Thread Andrei Budnik
Hi Pascal,

>Is the returned data encoded or compressed?
The returned data is not modified.

Can you please give an example of the code which calls `READ_FILE`?

Is there "Processing READ_FILE call for path" message in the agent logs?
What is the file's size?



Regards,
Andrei Budnik

On Sat, May 5, 2018 at 12:42 PM, Pascal Gillet 
wrote:

> Hi All,
>
> I try to read the stderr/stdout files from the Mesos sandbox with the
> READ_FILE call in the Operator HTTP API.
>
> I get a well-formatted json response as follows:
>
> {
>'type': 'READ_FILE',
>'read_file': {
>   'data': 'SDFtyfytgh4TR67RFY8',
>   'size': 19
>}
> }
>
> But I'm just getting a sequence of letters and numbers that has nothing to
> do with the file contents.
>
> Is the returned data encoded or compressed?
>
> Thanks,
>
> Pascal GILLET
>
>


Operator ReadFile API

2018-05-05 Thread Pascal Gillet
Hi All,
I try to read the stderr/stdout files from the Mesos sandbox with the READ_FILE 
call in the Operator HTTP API.

I get a well-formatted json response as follows:

{
   'type': 'READ_FILE',
   'read_file': {
      'data': 'SDFtyfytgh4TR67RFY8',
      'size': 19
   }
} 

But I'm just getting a sequence of letters and numbers that has nothing to do 
with the file contents. 

Is the returned data encoded or compressed?

Thanks,
Pascal GILLET