Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semaphore: remove manual Go installation, expedite 'cache restore' #803

Merged
merged 1 commit into from Sep 26, 2022

Conversation

ti-mo
Copy link
Collaborator

@ti-mo ti-mo commented Sep 26, 2022

Some recommendations from Semaphore support.

'sem-version' apparently installs Go, so rely on it instead of isntalling Go manually.

Execute 'cache restore' before 'go install' to avoid tar errors unpacking the cache archive:

Unpacking command failed: tar: /home/semaphore/go/pkg/mod/github.com/jonboulle/clockwork@v0.2.2/.github/workflows/ci.yml: Cannot open: File exists
tar: /home/semaphore/go/pkg/mod/github.com/jonboulle/clockwork@v0.2.2/.github/workflows/.editorconfig: Cannot open: File exists
tar: /home/semaphore/go/pkg/mod/github.com/jonboulle/clockwork@v0.2.2/ticker.go: Cannot open: File exists
...

'sem-version' apparently installs Go, so rely on it instead of isntalling
Go manually.

Execute 'cache restore' after 'checkout' (since it scans for go.mod), but
before 'go install' to avoid tar errors unpacking the cache archive:

```
Unpacking command failed: tar: /home/semaphore/go/pkg/mod/github.com/jonboulle/clockwork@v0.2.2/.github/workflows/ci.yml: Cannot open: File exists
tar: /home/semaphore/go/pkg/mod/github.com/jonboulle/clockwork@v0.2.2/.github/workflows/.editorconfig: Cannot open: File exists
tar: /home/semaphore/go/pkg/mod/github.com/jonboulle/clockwork@v0.2.2/ticker.go: Cannot open: File exists
...
```

'go install' does something that changes the ownership of go/pkg/mod,
tripping up tar. Since 'go install' doesn't need to be run outside of a Go
module like 'go get' did when using it to install tool binaries, it can
safely be run after checkout.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo marked this pull request as ready for review September 26, 2022 11:27
@ti-mo ti-mo requested a review from lmb September 26, 2022 11:27
@ti-mo ti-mo merged commit 682bccb into cilium:master Sep 26, 2022
@ti-mo ti-mo deleted the tb/optimize-semaphore branch September 26, 2022 11:28
@lmb
Copy link
Collaborator

lmb commented Sep 26, 2022

Semaphore is really slow in updating go versions unfortunately which is why that hack exists in the first place!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants