Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

feat(ci): upload all branch builds to Azure server #2032

Merged
merged 3 commits into from
Feb 22, 2020
Merged

Conversation

robertylewis
Copy link
Member

The artifacts from every build (successful or not) of a leanprover-community/mathlib branch will get uploaded to the cloud. Forthcoming changes to cache-olean/update-mathlib will retrieve these.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • reviewed and applied the documentation requirements
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

@robertylewis
Copy link
Member Author

See the result of a successful run here (21mb file).

@gebner
Copy link
Member

gebner commented Feb 21, 2020

Can/should we migrate the old mathlib-nightly releases to the new ☁️-scale deployment platform?

@robertylewis
Copy link
Member Author

Can/should we migrate the old mathlib-nightly releases to the new -scale deployment platform?

We can/should. It will take a bit of scripting I guess. This will already push us into the paid tier (we get 5gb free). Maybe only the recent ones and noteworthy ones, like the last 3.4.2 release?

@robertylewis
Copy link
Member Author

robertylewis commented Feb 21, 2020

BTW, I have an unfinished, partially tested PR to mathlib-tools that points the scripts to these archives and falls back to mathlib-nightly.

@robertylewis
Copy link
Member Author

robertylewis commented Feb 21, 2020

I just counted -- we had ~40 push builds in the past 24 hours. So ~800mb a day. We'll hit the free limit in a week once this is merged. It says something about $170 in free credit though.

The Azure prices quote $0.018/gb/mo for storage. So if we keep everything, ~$2/mo, accumulating (first month $2, second $4, third $6, ...). Obviously this goes up as mathlib grows. I don't have any guess about the bandwidth usage.

It seems reasonable to store all master builds forever and branch builds for, say, a month. Distinguishing master/branch in the filename is inconvenient for fetching. Maybe we need a way to register the status of an archive with the server? This could also be used for branch builds that we want to keep forever, e.g. if an external project points to that commit.

@gebner
Copy link
Member

gebner commented Feb 21, 2020

Maybe we need a way to register the status of an archive with the server? This could also be used for branch builds that we want to keep forever, e.g. if an external project points to that commit.

I think we'll have a script that regularly runs and deletes "unwanted" builds. We can define the the meaning of "unwanted" in that script. I don't think we need to know this at upload time. For example, delete if none of the following is true:

  • revision is part of current mathlib master
  • revision is part of any branch/tag on mathlib
  • file is at most 30 days old

@robertylewis
Copy link
Member Author

Other thoughts:

  • We should check for an existing archive of a build (1) at the beginning of CI and (2) before trying to push a new archive. (2) comes up if someone pushes the same commit to two branches around the same time. (1) comes up if someone does this but with enough time to finish the build in between.

    For (1) we can just call cache-olean and that stage of the build will be fast. We shouldn't cancel the build entirely, since the build stages can be different for different branches. For (2), the second build shouldn't fail.

  • Eventually we should reconfigure/replace Mergify. It should build the actual merge commit that it will push to master. This puts us in situation (1) above. Archives will be available as soon as a PR hist master, instead of two hours later; master builds will only be docs, bundles, etc.

@PatrickMassot
Copy link
Member

Let's merge this and see how it goes. Rob's concerns will be handled when we'll get the new scripts.

@PatrickMassot PatrickMassot merged commit a9ed54c into master Feb 22, 2020
@robertylewis robertylewis deleted the azure-upload branch February 22, 2020 16:40
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants