Skip to content

Allow auth with using queue#2611

Merged
freddyaboulton merged 21 commits into
gradio-app:mainfrom
GLGDLY:main
Nov 9, 2022
Merged

Allow auth with using queue#2611
freddyaboulton merged 21 commits into
gradio-app:mainfrom
GLGDLY:main

Conversation

@GLGDLY
Copy link
Copy Markdown
Contributor

@GLGDLY GLGDLY commented Nov 6, 2022

Description

Allow auth with using queue, initiated by #2215 , which if queue is on by default, authentication then cannot be used by default. A partial fix to #293 as well.

Also fix wrong position in changlog from the last pr #2428

Checklist:

  • I have performed a self-review of my own code
  • I have added a short summary of my change to the CHANGELOG.md
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@aliabid94
Copy link
Copy Markdown
Contributor

Very cool, thanks @GLGDLY! Testing now

@aliabid94
Copy link
Copy Markdown
Contributor

Works great, thanks a lot @GLGDLY!

Copy link
Copy Markdown
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the very nice PR @GLGDLY ! Left some comments and questions. Once those are addressed these should be good to merge 😄

Comment thread gradio/routes.py
async def startup_events():
app.blocks.startup_events()
return True
if not app.startup_events_triggered:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we need this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comments are removed here, it is changed to allow the initialization to run the queue background coros

Comment thread test/test_blocks.py
if msg["msg"] == "process_completed":
assert msg["success"]
assert msg["output"]["data"] == ["Hello 123!"]
assert _loop.time() > _time
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not passing on our CI. I don't think we need to check the time. I think it would be sufficient to test that the output is correct. Might make sense to rewrite this loop so that the "name" is different for each event in the queue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"name" is different for each event in the queue is added now, time is checked as I think we need to ensure the queue is actually working

Comment thread test/test_blocks.py
sleep_time = 5

async def say_hello(name):
await asyncio.sleep(sleep_time)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to sleep for so long. The test takes quite a while to run right now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is 1 sec and 3 times now

@GLGDLY
Copy link
Copy Markdown
Contributor Author

GLGDLY commented Nov 8, 2022

Thank you @aliabid94 @freddyaboulton , I will take a look at the problems later today🙏🏻

@GLGDLY GLGDLY reopened this Nov 8, 2022
@freddyaboulton
Copy link
Copy Markdown
Collaborator

Thank you @GLGDLY !

@freddyaboulton freddyaboulton merged commit b75b7b7 into gradio-app:main Nov 9, 2022
@GLGDLY
Copy link
Copy Markdown
Contributor Author

GLGDLY commented Nov 9, 2022

Thank you @GLGDLY !

ok thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants