Giter Club home page Giter Club logo

verk_web's People

Contributors

adamzapasnik avatar alissonsales avatar angelikatyborska avatar dshvimer2 avatar edgurgel avatar hodak avatar jakecraige avatar keyan avatar mentero avatar mikeastock avatar mindreframer avatar oestrich avatar paryz avatar seanculver avatar siepet avatar teamon avatar thousandsofthem avatar tinenbruno avatar

Stargazers

 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  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  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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

verk_web's Issues

Mounting VerkWeb on a path of an existing Endpoint

This is more to start a discussion if this is a wanted feature.

Here is my current implementation, that so far looks promising...

The inspiration came from:

this problem is not properly solved yet:

What was done:

  • check-in generated static files into Git (simpler deployment)
  • provide the plug for mounting
  • adjust readme
  • remove VerkWeb.Endpoint from application to start

It depends on my fork of Verk atm, that's why it makes no sense to open a pull request...
@edgurge what are your thoughts about this feature?

Mount verk_web under protected scope instead of basic auth?

Hi! Love Verk. Question. Is there a way to mount the verk route under a protected scope as opposed to using basic auth? We use pow to protect routes and would like to put the /verk route under an authenticated scope instead if basic auth.

something like:

  scope "/",  do
    pipe_through [:browser, :protected]
    
    forward("/verk", VerkWeb.MountRoute)
  end

Phoenix 1.4 mount issue

Hi,

The newest release of phoenix (including cowboy2) no longer has the method Phoenix.Router.Route.forward/4. I receive the following error trying to redirect to /verk.

function Phoenix.Router.Route.forward/4 is undefined or private

It is happening inside the plug/mount.ex file in the defp forward method.

EDIT: For now, I got around it by adding this to my router directly.

  scope "/", VerkWeb do
    forward("/verk", Endpoint)
  end

Add a "Run Job" on Scheduled jobs

Hello,

Thanks for writing this very useful library!

I have a use case where I want to manually run the scheduled job earlier than the scheduled time through the interface.

I imagine a button next to the details button on the scheduled jobs tab. This would have a javascript "Are you sure" alert and then just enqueue the scheduled job immediately.

I'd be interested in writing a PR for this if you think it would be something you'd want to add.

Deleting a job with job id

Hey Ed,

When you enqueue or schedule a job you get back a job id that's a big long number, however, there doesn't look like there is a way to delete a job by that ID. My ideal case is to store that number in my db table so I can delete the future scheduled job if I need to.

I had a look in verk_web, found this:

def modify(conn, %{"action" => "delete", "jobs_to_modify" => jobs_to_remove}) do
. which removes a job when you pass in the whole job, on a queue named 'schedule'.

There was also a delete_job function I found, but that required the original json, not just the ID.

Appreciate advice on where to go next.

Thanks!

Warning message seen.

When running the phoenix server. I see plenty of those messages:
[warn] Ignoring unmatched topic "rooms:jobs" in xxx.UserSocket

As a beginner to elixir phoenix, some help would be awesome.

Thanks

Authentication is not working in prod

I have the following code in endpoint.ex:

