epics-containers / edge-containers-cli

command line shortcuts for epics containers developers
Apache License 2.0
3 stars 1 forks source link

ec template does not update helm dependencies #114

Closed gilesknap closed 4 months ago

gilesknap commented 6 months ago

ec template needs to do the same thing that ec deploy local does - go through and update and repackage all the chart hierarchy.

Otherwise you don't see any changes to the dependent charts.

gilesknap commented 6 months ago

In the mean time. running ./update-helm works around this issue.

marcelldls commented 6 months ago

We already seem to do this as we call local-deploy when doing ec template. https://github.com/epics-containers/edge-containers-cli/blob/84641069a2b7f8be6da530dccc3c88ae4fb44351/src/edge_containers_cli/cmds/k8s_commands.py#L100-L112

gilesknap commented 6 months ago

@marcelldls in fact this issue does exist, not just for template but for local-deploy too. I just tried to deploy to p47 but was getting the previous chart re-deployed.

This definitely fixes it:

rm $(find . -name '*.tgz')

but that is a bit of a sledgehammer as one day someone might want to put a compressed tar file in the config folder (I used to in the early days).

I believe that removing chart.lock from the folder should have the equivalent effect and I also believe that ec already does that - but maybe that is broken at present.

marcelldls commented 6 months ago

Is this for a remote dependency? I find that if i make changes to include/iocs/templates/configmap.yaml for example that these are in the ec template

marcelldls commented 6 months ago

I haven't been able to reproduce the issue - If I switch between ioc-instance 3.0.0 and 3.4.0 I believe can see the changes (removal of white space in StatefulSet spec). Also the tar in the charts directory updates accordingly

gilesknap commented 6 months ago

Let's discuss tomorrow if you are around.

marcelldls commented 5 months ago

Two ideas:

I prefer the git command because it will show in ec -v and already implemented. Is there a need to retain the files in case of debugging?

marcelldls commented 5 months ago

Two ideas:

  • Using git clean -Xdf to remove all files and directories that are ignored by git. Any tracked .tgz are skipped (if doing dev, staging your .tgz would be enough). I think its fair to expect that ignored files in the repo are transient?
  • Compare file structure before and after deploying. Delete any new files and directories that are .tgz, chart/, chart.lock, etc

I prefer the git command because it will show in ec -v and already implemented. Is there a need to retain the files in case of debugging?

Actually I see there are .bob files also in the ignore that are interesting for development, so we should probably clean specifically to helm - (or run the command before invoking helm if we can assume one might only do dev of one service at a time?)

marcelldls commented 5 months ago

Is our issue not coming rather from the looseness of: https://github.com/epics-containers/edge-containers-cli/blob/7282c71f20f679490a6f3a907f603994fe5f410b/src/edge_containers_cli/cmds/helm.py#L100 We could helm package into a temp folder?

gilesknap commented 5 months ago

@marcelldls interesting - maybe that is the issue.

Packaging into a temp folder would be tidier anyway. So you should definitely try that.

I still think there may be a need to remove the tgz or at leaset .lock files for sub charts - but I'm not entirely clear how that locking works.