Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added job/PROJECT/JOBSET/JOB/latest-outpath endpoint. #603

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kquick
Copy link
Contributor

@kquick kquick commented Oct 18, 2018

Returns a redirect to the first output path of the latest successful
build of the specified job. This can be useful when the output
provides HTML documentation (e.g. generated documentation for a build
such as Haskell haddock output). By providing a "constant" redirect
link, the hydra machine can also serve the documentation it builds via
an href in a static page.

Returns a redirect to the first output path of the latest successful
build of the specified job. This can be useful when the output
provides HTML documentation (e.g. generated documentation for a build
such as Haskell haddock output).  By providing a "constant" redirect
link, the hydra machine can also serve the documentation it builds via
an href in a static page.
@aycanirican
Copy link
Member

@kquick this is cool, thank you.

@nomeata
Copy link

nomeata commented Jun 24, 2019

I am confused about this PR. Isn’t this functionality already in hyda?

@kquick
Copy link
Contributor Author

kquick commented Jun 24, 2019

@nomeata Not as far as I could tell... do you know of a URL that provides this?

@nomeata
Copy link

nomeata commented Jun 24, 2019

Oh, I see, this is output paths, not declared built artifacts like

$c->res->redirect($c->uri_for($c->controller('Build')->action_for("build"), [$latest->id], @rest));

Nevermind then.

@basvandijk
Copy link
Member

I tried this PR but I get the following:

When requesting the latest-outpath URL:

https://my.hydra.com//job/my-project/my-jobset/my-job/latest-outpath

it redirects me to:

https://my.hydra.com//nix/store/n3zsgkc28nw1b8bddinww50d9bb55kcp-my-output

which leads to a 404 because I guess hydra doesn't know how to serve /nix/store/... paths.

Do I need to setup something extra to serve /nix/store/... paths?

@kquick
Copy link
Contributor Author

kquick commented Jun 25, 2019

Yes, thanks for the reminder on this, Bas.

I'm using services.httpd to proxy for hydra on the same machine as well as provide paths for haddock docs and hoogle services generated by hydra (and thus this patch to allow serving of the "latest"). To allow the above redirection, I have the following clause:

services.httpd = {
    servedDirs = [
        { dir = "/nix/store";
          urlPath = "/nix/store/";
        };
    ];
    ...
};

Although it should be possible to serve the file directly via hydra, I'm not sure that's a good idea because it essentially bypasses a lot of the controls that a webserver proxy can provide.

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.

None yet

4 participants