Commit Graph

82 Commits

Author SHA1 Message Date
Gabriel Gonzalez
4df96deb67 Fix evaluation failure 2019-12-10 18:44:54 -08:00
Hunter Kelly
4d903a1919
Update stack extra-deps for dhall-1.27 2019-11-25 11:16:42 +00:00
Hunter Kelly
262454f337
Merge branch 'master' of github.com:dhall-lang/dhall-kubernetes 2019-11-25 11:03:04 +00:00
Hunter Kelly
4b3827b1be
Update nix dependencies with sort package 2019-11-25 10:56:18 +00:00
Greg Ziegan
7af2ab5345 Prefer "schema" syntax for examples (#93)
* Also update to the latest version of `dhall`
* Also fix `./scripts/generate.sh` to generate the `schemas*` files
2019-11-23 16:53:03 -08:00
Hunter Kelly
a7c595b6c9
Incorporate feedback from @Gabriel439 2019-11-22 17:57:15 +00:00
Hunter Kelly
99f4ecd3b9
Add prefixMap option for specifying external import roots (#2) 2019-11-20 13:36:11 +00:00
Hunter Kelly
23a53f8786
Add --skipDuplicates CLI flag and handler (#1) 2019-11-19 14:11:33 +00:00
Gabriel Gonzalez
fee24c0993
Add dhall-kubernetes support for "schemas" (#84)
For lack of a better term, I'm calling the `{ Type = …, default = … }`
record that the record completion operator expects a "schema".  This
change adds `dhall-kubernetes` support for auto-generating these schemas
for ease of use with the new `::` operator.

See the included example for how this would be used
2019-11-18 08:22:19 -08:00
James Guthrie
2fb32a453c Set Cron* types and defaults to v1beta1 (#88)
According to the Kubernetes documentation [1]:

Note: CronJob resource in batch/v2alpha1 API group has been deprecated
starting from cluster version 1.8. You should switch to using
batch/v1beta1, instead, which is enabled by default in the API server.
Examples in this document use batch/v1beta1 in all examples.

[1]: https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/
2019-11-16 18:18:44 -08:00
Alessandro Marrella
14ef113368 Add EarnestResearch/dhall-packages to the users (#89)
We are happy users of dhall and dhall-kubernetes and we opensourced our bindings, I'm proposing to add them here for better discovery :)
2019-11-16 18:06:58 -08:00
Simon Jakobi
dea2c92017
Update Prelude.dhall to v10.0.0 (#80)
Now all the examples will build again with current versions
of dhall.
2019-09-16 18:52:23 +02:00
Fabrizio Ferrai
4ad58156b7
Update to Kubernetes 1.14.3 (#72) 2019-07-30 10:25:00 +03:00
Alessandro Marrella
f3d759009f Modify Kubernetes generator to support more cases (#69)
* Adjust dhall-kubernetes-generator to handle different swagger specs
2019-07-12 11:49:49 +03:00
Andrew DeMaria
fef6b2328b Show kind for error message (#66)
In the case that an older kubernetes openapi is used, some of the
excluded models for newer versions will cause a necessary object for the
older kubernetes version to be filtered. In this case, showing the Kind
is helpful for debugging.
2019-06-10 08:06:30 +03:00
Fabrizio Ferrai
8afa82f0c7
Switch to native GitHub highlighting 2019-06-07 15:16:43 +03:00
Fabrizio Ferrai
fad3589782
Update to latest Dhall version (#65) 2019-05-13 18:05:56 +03:00
Robbie McMichael
d2edbe2104 Set syntax highlighting for Dhall files (#63) 2019-05-07 18:10:26 +03:00
Fabrizio Ferrai
16a4eabbd5
Add link to stack website (#61) 2019-05-02 10:29:02 +03:00
Fabrizio Ferrai
805b432df2
API v2 (#57)
This ports the conversion script from Python to Haskell (fix #7)

The main reasons for this port are that:
- the Python script was really hard to maintain for reasons like 
  "converting from Swagger to Dhall is interleaved with string formatting"
- in Haskell we can use the dhall library to generate always syntactically 
  correct Dhall AST. It's also much easier to keep an eye on correctness, 
  because types and pattern matching. It also forces us to deal with things
  like cyclic imports from the get go.

Things happening here:
- remove the `api` folder, removing the difference between "raw api" and "nice api"
- move defaults from `default` to `defaults` folder, as it is in `dhall-nethack`
- transition to the new syntax for `Optional` (fix #49)
- add `types.dhall` and `defaults.dhall`, so that one can now easily "pin a version"
  by just importing these two records at a specific commit/tag. They also make it really
  easy to access objects, e.g.
  `let types = https://raw.githubusercontent... sha256:... in types.Deployment`
- also add typesUnion.dhall (fix #54), so one is able to send to Kubernetes different
  objects in the same stream. This is also documented in the README
- defaults are resolved recursively (fix #46): if there's an import of a "nullable" record,
  then it's not marked as Optional, making merging objects much easier
- default objects are not lambdas anymore, and instead they just don't include the required
  fields (that is, the ones that are not nullable records), as suggested in dhall-lang/dhall-lang#382
- for objects that are simple types we used to generate a simple lambda
  `\(a : Text) -> a` as a default, now we just don't generate a default (e.g. see
  `io.k8s.apimachinery.pkg.apis.meta.v1.Time`)
- autoformat all generated Dhall code
- remove cyclic imports (fix #47)
- update to dhall-1.22 and dhall-json-1.2.8
2019-05-01 19:13:18 +03:00
James Griffiths
5d11c98b86 Update Dhall version in readme (#60) 2019-04-18 09:56:33 +03:00
Fabrizio Ferrai
69c85131d1 Add logo to README (#59) 2019-04-02 11:53:33 +02:00
Arian van Putten
a670cd1fee
Add logo (#58) 2019-03-31 15:24:48 +02:00
Arian van Putten
8d295ecedc
Nixify the build (#55)
This makes our build reproducible and consistent

* Disables dhall tests. They don't build in sandbox mode because they require network access
* Moves all scripts to ./scripts folder for consistency
* Moves all nix files to ./nix folder for consistency, except for release.nix which Hydra needs
* Changes convert.py to take the K8s swagger spec as an argument
* Get k8s swagger spec from nixpkgs
* Get dhall prelude from nixpkgs
* added an ./scripts/update-nixpkgs.sh script to easily update to a new version of nixpkgs
2019-03-30 11:05:29 +01:00
Fabrizio Ferrai
f860c4e2a4
Upgrade to Kubernetes 0.13.4 (#53) 2019-03-25 12:32:48 +02:00
Fabrizio Ferrai
423db8a8bb
Centralize Prelude import (#51)
Import the Prelude only in one place, so it's cached and easily overridable
2019-03-25 12:20:27 +02:00
Ari Becker
047e56a442 Add "Projects Using" section to the docs, with dhall-prometheus-operator (#52) 2019-03-25 11:15:20 +02:00
Fabrizio Ferrai
ced5c10af3
Update to Dhall v5.0.0: deprecate constructors keyword (#45) 2019-01-21 08:49:34 +02:00
Gabriel Gonzalez
272c10efc4
Further simplify instructions for building locally (#43) 2019-01-02 00:49:30 -06:00
Gabriel Gonzalez
ee0c74c79f
Provide default value for src in ./release.nix (#42)
This simplifies local testing
2019-01-02 00:03:04 -06:00
Jan van Brügge
4a904b4688 Do not require apiVersion for ObjectFieldSelector (#40) 2018-12-03 10:37:49 +01:00
Fabrizio Ferrai
0691ba0078 Fix accidental tabs in examples 2018-11-12 19:24:18 +01:00
Fabrizio Ferrai
ad3eff2c7e Unskip tests for some now-passing generated files 2018-11-12 19:20:58 +01:00
Fabrizio Ferrai
f88ad18bcc Update README notice about minimum Dhall version 2018-11-12 19:19:06 +01:00
Simon Hafner
b98223e2a6 Upgrade to dhall version v3.0.0 (#36) 2018-11-12 18:37:55 +01:00
Fabrizio Ferrai
f8be1d55bc
Add high level API (#34)
This adds a high level API (+ tests) for:
- Deployment.v1
- Service.v1
2018-09-13 13:33:48 +03:00
Fabrizio Ferrai
11a986ae11
Fix #32: include the git revision in the Hydra build (#33) 2018-09-04 11:11:40 +03:00
Fabrizio Ferrai
4fec2167a8
Support 'format' key from the swagger schema (#28)
Fix #12 by introducing a `< Int : Natural | String : Text >` Union for the "int-or-string" format key.
2018-08-06 17:13:33 +02:00
Thomas Scholtes
4a7f02cd0d Extract and check examples (#27)
* We move all the example code from the readme to the `examples` folder.
* We provide a `scripts/build-readme.sh` script that inlines referenced
  examples in `README.md.in` and outputs `README.md`. The script also
  verifies that the output readme is the same as in version control.
* We provide a `scripts/build-examples.py` script that builds the Yaml
  output for all examples. The script also verifies that the generated
  Yaml files are the same as in version control.
2018-08-03 16:24:32 +02:00
Ryota Kameoka
e132545c34 Correct README to use Natural type (#31) 2018-07-22 16:12:46 +03:00
Thomas Scholtes
9fbf8be092
Merge pull request #29 from dhall-lang/add-nix-shell
Add 'shell.nix' for local development
2018-07-16 22:34:43 +02:00
Thomas Scholtes
dbbd53ba50
Add 'shell.nix' for local development
As part of this I created a new files `./nixpkgs` that obtains a
specific version of the nixpkgs repo. This code was previously spread
between `release.nix` and `fetchNixpkgs.nix`. I also removed the Nix
1.11 code to simplify things. If we need Nix 1.11 support we can add it
again.
2018-07-16 19:57:10 +02:00
Thomas Scholtes
6e56cd699c Add locales to release.nix to build on plain NixOS
* We add the `glibcLocales` dependency to the somke test. This makes the
  `en_US.UTF-8` locale available which is required for `dhall` to work
  correctly.
* We also extract `check-sources.py` again so it can be run standalone.
  `bash` and `dhall` which are required by the script are still
  available when building it with nix.
2018-07-14 19:12:34 +03:00
Fabrizio Ferrai
ee1dbaefba Add configuration for Hydra builds 2018-07-14 19:12:34 +03:00
Thomas Scholtes
1dafd97c09 Improve convert code and fix alias issues (#25)
We improve the convert code by rewriting the `get_typ`. It is now more
general and properly recurses on records and lists. This also surfaced a
bug where definition aliases did not generate correct code.
2018-07-14 11:10:37 +03:00
Thomas Scholtes
d7e9d809fc
Merge pull request #24 from dhall-lang/fix-kubernetes-version
Fix Kubernetes version for which to get swagger
2018-07-13 23:48:23 +02:00
Thomas Scholtes
59ec184c81
Fix Kubernetes version for which to get swagger
For now I think it is sufficient to hardcode this. We can come up with a
better schema later.
2018-07-13 21:53:29 +02:00
Fabrizio Ferrai
bc09fbe1b4
Fix $ in record labels: start emitting quoted ones (#22) 2018-07-11 18:35:11 +02:00
Fabrizio Ferrai
8b26ad6a47
Merge pull request #20 from dhall-lang/dhall-1.14
Update to Dhall >= 1.14
2018-07-08 21:47:55 +02:00
Fabrizio Ferrai
f8b2122a10 Update the README with a notice about the required dhall version 2018-07-08 22:02:34 +03:00