E

Advice on CI and caching in Golang

Summary

The user is seeking advice on managing Continuous Integrations (CIs) and caching in Golang using Earthly on GitHub Actions runners. They are facing issues with caching and dependency downloads and suggest that using setup-go could improve caching. The user is concerned about inconsistencies in build instructions between local machines and CI when using an action. They mention a potential solution of connecting Earthly to an Earthly cloud satellite for $35/month but recommend exploring a similar approach to action/setup-go by utilizing CACHE in Earthly and GitHub Actions. Additionally, they express concern about losing significant progress if CI is performed outside of Earthly, noting that their previous setup with physical machines was better for caching but lacked scalability. They also discuss options for hosting the Earthly satellite, either by paying Earthly for hosting with auto-sleep/wake or self-hosting and incurring 24/7 infrastructure costs.

Status
open
Tags
    Source
    #earthly
      k

      kieran.mann

      9/26/2024

      that leaves the issue of how you host the satellite (pay earthly for hosting and get auto-sleep/wake or self-host and pay for the infrastructure 24/7)

      k

      kieran.mann

      9/26/2024

      you can launch your earthly satellite as a github runner: https://docs.earthly.dev/earthly-cloud/satellites/gha-runners

      m

      maxence

      9/26/2024

      I had a setup with physical machines that was always identical to take advantage of the cache. But it's not really very scalable

      i

      ingwar

      9/26/2024

      but yes.. with earthly its not easy without external service..

      i

      ingwar

      9/26/2024

      You didnt said anything about earthly :slightly_smiling_face:

      m

      maxence

      9/26/2024

      <@U02P31BPR6X> What does Earthly have to do with it? If I end up doing CI outside Earthly again, I'll lose a lot.

      <@U07KG62GVGR> This is also a possibility, but I find it less elegant than having everything on Github Action.

      s

      sloury

      9/26/2024

      In my mind, using an action looses the advantage of having build instructions that are the same between your machine and the CI. To deal with the cache, I went the easy and connected earthly to an earthly cloud satellite (for 35$/month). But I suggest you try to do the same thing than action/setup-go, using CACHE in earthly and cache in github action

      i

      ingwar

      9/26/2024

      If you would do setup-go it should cache everything for you..

              uses: actions/setup-go@v4
              with:
                go-version: '1.22'```
      
      m

      maxence

      9/26/2024

      Hello,

      How do you manage your CIs and the cache (Golang for me)? Today, I run earthly on github actions runners, and I end up with 0 caches, so I download all my dependencies all the time.