defmodule App.Endpoint do
  use Phoenix.Endpoint, otp_app: :app
  if Application.get_env(:verk_web, :authorization) do
    IO.puts("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
    IO.inspect(Application.get_env(:verk_web, :authorization))
    use VerkWeb.Mount, path: "/admin/verk"
    IO.puts("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
  else
    raise "Verk authorization"
  end

If I execute this in dev it ask for authorization. When I compile to prod I can see this message:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[realm: "Admin", username: "admin", password: "password"]
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If I execute a remote console in the prod server I can get Application.get_env(:verk_web, :authorization) correctly. However I does not ask for authorization. I don't have more ideas to solve this.

I use AWS LoadBalancer and Docker with AWS ECS.

Any help it is very welcome :)

Thanks in advance.

Dashboard: Incorrect internal links

Internal links in the VerkWeb are behaving weirdly, see screenshot:

2017-09-19 20-56-03

  • page_path(@conn, :index) -> / (incorrect)
  • mount_static_path(@conn, "/js/app.js") -> /verk/js/app.js (correct)

Details:

  • phoenix 1.3.0
  • verk 1.1.0
  • verk_web 1.0.2 (same behavior for master as well)
  • plug 1.4.3

mounted into endpoint via

defmodule App.Web.Endpoint do
  use Phoenix.Endpoint, otp_app: :app
  use VerkWeb.Mount, path: "/verk"
  ...

I have an older project with phoenix 1.2 and verk 0.13.5 and everything works as expected.
git diff between these versions don't show any related changes so it's probably behavior change on phoenix/plug side.

Did anyone encounter something similar? Thoughts on debugging?

P.S. related - https://github.com/edgurgel/verk_web/blob/master/web/views/layout_view.ex#L5 - that's why mount_static_path works well.

Development environment doesn't work out of the box

Not sure if this is an issue with my setup but trying to run the master branch of VerkWeb locally doesn't work for me:

$ mix deps.get
$ npm install && bower install
$ mix phoenix.server

[info] GET /
[debug] Processing by VerkWeb.PageController.index/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 500 in 12ms
[error] #PID<0.2415.0> running VerkWeb.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        (stdlib) :ets.select(:queue_stats, [{{:"$1", :"$2", :"$3", :"$4", :_, :_}, [], [{{:"$1", :"$2", :"$3", :"$4"}}]}])
        (verk) lib/verk/queue_stats_counters.ex:23: Verk.QueueStatsCounters.all/0
        (verk) lib/verk/queue_stats.ex:22: Verk.QueueStats.all/0
        (verk_web) web/controllers/page_controller.ex:6: VerkWeb.PageController.index/2
        (verk_web) web/controllers/page_controller.ex:1: VerkWeb.PageController.action/2
        (verk_web) web/controllers/page_controller.ex:1: VerkWeb.PageController.phoenix_controller_pipeline/2
        (verk_web) lib/phoenix/router.ex:261: VerkWeb.Router.dispatch/2
        (verk_web) web/router.ex:1: VerkWeb.Router.do_call/2
        (verk_web) lib/verk_web/endpoint.ex:1: VerkWeb.Endpoint.phoenix_pipeline/1
        (verk_web) lib/plug/debugger.ex:123: VerkWeb.Endpoint."call (overridable 3)"/2
        (verk_web) lib/phoenix/endpoint/render_errors.ex:34: VerkWeb.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Is there something else I need to do to run this in development?

Can't start verk web as a server

Error occurs on application startup

Error log:

02:15:10.347 [info] Application verk_web exited: VerkWeb.start(:normal, []) returned an error: shutdown: failed to start child: VerkWeb.Endpoint
--
  |  | ** (EXIT) an exception was raised:
  |  | ** (UndefinedFunctionError) function Plug.Cowboy.child_spec/1 is undefined (module Plug.Cowboy is not available)
  |  | Plug.Cowboy.child_spec([scheme: :http, plug: {VerkWeb.Endpoint, []}, options: [dispatch: [_: [{:_, Phoenix.Endpoint.Cowboy2Handler, {VerkWeb.Endpoint, []}}]], port: 4000, otp_app: :verk_web]])
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/cowboy2_adapter.ex:44: Phoenix.Endpoint.Cowboy2Adapter.child_spec/3
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/supervisor.ex:108: anonymous fn/6 in Phoenix.Endpoint.Supervisor.server_children/4
  |  | (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/supervisor.ex:99: Phoenix.Endpoint.Supervisor.server_children/4
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/supervisor.ex:59: Phoenix.Endpoint.Supervisor.init/1

Elixir 1.10.4

relevant mix.exs:

def application do
    [
      applications: [
        :verk,
        :verk_web,
      ]
    ]
  end

def deps do
 {:verk, "~> 1.7.1"},
 {:verk_web, "~> 1.5.0"}
end

relevant releases.exs:

config :verk_web, VerkWeb.Endpoint,
  http: [port: System.get_env("PORT", "4000") |> String.to_integer()],
  url: [host: System.get_env("URL_HOST", "localhost")],
  server: true,
  pubsub: [name: VerkWeb.PubSub, adapter: Phoenix.PubSub.PG2]

I've tried several things, but nothing really works. It does seem like some sort of a dependency problem, but I really can't figure it out. Seems like this error is related to phoenix 1.4, but since I don't have it as an explicit dependency I'm not sure what to do. Any help will be greatly appreciated. Thanks in advance :)

Support for Phoenix 1.3.0

Hello,

It seems it does not work for the newest versions of Phoenix:

Failed to use "phoenix" (version 1.3.0) because            
  phoenix_live_reload (version 1.1.1) requires ~> 1.0      
  verk_web (version 1.1.0) requires ~> 1.2.1               
  mix.exs specifies ~> 1.3.0    

Any plan or solutions about this?

Thanks for your time

How can one monitor all Verk hosts using a single VerkWeb instance?

I have several instances running a Verk-backed application and I’d like to see the stats for the machines in aggregate. I’m having a couple issues.

  1. Is there a way to run a single VerkWeb node that gets stats for all the processors? When I tried running VerkWeb on it’s own I get an argument error:

    18:36:07.483 [error] #PID<0.337.0> running VerkWeb.Endpoint terminated
    Server: localhost:4000 (http)
    Request: GET /
    ** (exit) an exception was raised:
    ** (ArgumentError) argument error
        (stdlib) :ets.select(:queue_stats, [{{:"$1", :"$2", :"$3", :"$4", :_, :_}, [], [{{:"$1", :"$2", :"$3", :"$4"}}]}])
        (verk) lib/verk/queue_stats_counters.ex:23: Verk.QueueStatsCounters.all/0
        (verk) lib/verk/queue_stats.ex:22: Verk.QueueStats.all/0
        (verk_web) web/controllers/page_controller.ex:6: VerkWeb.PageController.index/2
        (verk_web) web/controllers/page_controller.ex:1: VerkWeb.PageController.action/2
        (verk_web) web/controllers/page_controller.ex:1: VerkWeb.PageController.phoenix_controller_pipeline/2
        (verk_web) lib/phoenix/router.ex:261: VerkWeb.Router.dispatch/2
        (verk_web) web/router.ex:1: VerkWeb.Router.do_call/2
    
  2. Unfortunately it looks like VerkWeb relies on the :queue_stats ets table to get queue specific stats, rather than using the data in Redis. The “All-time stats” numbers are coming from Redis and are reporting correctly, but queue specific stats are only showing jobs processed by the node on which that VerkWeb instance is running. Is this expected behavior?

Running jobs should list all the jobs being run in the cluster

Let's say I have 2 nodes, node_id: "1" and node_id: "2" running on the same redis server.

Currently, the "Failed", "Enqueued", "Scheduled" jobs properly list all jobs in the cluster (that is, jobs saved in Redis, no matter on what node is the VerkWeb being run).

Unfortunately, the "Running jobs" count and list lists only jobs running in the given node.

It would be cool if it would list all the jobs that are inprogress in all currently living nodes.

Possibly related to edgurgel/verk#157 ?

P.S. Until we implement it, we could mention it in the README and/or in VerkWeb interface.

Cowboy 2 support?

Failed to use "cowboy" (version 2.6.1) because
  plug_cowboy (version 2.0.1) requires ~> 2.5
  verk_web (versions 1.0.0 to 1.4.2) requires ~> 1.0
  mix.lock specifies 2.6.1

Upgrade to verk_web 0.13.3 crashes my application on startup

Still trying to triage this, but upgrading to 0.13.3 breaks my application by preventing startup.

Startup crash log: https://gist.github.com/keyan/29f1c503cc3de1865bbc9531e33692e8
My mix.lock: https://gist.github.com/keyan/3d372b125579e684116a5f0f9713eb09

I might have to make some application changes on my end in order to work with the new version. At the very least I think the changes were large enough and added additional features and so warrant a minor version bump.

Websockets in umbrella

I have verk_web configured as a separate app in our umbrella project (not mounted in any phoenix apps).

We have one proxy app that kindof plugs requests to the other phoenix endpoints.

Shortened:

defmodule ProxyWeb.Endpoint do
  @domains %{
    "admin.app1.com" => AdminWeb.Endpoint,
    "verk.app1.com" => VerkWeb.Endpoint
  }
  def init(opts), do: opts

  def call(conn, _) do
    with domain <- get_domain(conn),
         endpoint <- Map.get(@domains, domain, @default_host) do
      endpoint.call(conn, endpoint.init(:supervisor, endpoint))
    end
  end
end

VerkWeb is totally fine here, except for websockets:

[info] Converted error Phoenix.Router.NoRouteError to 404 response
[info] GET /socket/websocket

I'm not quite sure what I should do from here, but happy to provide more detail or even PR if we find it's a real issue.

Include "DeadSet" stats on VerkWeb

I think it would be really useful to see some stats around "dead" (as Verk calls them) jobs on VerkWeb. As of now, the only job failure stats we get are related to failed attempts, even when subsequent retries may succeed. It is difficult to tell how many job failures ended with the job reaching the max retry count and dying.

It is not entirely clear to me how difficult it would be but it very helpful to have another tab, "Dead", that has similar data as the "Retries" tab.

Run verk_web on different machine than verk

Hi!

So we have an issue, which is, we currently run our Elixir app on Heroku (not for much longer but we are currently stuck) and we want to use Heroku workers to handle the job load. However, it seems I can't configure our "web" app to not accept worker requests but still host verk_web on the same app.

We have the dashboard working but it shows no queues in the web interface because we have used the VERK_DISABLED example in the docs to disable it on our API instance. The problem is that we need to host the verk_web panel on the API instance and host the workers on separated machines but since we return [] for no queues, the dashboard thinks there is nothing there. We definitely don't want the API app to act as a worker.

Do you have any advice???

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.