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

Declarative format #4

Open
1 task
domenkozar opened this issue Nov 27, 2016 · 14 comments
Open
1 task

Declarative format #4

domenkozar opened this issue Nov 27, 2016 · 14 comments
Assignees
Labels

Comments

@domenkozar
Copy link
Contributor

domenkozar commented Nov 27, 2016

I'd essentially like to turn https://github.com/mayflower/hydra-jobs/blob/master/spec.json into something more .travis.yml alike.

inputs:
  nixpkgs:
    type: git
    value: git://github.com/mayflower/nixpkgs.git

notifications:
  email:
    - [email protected]

Input types:

  • git
  • mercurial
  • boolean
  • nix
  • string
  • previous build
  • previous evaluation

Linting:

  • error out if section appears two times
@expipiplus1
Copy link
Contributor

Should the src input always be the current repo?

@domenkozar
Copy link
Contributor Author

We could get rid of src input in the first place since imports can be relative and we'll just evaluate some conventional file like release.nix

@expipiplus1
Copy link
Contributor

That's a good point. I suppose it's only there in the existing declarative jobsets for ease of integration

@domenkozar
Copy link
Contributor Author

Indeed :)

@expipiplus1
Copy link
Contributor

unless it could be used to do things such as building the branch with master merged into it or something. I'm not sure that nix is the right environment for that though.

@domenkozar domenkozar mentioned this issue Nov 27, 2016
23 tasks
@domenkozar
Copy link
Contributor Author

@expipiplus1 since yaml uses attoparsec https://github.com/snoyberg/yaml/blob/master/yaml.cabal#L58, how much work would we need to make yaml provide friendly error message? Rewrite backend to megaparsec? I'd like to understand the scope here.

@expipiplus1
Copy link
Contributor

expipiplus1 commented Dec 4, 2016 via email

@domenkozar
Copy link
Contributor Author

@expipiplus1 we can still swap out the parser in future, but I'd like to be sure we don't use a parser that won't produce useful messages to users if they make mistakes in declarative config.

@domenkozar domenkozar self-assigned this Dec 9, 2016
@griff
Copy link

griff commented Mar 8, 2017

I really appreciate what you guys are trying to do with this project.

I am curious as to what you mean when you say you want to make the declarative format more Travis CI like because they and other build servers like them have a very strong correlation where 1 branch = 1 jobset while Hydras declarative format takes the form of a special jobsets that creates the other jobsets. So which model are you planning for Hercules?

Personally i like the Travis model and the Hydra model feels bolted on as an afterthought though it is a lot more flexible and more complex.

@domenkozar
Copy link
Contributor Author

domenkozar commented Mar 8, 2017

Thanks!

declarative format takes the form of a special jobsets that creates the other jobsets

I'm not sure what you mean by that exactly. Can you provide an example?

@expipiplus1
Copy link
Contributor

@domenkozar he's talking about the declarative jobset functionality that shlevy added to hydra. the .jobsets jobset.

@domenkozar
Copy link
Contributor Author

@griff Hydra declarative jobsets is a feature that added declarative format with minimal code change. But it wasn't really properly integrated, which we plan to do travis-ci like.

We might need to consider that a project can have multiple jobsets though.

@griff
Copy link

griff commented Mar 8, 2017

@domenkozar I believe you can have different content in .travis.yml in different branches on Travis CI. Doing the same with this project might solve the multiple jobsets per project though you would then be limited to 1 jobset pr. branch.

@spacefrogg
Copy link

Although I have no say in this, I want to contribute my thoughts to this discussion. Two distinct points I have to make:

JSON for jobsets

I use hydra declarative jobset feature only recently. The first thing that strikes me is, that you only need JSON ever once per project, namely the one file you use to instantiate the project itself and that points hydra to the nix expression that generates the .jobsets jobset. After that you can handle everything from that nix expression. I wrote a small library (20+ lines) that handles argument testing and json creation, which is trivial as nix has toJSON as a builtin. This feature does not feel like an afterthought to me. BTW an extra src input is not needed for declarative jobsets as it comes as declInput into the nix expression already.

Definition of project

As projects in hydra are the basis for defining releases, it is natural to have multiple jobsets per project of which any one might evolve into a release or multiple releases. In that sense, projects should support "multiple branches". The flexibility is a great gain and comes at virtually no cost in the trivial cases. If another path is pursued in hercules, declarative projects might have other needs, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants