我想弄清楚如何使用Argo设置工作队列。Argo 工作流程的计算成本很高。我们需要为许多同时发生的请求做好计划。工作流项目通过 HTTP 请求添加到工作队列。
该流程可以这样演示:
client
=> hasura # user authentication
=> redis # work queue
=> argo events # queue listener
=> argo workflows
=> redis + hasura # inform that workflow has finished
=> client
Run Code Online (Sandbox Code Playgroud)
我从未构建过超出其资源的 K8s 集群。在哪里限制工作流程的执行?或者 Argo Events 和 Workflows 是否根据集群中的资源来限制这些?
上面的例子可能可以简化为以下内容,但问题是如果处理队列已满会发生什么?
client
=> argo events # HTTP request listener
=> argo workflows
Run Code Online (Sandbox Code Playgroud) 如何将 http-request-session 对象获取到石墨烯模式中?
我已在请求会话中存储了一些值,我需要通过这些值进行访问。一种可能的解决方案是将 session-id 发送到前端,然后将其传递到 post 请求中,但这似乎不是一个好的解决方案。
石墨烯有一个 context_value 但我不明白我是如何工作的。
我将其放入我的 Django 视图中:
schema = graphene.Schema()
schema.execute('{ viewer }', context_value={'session': request.session})
Run Code Online (Sandbox Code Playgroud)
在我的石墨烯模式中,如果我尝试按照教程中描述的方式进行操作(https://github.com/graphql-python/graphene/blob/master/docs/execution/execute.rst),它会说
“WSGIRequest”对象没有属性“get”
class Query(graphene.ObjectType):
viewer = graphene.Field(Viewer)
def resolve_viewer(self, info):
info.context.get('session')
print(info.context.session.keys()) #an empty array
return Viewer()
Run Code Online (Sandbox Code Playgroud) 我正在尝试组合位于 Django 2.1 中不同应用程序中的多个查询模式。使用 graphene-django 2.2(已经尝试过 2.1 有同样的问题)。蟒蛇 3.7。
Query 类只注册第一个变量。例如 shop.schema.Query。
import graphene
import graphql_jwt
from django.conf import settings
import about.schema
import shop.schema
import landingpage.schema
class Query(about.schema.Query, shop.schema.Query, landingpage.schema.Query, graphene.ObjectType):
pass
class Mutation(shop.schema.Mutation, graphene.ObjectType):
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
verify_token = graphql_jwt.Verify.Field()
refresh_token = graphql_jwt.Refresh.Field()
schema = graphene.Schema(query=Query, mutation=Mutation)
Run Code Online (Sandbox Code Playgroud)
为什么会这样?python 3.7中的类有什么改变吗?石墨烯教程说这将继承多个......
class Query(cookbook.ingredients.schema.Query, graphene.ObjectType):
# This class will inherit from multiple Queries
# as we begin to add more apps to our project
pass
schema = graphene.Schema(query=Query)
Run Code Online (Sandbox Code Playgroud)
我正在将我的架构导出到 schema.json 以便将它与反应中继一起使用。我确实从登陆页面(3. 变量)中找到了我的对象“集合”查询模式。继电器返回: …
django ×2
argo-events ×1
graphql ×1
kubernetes ×1
react-relay ×1
reactjs ×1
request ×1
schema ×1