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
Support for pushing notifications to the Ubuntu ISO Tracker #81
Conversation
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 think this is a nice first version, especially from someone not familiar with Github Action. Nice work!
I have suggested some improvements and changes I consider needed for this. Also, to answer your questions:
Version of the resulting WSL build. Right now I went with the simple route of just using build_id, but from what I see it's like a small number right now. Ideas I had was things like DATESTAMP.build_id or something, or does build_id suffice?
You should use the complete version after our replacement during the build. This one takes into account which image we are pushing to (like 2004.4.<build_id>.0) for instance. Note that we don’t have control over the last .0 which is internal to the Microsoft Store. This whole version will be. after the first builds, something like 2204.0.1.0 for instance.
Not sure if the ISO Tracker API will work over HTTPS (which we need as it's outside of Canonical network)*
Yeah, can you give it some tries with curl directly from your machine without the VPN connected?
I have no idea how github actions are triggered and how long the environment survives, but in the code I used /tmp/all-releases.csv in case that it might 'stick around' from previous job runs. I can switch to just doing it via LP directly, but if it's persistent for long enough I thought it might save a few LP API calls.
Those are sticking per job. So, if one step of a job stick a file somewhere, it will be available for every other steps in the job. However, we can also upload/download artefacts to share things between jobs (you have some examples in the build process here). However, I think you should really take in general the version we build in the XML file and use that as a reference to avoid any discrepancies between the 2.
.github/workflows/build-wsl.yaml
Outdated
ISOTRACKER_USERNAME: ${{ secrets.ISOTrackerUsername }} | ||
ISOTRACKER_PASSWORD: ${{ secrets.ISOTrackerPassword }} | ||
run: | | ||
perl -pe 's/@([A-Z_]+)@/$ENV{$1}/eg' isotracker.conf.in >~/isotracker.conf |
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.
Can’t we do that with sed? Because perl will make it harder to maintain :p
I would like the configuration to be store somewhere not in workdir if possible.
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 can look into doing it with sed ;p The perl version was straightforward as it could be written in one line, in case there's more credentials at some point. But that's rather unlikely!
As for the placement of the config file - I think this would require some changes to the isotracker module as by default it hard-codes this path for the config file. But I think this should be configurable, so I'll make the required modifications!
.github/workflows/build-wsl.yaml
Outdated
@@ -252,6 +266,15 @@ jobs: | |||
name: build-artifacts-${{ matrix.WslID }} | |||
path: ${{ env.workDir }}/${{ env.buildInfoPath }}/${{ matrix.WslID }}-* | |||
|
|||
- name: Notify ISO Tracker |
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.
Same, I would do that after updating the build artefacts.
Actually, thinking about it, we are only interested when we store the version in the "db" (yes, the wiki). So maybe another approach would be to do it in update-build-artifacts
job rather, for all new application packages (==images) we uploaded to the store.
isotracker.conf.in
Outdated
url=https://iso.qa.ubuntu.com/xmlrpc.php | ||
username=@ISOTRACKER_USERNAME@ | ||
password=@ISOTRACKER_PASSWORD@ | ||
default_milestone=Jammy Daily |
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.
This needs to be reworked. We avoided hardcoding anything (version, name…) in our repo, so that if a new release opened, we just receive an automated PR from our detect-update-releases
workflow and we can review + merge.
This makes opening/tracking new releases painless compared to 60 places we need to update the name (and of course, forgot some in the wiki).
Can we retrieve the information from launchpad, or update maybe the release.csv file and add + " Daily"
to it?
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.
hm, you're right. Maybe we could actually make this super dynamic. A few ideas is: either generating the isotracker.conf
file automatically in notify-tracker
before creating the ISOTracker
object or, maybe even better: tweaking ISOTracker
in ubuntu-archive-tools to offer some functionality to pass the credentials and config data without the need of a file on the filesystem.
Anyway, good idea! I'll get that going.
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.
Thank you for your review Didier! I'll be taking care of those issues as soon as I have a moment.
.github/workflows/build-wsl.yaml
Outdated
ISOTRACKER_USERNAME: ${{ secrets.ISOTrackerUsername }} | ||
ISOTRACKER_PASSWORD: ${{ secrets.ISOTrackerPassword }} | ||
run: | | ||
perl -pe 's/@([A-Z_]+)@/$ENV{$1}/eg' isotracker.conf.in >~/isotracker.conf |
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 can look into doing it with sed ;p The perl version was straightforward as it could be written in one line, in case there's more credentials at some point. But that's rather unlikely!
As for the placement of the config file - I think this would require some changes to the isotracker module as by default it hard-codes this path for the config file. But I think this should be configurable, so I'll make the required modifications!
isotracker.conf.in
Outdated
url=https://iso.qa.ubuntu.com/xmlrpc.php | ||
username=@ISOTRACKER_USERNAME@ | ||
password=@ISOTRACKER_PASSWORD@ | ||
default_milestone=Jammy Daily |
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.
hm, you're right. Maybe we could actually make this super dynamic. A few ideas is: either generating the isotracker.conf
file automatically in notify-tracker
before creating the ISOTracker
object or, maybe even better: tweaking ISOTracker
in ubuntu-archive-tools to offer some functionality to pass the credentials and config data without the need of a file on the filesystem.
Anyway, good idea! I'll get that going.
…racker configuration.
Pushed a new version, ready for review. In this version, as per discussion, I have switched to the approach of generating the ISOTracker config on the fly dynamically without actually creating a configuration file (pushed support for that to lp:ubuntu-archive-tools). I reorganized some of the github actions to have a better order too. I tried a bit to move the notification logic to So yeah, I'd say we can switch to the other approach, but it feels like more invasive then? |
Thanks for the changes here and not relying on the hardcoded ISO tracker configuration anymore. It looks good to me :) However, it seems you didn’t remove the hardcoded version from your branch. On the other big comment, I’m still convinced that the best approach is to do in
|
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.
Moving it back as we need some changes, the overall changes looks like it’s going in the right direction though :)
Could you take a look if this is something that would work? Thanks! |
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.
Some small change, but it seems we are getting there! Thanks for the discussion :)
.github/workflows/build-wsl.yaml
Outdated
WSLId=$(basename $build); | ||
WSLId=${WSLId%-buildid.md}; | ||
buildid=$(cat $build) | ||
PYTHONPATH=${{ env.codeDir }}/uat ${{ env.codeDir }}/notify-isotracker $WslID $buildid |
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.
Can you move notify-isotracker
under wsl-buidler/
? This will make buid-related stuff outside of WSL.
.github/workflows/build-wsl.yaml
Outdated
@@ -286,3 +288,29 @@ jobs: | |||
git add . | |||
git commit -m "Auto-update build info" | |||
git push origin master | |||
|
|||
- name: Checkout WSL repo |
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.
Maybe add the if: ${{ steps.modified-artifacts.outputs.needs-wiki-update == 'true' }}
in there and do the 2 clones in a single step, as both is to get the code to notify the tracker.
Almost there! But ready for re-review once again! I suppose one final thing to think about (poked JB a while ago about that as well) is actually how we should identify new builds in the ISO Tracker. Right now it's the buildid, but the ISOTracker would have to somehow construct a nice way of offering something to download using that ID. |
Agreed, do you want that we resolve this next week before merging? |
hm, okay, I feel that I'd need help getting a better understanding here. So from what JB told me a while ago, one way of 'accessing' WSL downloads is via pointing to the sideload download urls from build jobs, e.g.: The ISO Tracker url creations is rather simple and 'stupid'. It basically needs to construct the url using simple substitution only via the build_id, project, arch etc. Nothing complex can be done, just substituting variables in the url. In this case, it feels to me we'd have to send the WSL action run ID to the ISOTracker, then we could at least link to the action url for people to fetch the sideload archives. Is it possible to get the run ID somehow? Or do we need to move this to some different stage then? |
Should now be again good for review. As per our earlier discussion, switched to using the |
That should be it! If you don’t mind, let’s merge that after .4 and the multiple renaming we have to ensure we don’t add another point of failure :) Otherwise, looking good for me, thanks sil2100! |
Naming transitions are now completed. Let’s merge that. Thanks for working on it! |
Sending this out for an initial review. The goal of this PR is to send out notifications to the Ubuntu ISO Tracker about any new WSL builds that are completed, notifying the respective per-series products. This way we'd have Ubuntu WSL images appearing on the tracker automatically. It also plays in nicely with another feature of this related to the ability to re-trigger builds via the tracker.
http://iso.qa.ubuntu.com/
This is the first time I deal with github actions, so that part is mostly written blindly by just looking at other sections and reading documentation. There's also some open questions here.
Open questions:
DATESTAMP.build_id
or something, or does build_id suffice?/tmp/all-releases.csv
in case that it might 'stick around' from previous job runs. I can switch to just doing it via LP directly, but if it's persistent for long enough I thought it might save a few LP API calls.Other than that I think it's good enough. I only tested it in dry-run mode on my local machine. I'm open to suggestions!