-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add nightly builds #1648
Add nightly builds #1648
Conversation
setup_remote_docker is somehow not working and gives: docker: command not found
For github and dockerhub
Hm. I think it makes sense not to create GitHub releases, but it would still be great to have the nightly builds tagged on github the same way they are on dockerhub as well. This would make it a lot easier to track down the current commit for each nightly - and the other way around as well. Maybe it's possible to create this tag from the CI workflow, where the docker tag is created and then push it back to github as well? |
@wolfgangwalther Just in case, I'll elaborate :). From what I've seen, the usual practice for nightlies is to create another repo and do the releases there. Like: https://github.com/OoliteProject/nightlies/releases Creating another repo would mean more maintenance, that's why I opted out of that option. Now, since all the releases would be on the releases page, having many nightlies alongside the stable releases would make the project changes harder to explore. That's what I meant with "spamming".
What workflow would be inconvenient without a nightly tag? Even without the tag, the user reporting an issue has the
I had some issues with creating a tag from CI(since it triggers another build), but I guess it'd be a matter of blacklisting the tags. |
That was exactly what I was thinking of. Is this possible with the docker images as well? The last bit of the docker-tag is the sha, right? I missed that before. |
Yes! Also possible with docker, it's the same sha. Actually it's the short sha, maybe that's why it wasn't obvious at first. @wolfgangwalther So what do you think? Is the nightly builds setup good as it is now? |
Looking at this link you gave in the initial post: https://github.com/steve-chavez/postgrest/releases/tag/nightly The freebsd binarys are only a couple 100 bytes in size. Is that correct? Or already fixed? |
Well two of them are, the third one is fine. But it's odd, because it's not in chronological order. |
Yeah, those were wrong, but it's already fixed. |
That's true. I thought it'd be rare to have more than one nightly per day. To ensure the order of the builds I could add the time
WDYT? Would that be better? |
Yes. Love it. Went through everything: LGTM. |
It certainly does not hurt and in the case of multiple nightlys it will help. So yes. But don't use a And of course it would make sense to then add this to the docker image as well! (But that's probably want you would do anyway) |
How does the nightly binary identify itself? I just tried the following:
can we fix both the UNKNOWN and make the 7.0.1 a "nightly" or "7.0.1-nightly" for the new builds? |
Actually I'm not sure if this would be a good idea. The builds could finish at a different minutes and we'd have different names for the same binary on different platforms. I guess just append the hour? Or maybe just keep it with the sha..
Regarding UNKNOWN, that was fixed on #1533.
That's important, I overlooked it. What I thought now is to modify the postgrest.cabal Unfortunately it seems
The workaround I'm seeing now is to only use the date:
So this would generate:
|
Very good point. This can happen with only the date as well, though. It'd be better to take the timestamp of the commit in question on all platforms. Something like the following maybe?
Just replace v7.0.1 with nightly. Short hash included :)
I played around with it a little bit. 9 digits seems to be a limit as well, so hours and minutes would not fit in. Also dots in between don't work, because a single digit can't have a leading zero. Just Ymd is fine, since it doesn't affect any sorting order here. This is what I came up with, in case it helps:
|
61763a9
to
b5a3ca2
Compare
@wolfgangwalther Thanks a lot for the pointers :). I had some issues with
Btw, regarding the cabal nightly version. I think it might be possible to insert a custom I got the idea by seeing this lib and the customFieldsPD on PackageDescription. Maybe it's also possible by having a build time option: For now, I'll merge and test releasing a nightly 🌃 . |
@@ -12,35 +12,28 @@ let | |||
# Version from the postgrest.cabal file (gotten with callCabal2nix). | |||
version = postgrest.version; | |||
|
|||
# Set of files that will be published in the GitHub release. | |||
releaseFiles = | |||
runCommand "postgrest-release-files" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monacoremo In case you're wondering. I deleted this nix function because I couldn't figure out how to pass a bash argument to it in writeShellScriptBin "postgrest-release-github"
. My nix-fu isn't that good 😄.
'' | ||
set -euo pipefail | ||
|
||
mkdir -p $out | ||
|
||
tar cvJf "$out"/postgrest-v"$version"-linux-x64-static.tar.xz \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the v
prefix from v$version
in the scripts. This means that the changelog versions will now need a v
prefix for sed
to pick the changes and then serve as the body for the release(done with ghr
).
The builds worked! The only failure was appveyor: https://ci.appveyor.com/project/postgrest/postgrest/builds/36245638, but that seems to be a There's an issue with the Linux build though. The binary is showing the I've checked the windows binary and it does show the Checking the nix-build-test job on circle shows a So there must be something wrong with the release job. Maybe cachix is not getting the previous job push? |
Yes, I can confirm that with the docker image. Also it does not show the commit hash but just the version. Is that what was expected from #1533? It would be really good, if the docker image was showing the hash as well.
In that log it says:
Here it says:
This hash is created and pushed here: This was the last commit you merged before. So the timeline was like this:
So when 484 pushed it's image to docker, it was using the build from the pipeline before, in this case 480, because 483 wasn't finished yet. There is certainly something wrong with the release pipeline. You wouldn't have noticed it, though, if you had pushed the nightly tag after 483 had finished already. So maybe that's why it was not a problem so far. |
Hmm.. the docker image would have the same output as the linux static bin. So if I fix the The only way I see for including the sha independently from Remo emailed me about the |
This one worked! I'll push the fix to master. Edit: Had to delete the nightly tag on my github repo to prevent uploading the wrong tag to upstream. |
I don't understand that bit. Isn't So basically.. how can the edited |
@wolfgangwalther I think most of the confusion is from how nix works, which is not surprising as it's quite unusual - allow me to elaborate a bit: The hash When you run nix-build, the actual builds run in an isolated environment in temporary directories, not your current working directory. The source code is referred to by its new path in the nix store. If anything in the source changes (like us patching the .cabal file), this results in a new hash of the input files and a new output hashed for all PostgREST build artefacts. This is why we need to also patch the .cabal file in the release job, otherwise nix will correctly pull the 7.0.1 version from cachix (or build anything missing). |
@wolfgangwalther Right, I was mistaken in thinking that GitRev got the information from Maybe this is the real underlying issue with losing the git hash: acfoltzer/gitrev#23. |
If I understood @monacoremo correctly, then the |
Fixes #1645. Adds nightly builds for Linux, Windows, OSX, FreeBSD. The results would look like this(using my own repos for the examples):
Reasoning
A tag for every nightly build would spam the Github releases page, and that would make it harder to see the project progress linearly.
An alternative would be to have a separate repo for the nightlies, but this would mean more maintenance work as we'd have to keep the repos in sync.
So all the nightly builds will be added on a single release. For dockerhub, new tags will be created.
Workflow
The workflow is partly manual and partly automated. These manual steps are required for releasing a nightly:
Then all of the CI's process should kick in and release the nightlies.
I think the workflow is good because not every commit(refactors, ci changes, readme, etc) would need a nightly.