Skip to content

Commit 90c1eb8

Browse files
authored
Minimize unnecessary rebuilds (#105)
This improves the granularity of the Nix build graph in order to minimize unnecessary rebuilds. This also fixed several bugs in the package generation along the way, so this change includes those fixes.
1 parent a8ffffc commit 90c1eb8

27 files changed

+723
-138
lines changed

1.12/Prelude.dhall

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{- This file provides a central `Prelude` import for the rest of the library to
2+
use so that the integrity check only needs to be updated in one place
3+
whenever upgrading the interpreter.
4+
5+
This allows the user to provide their own Prelude import using the
6+
`DHALL_PRELUDE` environment variable, like this:
7+
8+
```
9+
$ export DHALL_PRELUDE='https://prelude.dhall-lang.org/package.dhall sha256:...'
10+
```
11+
12+
Note that overriding the Prelude in this way only works if this repository
13+
is imported locally. Remote imports do not have access to environment
14+
variables and any attempt to import one will fall back to the next available
15+
import. To learn more, read:
16+
17+
* https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarantees#cross-site-scripting-xss
18+
19+
This file also provides an import without the integrity check as a slower
20+
fallback if the user is using a different version of the Dhall interpreter.
21+
22+
This pattern is documented in the dhall-nethack repo:
23+
24+
* https://github.com/dhall-lang/dhall-nethack/blob/master/Prelude.dhall
25+
-}
26+
27+
env:DHALL_PRELUDE
28+
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v10.0.0/Prelude/package.dhall sha256:771c7131fc87e13eb18f770a27c59f9418879f7e230ba2a50e46f4461f43ec69
29+
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v10.0.0/Prelude/package.dhall

1.12/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In the following example, we:
5353
-- examples/deploymentSimple.dhall
5454

5555
let kubernetes =
56-
../package.dhall sha256:ab1c971ddeb178c1cfc5e749b211b4fe6fdb6fa1b68b10de62aeb543efcd60b3
56+
../package.dhall sha256:ce1e73deebf8c4eb513bfc736adfd924fe696ffee486f6f4bd81ed281bbf0f2a
5757

5858
let deployment =
5959
kubernetes.Deployment::{
@@ -152,7 +152,7 @@ let map = Prelude.List.map
152152
let kv = Prelude.JSON.keyText
153153

154154
let kubernetes =
155-
../package.dhall sha256:ab1c971ddeb178c1cfc5e749b211b4fe6fdb6fa1b68b10de62aeb543efcd60b3
155+
../package.dhall sha256:ce1e73deebf8c4eb513bfc736adfd924fe696ffee486f6f4bd81ed281bbf0f2a
156156

157157
let Service = { name : Text, host : Text, version : Text }
158158

@@ -233,7 +233,7 @@ Result:
233233
```yaml
234234
## examples/out/ingress.yaml
235235

236-
apiVersion: networking.k8s.io/v1beta1
236+
apiVersion: extensions/v1beta1
237237
kind: Ingress
238238
metadata:
239239
annotations:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
labels:
5+
app: aws-iam-authenticator
6+
chart: aws-iam-authenticator-0.1.1
7+
heritage: dhall
8+
release: wintering-rodent
9+
name: wintering-rodent-aws-iam-authenticator
10+
spec:
11+
template:
12+
metadata:
13+
annotations:
14+
scheduler.alpha.kubernetes.io/critical-pod: ""
15+
labels:
16+
app: aws-iam-authenticator
17+
release: wintering-rodent
18+
name: aws-iam-authenticator
19+
spec:
20+
containers:
21+
- args:
22+
- server
23+
- "--config=/etc/aws-iam-authenticator/config.yaml"
24+
- "--state-dir=/var/aws-iam-authenticator"
25+
- "--generate-kubeconfig=/etc/kubernetes/aws-iam-authenticator/kubeconfig.yaml"
26+
image: gcr.io/heptio-images/authenticator:v0.1.0
27+
name: wintering-rodent-aws-iam-authenticator
28+
volumeMounts:
29+
- mountPath: /etc/aws-iam-authenticator/
30+
name: config
31+
- mountPath: /var/aws-iam-authenticator/
32+
name: state
33+
- mountPath: /etc/kubernetes/aws-iam-authenticator/
34+
name: output
35+
hostNetwork: true
36+
nodeSelector:
37+
node-role.kubernetes.io/master: ""
38+
tolerations:
39+
- effect: NoSchedule
40+
key: node-role.kubernetes.io/master
41+
- effect: CriticalAddonsOnly
42+
key: Exists
43+
volumes:
44+
- configMap:
45+
name: wintering-rodent-aws-iam-authenticator
46+
name: config
47+
- hostPath:
48+
path: /srv/kubernetes/aws-iam-authenticator/
49+
name: output
50+
- hostPath:
51+
path: /srv/kubernetes/aws-iam-authenticator/
52+
name: state
53+
updateStrategy:
54+
type: RollingUpdate

1.12/examples/out/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: networking.k8s.io/v1beta1
1+
apiVersion: extensions/v1beta1
22
kind: Ingress
33
metadata:
44
annotations:

1.13/Prelude.dhall

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{- This file provides a central `Prelude` import for the rest of the library to
2+
use so that the integrity check only needs to be updated in one place
3+
whenever upgrading the interpreter.
4+
5+
This allows the user to provide their own Prelude import using the
6+
`DHALL_PRELUDE` environment variable, like this:
7+
8+
```
9+
$ export DHALL_PRELUDE='https://prelude.dhall-lang.org/package.dhall sha256:...'
10+
```
11+
12+
Note that overriding the Prelude in this way only works if this repository
13+
is imported locally. Remote imports do not have access to environment
14+
variables and any attempt to import one will fall back to the next available
15+
import. To learn more, read:
16+
17+
* https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarantees#cross-site-scripting-xss
18+
19+
This file also provides an import without the integrity check as a slower
20+
fallback if the user is using a different version of the Dhall interpreter.
21+
22+
This pattern is documented in the dhall-nethack repo:
23+
24+
* https://github.com/dhall-lang/dhall-nethack/blob/master/Prelude.dhall
25+
-}
26+
27+
env:DHALL_PRELUDE
28+
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v10.0.0/Prelude/package.dhall sha256:771c7131fc87e13eb18f770a27c59f9418879f7e230ba2a50e46f4461f43ec69
29+
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v10.0.0/Prelude/package.dhall

1.13/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In the following example, we:
5353
-- examples/deploymentSimple.dhall
5454

5555
let kubernetes =
56-
../package.dhall sha256:ab1c971ddeb178c1cfc5e749b211b4fe6fdb6fa1b68b10de62aeb543efcd60b3
56+
../package.dhall sha256:9789c555bc6494df664bc567a163d162e0dbbe6b9a471f8946a6476fa4069f5f
5757

5858
let deployment =
5959
kubernetes.Deployment::{
@@ -152,7 +152,7 @@ let map = Prelude.List.map
152152
let kv = Prelude.JSON.keyText
153153

154154
let kubernetes =
155-
../package.dhall sha256:ab1c971ddeb178c1cfc5e749b211b4fe6fdb6fa1b68b10de62aeb543efcd60b3
155+
../package.dhall sha256:9789c555bc6494df664bc567a163d162e0dbbe6b9a471f8946a6476fa4069f5f
156156

157157
let Service = { name : Text, host : Text, version : Text }
158158

@@ -233,7 +233,7 @@ Result:
233233
```yaml
234234
## examples/out/ingress.yaml
235235

236-
apiVersion: networking.k8s.io/v1beta1
236+
apiVersion: extensions/v1beta1
237237
kind: Ingress
238238
metadata:
239239
annotations:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
labels:
5+
app: aws-iam-authenticator
6+
chart: aws-iam-authenticator-0.1.1
7+
heritage: dhall
8+
release: wintering-rodent
9+
name: wintering-rodent-aws-iam-authenticator
10+
spec:
11+
template:
12+
metadata:
13+
annotations:
14+
scheduler.alpha.kubernetes.io/critical-pod: ""
15+
labels:
16+
app: aws-iam-authenticator
17+
release: wintering-rodent
18+
name: aws-iam-authenticator
19+
spec:
20+
containers:
21+
- args:
22+
- server
23+
- "--config=/etc/aws-iam-authenticator/config.yaml"
24+
- "--state-dir=/var/aws-iam-authenticator"
25+
- "--generate-kubeconfig=/etc/kubernetes/aws-iam-authenticator/kubeconfig.yaml"
26+
image: gcr.io/heptio-images/authenticator:v0.1.0
27+
name: wintering-rodent-aws-iam-authenticator
28+
volumeMounts:
29+
- mountPath: /etc/aws-iam-authenticator/
30+
name: config
31+
- mountPath: /var/aws-iam-authenticator/
32+
name: state
33+
- mountPath: /etc/kubernetes/aws-iam-authenticator/
34+
name: output
35+
hostNetwork: true
36+
nodeSelector:
37+
node-role.kubernetes.io/master: ""
38+
tolerations:
39+
- effect: NoSchedule
40+
key: node-role.kubernetes.io/master
41+
- effect: CriticalAddonsOnly
42+
key: Exists
43+
volumes:
44+
- configMap:
45+
name: wintering-rodent-aws-iam-authenticator
46+
name: config
47+
- hostPath:
48+
path: /srv/kubernetes/aws-iam-authenticator/
49+
name: output
50+
- hostPath:
51+
path: /srv/kubernetes/aws-iam-authenticator/
52+
name: state
53+
updateStrategy:
54+
type: RollingUpdate

1.13/examples/out/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: networking.k8s.io/v1beta1
1+
apiVersion: extensions/v1beta1
22
kind: Ingress
33
metadata:
44
annotations:

1.14/Prelude.dhall

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{- This file provides a central `Prelude` import for the rest of the library to
2+
use so that the integrity check only needs to be updated in one place
3+
whenever upgrading the interpreter.
4+
5+
This allows the user to provide their own Prelude import using the
6+
`DHALL_PRELUDE` environment variable, like this:
7+
8+
```
9+
$ export DHALL_PRELUDE='https://prelude.dhall-lang.org/package.dhall sha256:...'
10+
```
11+
12+
Note that overriding the Prelude in this way only works if this repository
13+
is imported locally. Remote imports do not have access to environment
14+
variables and any attempt to import one will fall back to the next available
15+
import. To learn more, read:
16+
17+
* https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarantees#cross-site-scripting-xss
18+
19+
This file also provides an import without the integrity check as a slower
20+
fallback if the user is using a different version of the Dhall interpreter.
21+
22+
This pattern is documented in the dhall-nethack repo:
23+
24+
* https://github.com/dhall-lang/dhall-nethack/blob/master/Prelude.dhall
25+
-}
26+
27+
env:DHALL_PRELUDE
28+
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v10.0.0/Prelude/package.dhall sha256:771c7131fc87e13eb18f770a27c59f9418879f7e230ba2a50e46f4461f43ec69
29+
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v10.0.0/Prelude/package.dhall

1.14/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In the following example, we:
5353
-- examples/deploymentSimple.dhall
5454

5555
let kubernetes =
56-
../package.dhall sha256:ab1c971ddeb178c1cfc5e749b211b4fe6fdb6fa1b68b10de62aeb543efcd60b3
56+
../package.dhall sha256:7839bf40f940757e4d71d3c1b84d878f6a4873c3b2706ae4be307b5991acdcac
5757

5858
let deployment =
5959
kubernetes.Deployment::{
@@ -152,7 +152,7 @@ let map = Prelude.List.map
152152
let kv = Prelude.JSON.keyText
153153

154154
let kubernetes =
155-
../package.dhall sha256:ab1c971ddeb178c1cfc5e749b211b4fe6fdb6fa1b68b10de62aeb543efcd60b3
155+
../package.dhall sha256:7839bf40f940757e4d71d3c1b84d878f6a4873c3b2706ae4be307b5991acdcac
156156

157157
let Service = { name : Text, host : Text, version : Text }
158158

0 commit comments

Comments
 (0)