GithubHelp home page GithubHelp logo

algorithmia-rust's People

Contributors

anowell avatar bytekast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

anowell

algorithmia-rust's Issues

DataFile should have .put_file() method like DataDir.

The current rust client has a useful .put_file() for the DataDir:

client.dir(some_remote_dir).put_file(some_local_file);

Which is super useful! however, when you have a particular remote filename that's different from the local file name, this the method isn't implemented:

client.file(some_remote_filename).put_file(some_local_file);

I propose that DataFile should have this method exposed to make rust life less painful!

Codex - rust client calling wrong api endpoint

when trying to download a file on a codex installation, I discovered that it was throwing the following exception:

couldn't download file from url: data://zeryx/binaries/ffmpeg-static.tar.gz 
401 Unauthorized

when talking with @pmcq it was discovered that on the api logs it was reported as:

 {"start_date":"2016-11-03T21:22:11.578Z","start_time":1478208131578,"end_time":1478208131581,"method":"GET","uri":"//v1/data/zeryx/bin/ffmpeg-static.tar.gz","status_code":401,"request_time":3,"ip":"156.34.17.89","user_agent":"algorithmia-rust/1.3.0 (Rust unknown","auth_user":"zeryx"}

2016-11-03T21:10:03.987 [application-akka.actor.default-dispatcher-48982] INFO  application : data_v0 GET error, no auth - path: zeryx/binaries/ffmpeg-static.tar.gz error: Authorizat
ionRequired(missing auth) request_headers: ArrayBuffer((User-Agent,algorithmia-rust/1.3.0 (Rust unknown), (Authorization,Simple <snip>), (Host,api.codexonazure.
com))

it looks like it's trying to call the data_v0 endpoint which is invalid on codex, breaking the rust client for all codex installations.

file get operation intermittently hangs forever

When downloading a file using the client.file(..).get();... io::copy(..) operation, it occasionally fails to complete downloading the file in what seems like a broken pipe failure mode.

The output from .get() is a DataFile, which looks like a stream object, and the .get() is supposed to return a Result<DataFile>, however, no exception is ever thrown when said suspected broken pipe occurs, instead it hangs for indefinitely while keeping the httpClient connection open until manually killed.

https://gist.github.com/zeryx/3cdbe5c8b0d3da30041a1b0348f4cb83

note: The error is intermittent, and won't occur on every run; it seems to have a causal relationship with cpu load, which might hint towards the underlying cause.

There might be a more refined minimal way of defining a reproducible output, but I haven't reached that yet.
As you can see, the bizarre workaround is to split the client.file(..).get() operation into a two line client.file() and file.get().

The only hypothetical cause is a bug in the underlying http-client library reqwest, however that seems farfetched.

DataDir's put_file unwraps a local file exist check

line 362 of dir.rs contains this line:
let mut file = File::open(path_ref).unwrap();
if path_ref doesn't refer to an existing file path, the unwrap fails. I propose this is replaced with:

let mut file try!(File::open(path_ref);

where try!() is a macro that is able to parse an io::Result()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.