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

Rebuild FIDO2 dependencies on failure #13410

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

codingllama
Copy link
Contributor

Attempt to detect builder environment inconsistencies by compiling a toy FIDO2 program - if this fails, then clear the cache and try again.

Builders are sometimes getting into inconsistent states, this should help avoiding manual intervention in order to fix them.

@codingllama codingllama force-pushed the codingllama/fido2-macos-builder branch from 612dc89 to 6add950 Compare June 13, 2022 16:01
@codingllama
Copy link
Contributor Author

Two Mondays in a row now I've had headers missing from include/ inside cached libraries. It's not clear how the builders are getting into that state - the script itself is not destructive and my expectation would be for /tmp to cleared entirely.

This is a an attempt to avoid rebuilding everything on every job, which saves time and energy (plus rebuilding brings its own complications). If this keeps causing us woes, then I would reconsider.

@espadolini
Copy link
Contributor

espadolini commented Jun 14, 2022

@codingllama according to https://superuser.com/a/187105, files in /tmp are cleared out after 3 days of not being accessed - which aligns suspiciously with the amount of time that passes between EoB on friday and SoB on monday 👀

Perhaps we just need to move the build cache away from /tmp and into ~/.teleport-fido2-cache?

@codingllama
Copy link
Contributor Author

@espadolini yep, it does look like a period cleanup. The interesting part is that it deletes a bunch of headers but has tendency to keep libs around (even dylibs that we don't use), whereas I was (innocently) expecting a folder-wipe kind of deal.

Drone changes $HOME to a per-build temporary directory, that's why many of our "script caches" use /tmp instead.

@codingllama codingllama force-pushed the codingllama/fido2-macos-builder branch from 6add950 to 2dff4ed Compare June 14, 2022 14:39
@codingllama
Copy link
Contributor Author

Friendly ping @EdwardDowling @smallinsky ?

Copy link
Contributor

@smallinsky smallinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The other approach is to calculated and store in a file the directory checksum for each lib dir content like: find $CBOR_PATH -type f -exec shasum {} \; | sort -k 2 | shasum and compare the saved value with value calculated based on current build state.

@espadolini
Copy link
Contributor

Still, isn't there some other persistent absolute path we could use?

@codingllama
Copy link
Contributor Author

@espadolini and I discussed a few options, the only persistent path that builders can write to is $HOME (or /Users/$(whoami)). The latter is easy enough to do, just a bit outside of what a Drone script should do (although one could argue this ship kind of sailed already).

What do you say we give this a try? If it bites us again then I'll backpedal into separate library builds for every pipeline, which is of course slower but nicely isolated.

@codingllama codingllama force-pushed the codingllama/fido2-macos-builder branch from 2dff4ed to 59ce214 Compare June 20, 2022 14:15
@codingllama
Copy link
Contributor Author

Friendly ping @EdwardDowling @espadolini ? Could we get this one in?

Copy link
Contributor

@espadolini espadolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for just using /Users/$(whoami)/.teleport-fido2-cache too

@codingllama
Copy link
Contributor Author

Thanks for the quick reply.

I'm hoping this script will go away in favor of a better solution in the near future, so I'll push as-is. I may revisit with the shasum//Users/$(whoami) ideas if I get some spare time soon.

@codingllama codingllama enabled auto-merge (squash) June 20, 2022 14:32
@codingllama
Copy link
Contributor Author

/gcbrun

@codingllama codingllama force-pushed the codingllama/fido2-macos-builder branch from 59ce214 to 6d320de Compare June 20, 2022 23:03
@codingllama codingllama force-pushed the codingllama/fido2-macos-builder branch 3 times, most recently from 12d68f5 to ebdb5e8 Compare June 21, 2022 16:53
@codingllama codingllama force-pushed the codingllama/fido2-macos-builder branch from ebdb5e8 to d86d0e0 Compare June 21, 2022 18:07
@codingllama codingllama merged commit 97a2dd2 into master Jun 21, 2022
@codingllama codingllama deleted the codingllama/fido2-macos-builder branch June 21, 2022 19:05
codingllama added a commit that referenced this pull request Jun 21, 2022
Attempt to detect builder environment inconsistencies by compiling a toy FIDO2
program - if this fails, then clear the cache and try again.

Builders are sometimes getting into inconsistent states, this should help
avoiding manual intervention in order to fix them.
codingllama added a commit that referenced this pull request Jun 23, 2022
Attempt to detect builder environment inconsistencies by compiling a toy FIDO2
program - if this fails, then clear the cache and try again.

Builders are sometimes getting into inconsistent states, this should help
avoiding manual intervention in order to fix them.
codingllama added a commit that referenced this pull request Jun 23, 2022
Rebuild FIDO2 dependencies on failure (#13410)

Attempt to detect builder environment inconsistencies by compiling a toy FIDO2
program - if this fails, then clear the cache and try again.

Builders are sometimes getting into inconsistent states, this should help
avoiding manual intervention in order to fix them.
@webvictim webvictim mentioned this pull request Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants