input-output-hk / cicero

event-driven automation for Nomad
https://handbook.cicero.ci.iog.io
41 stars 11 forks source link

CIC-98: Add nix-cache-proxy #38

Closed rschardt closed 2 years ago

rschardt commented 2 years ago

CIC-98

manveru commented 2 years ago

What's wrong with the title of this issue?

dermetfan commented 2 years ago

Could we put this into the dev-cluster command?

rschardt commented 2 years ago

@dermetfan We shouldn't create a nix-proxy-cache nomad task which is deployed with all the other Cicero tasks locally:

  1. main purpose is to persist fetched store paths to speed up the run of tasks, while developing
  2. if nix-proxy-cache is included in the 'dev-cluster' deployment, Cache will reset every time Cicero gets redeployed locally

So, I think updating Cicero & external Actions/Workflows shouldn't change the Cache

dermetfan commented 2 years ago

We shouldn't create a nix-proxy-cache nomad task

I didn't mean to propose to create a nomad task, that would be part of the dev-jobs devshell command.

Instead I wonder whether we could put nix-cache-proxy in the dev-cluster devshell command. That would basically result in the same setup but you wouldn't have to start the cache separately.

rschardt commented 2 years ago

I didn't mean to propose to create a nomad task, that would be part of the dev-jobs devshell command.

Instead I wonder whether we could put nix-cache-proxy in the dev-cluster devshell command. That would basically result in the same setup but you wouldn't have to start the cache separately.

Sorry, I confused those but...

Bundling 'dev-cluster' with the nix-cache-proxy will also result in resetting the Cache if something in that script needs to be modified(e.g. vault version, nomad etc.) or rerun.

Sure, it wouldn't be as tightly coupled as 'dev-jobs & nix-proxy-cache' but still unforeseeable pain when working with branches.

Wouldn't a third option like dev-cluster-full or complete(for bundling dev-cluster & cache), to have flexibility for both scenarios work?

dermetfan commented 2 years ago

Good news, this works great for me :slightly_smiling_face: Here's the same build with and without the proxy:

2022-02-16T21:25:12,607365934+01:00

Bundling 'dev-cluster' with the nix-cache-proxy will also result in resetting the Cache if something in that script needs to be modified(e.g. vault version, nomad etc.) or rerun.

I completely restarted the local cluster and the cache still worked. Here's the same build again after the restart:

2022-02-16T21:27:13,661766999+01:00