Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    dannon
    @dannon:matrix.org
    [m]
    (xref https://github.com/galaxyproject/galaxy/pull/12929#issuecomment-975441140, figured this might be a good discussion spot)
    davelopez (David L贸pez)
    @davel0pez:matrix.org
    [m]
    thanks Dannon, yes, that was the first approach, and it almost works 馃榾
    but it has this particular issue with how the responses works in FastAPI: https://github.com/galaxyproject/galaxy/pull/12929#issuecomment-971777171
    It may not be a huge issue... but it doesn't exactly behaves as the legacy way, because it "appends" to the content-type whatever there is in the response
    meaning we can end with multiple content-types
    the only way to workaround it is to actually make sure we return a fresh Response object passing the headers there (the headers can be trans.response.headers)
    dannon
    @dannon:matrix.org
    [m]
    Hrmm. I see. I wonder why they do it like that.
    Would a decorator work here, then, to automagically wrap it in a new response object with headers set correctly?
    dannon
    @dannon:matrix.org
    [m]
    Well, wait, looking here: https://www.starlette.io/responses/
    If content-type is the only issue we're seeing, do we just need to set media_type correctly instead?
    davelopez (David L贸pez)
    @davel0pez:matrix.org
    [m]
    hmmm.. good idea, that might work 馃
    we just need to make sure we always set the media_type instead of the content_type right?
    dannon
    @dannon:matrix.org
    [m]
    That's what I'm thinking?
    davelopez (David L贸pez)
    @davel0pez:matrix.org
    [m]
    ohh...wait.. but we are in the same situation I think... because this is ok if you set the Response manually, but FastAPI does this for us
    and if we want to do some custom stuff, then we just make sure to return a particular Response, or FileResponse, etc
    so to set the media_type we need to explicitly return the Response the same way... 馃槥
    maybe we are overthinking this too much... as far as I know, we only return content-type different from JSON when were are actually explicitly returning other stuff, like FileResponse, StreamingResponse, etc
    davelopez (David L贸pez)
    @davel0pez:matrix.org
    [m]
    so we may never encounter this double content-type issue?
    dannon
    @dannon:matrix.org
    [m]
    Maybe? It'd be good to track down a real instance of it to look at concretely, for sure.
    davelopez (David L贸pez)
    @davel0pez:matrix.org
    [m]
    yeah, tomorrow in the morning I will try to figure out if there is any chance this can really happen
    dannon
    @dannon:matrix.org
    [m]

    You're definitely right about media_type; it doesn't solve the problem since that's only useful to construct a new response, which would solve the problem anyway :/

    Sorry for all the questions, I hadn't dug into this work yet and just got caught up this morning. Really nice stuff though.

    davelopez (David L贸pez)
    @davel0pez:matrix.org
    [m]
    no worries! on the contrary! this makes me rethink about it and it's really easy I miss something, so all inputs are welcome!
    Nate Coraor
    @natefoo:matrix.org
    [m]
    I've been trying to come up with a scheme using socat to pass file descriptors over a unix socket (much like uWSGI zerg mode) so that it's possible to use circusd sockets with unicornherder and nothing I've tried so far works.
    I am mildly concerned though that both circusd and unicornherder are not very active projects anymore.
    dannon
    @dannon:matrix.org
    [m]
    Is shipping and using a local supervisord an option instead, potentially?
    Circus seemed super nice, but yeah... those repos only have one attached person, who is doing other things now.
    Nate Coraor
    @natefoo:matrix.org
    [m]
    Sure, supervisor is an option (and a bit more attractive now if we can't use circus' socket functionality anyway).
    sergey
    @ic4f:matrix.org
    [m]
    Rant time! One of the mysteries in our codebase was that we had to add a relationship property to a model outside of the class definition, using SQLAlchemy's add_property()function (that was one of the few bits of code left over in mapping.py after all mapping was implemented declaratively in the model). If we tried to define it as all other properties are defined - inline - a runtime error was raised on startup: apparently, the Job model was accessed before the mapping configuration had been done, and that led to accessing an attribute that didn't exist yet. One would think, that one property caused some weird traversal of the relationship graph that led to that premature accessing of Job's attributes... Nope. Apparently, that could've been any property - we just need one! It's called like this: class_mapper(Job).add_property(.... So, class_mapper returns the mapper for the passed object ...and ALSO configures all registries (there's a second argument with a default value that's not even mentioned: configure=True). In other words, classic example of a function with not-too-obvious side effects. (you need the mapper for this? sure, but let me ALSO configure it for you!)
    Nate Coraor
    @natefoo:matrix.org
    [m]
    Marius: btw did you intentionally not include uvloop in the requirements?
    All the other components are in requirements, so I wasn't sure
    Marius
    @mvdbeek:matrix.org
    [m]
    IIRC uvloop wasn't compatible with the python version we used at the time
    uvloop requires Python 3.7 or greater and is available on PyPI. Use pip to install it:
    Nate Coraor
    @natefoo:matrix.org
    [m]
    Ah, yup
    Marius
    @mvdbeek:matrix.org
    [m]
    But we can drop 3.6 in the next release, it's EOL in december
    Nate Coraor
    @natefoo:matrix.org
    [m]
    Yep
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    We should do that sooner rather than later since Python 3.10 support is blocked by 3.6, e.g. it seems there's no numpy version that works on both.
    Nate Coraor
    @natefoo:matrix.org
    [m]
    Fine to do it now in dev right?
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    :+1: from me
    Marius
    @mvdbeek:matrix.org
    [m]
    馃憤锔
    Simon Bray
    @simonbray:matrix.org
    [m]
    Hello, is it possible to publish histories via the API? This seems to be the intended method but there is nothing in buildapp.py: https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/webapps/galaxy/api/histories.py#L816
    I would like to publish >300 histories so I'm very much hoping there's a way 馃サ
    sorry, ignore me, I got it to work
    wm75 (Wolfgang Maier)
    @wm75:matrix.org
    [m]
    Simon Bray: maybe what you really want is just make them accessible via link instead of publishing? With publishing > 300 will flood the server's Shared Histories view.
    Your call, of course, but accessible via link is the option we chose for the sars-cov-2 bot.
    Simon Bray
    @simonbray:matrix.org
    [m]
    wm75 (Wolfgang Maier) yes that sounds good. Could you send me some code?
    it's really simple :)
    Helena Rasche
    @hexylena:matrix.org
    [m]
    I've written things for that with parsec before, parsec histories get_histories | filtering with jq | xargs -P8 -I {} parsec histories update_history --importable {}
    (in case you don't feel like writing python.)
    wm75 (Wolfgang Maier)
    @wm75:matrix.org
    [m]
    Yes, essentially the key is to realize that the status is called "importable". And, yes, parsec makes some things really easy.
    Helena Rasche
    @hexylena:matrix.org
    [m]

    yes, discovering the flag name is definitely the hard part!

    Options:
      --annotation TEXT  Replace history annotation with given string
      --deleted          Mark or unmark history as deleted
      --importable       Mark or unmark history as importable
      --name TEXT        Replace history name with the given string
      --published        Mark or unmark history as published

    and that help text doesn't help much either. We should update that in bioblend for sure.