@Théo Zimmermann I just wrote a script to generate types-Zulip archives using Gitlab CI + Pages. Would you be willing to eat my own dogfood by trying the script for a second instance?
https://gitlab.com/gasche/zulip-archive-gitlab-ci
Wow, that's great @Gabriel Scherer! I'll definitely try to use it for the Coq Zulip and let you know if I run in any trouble.
Thanks to @Gabriel Scherer, we know have a public archive at https://coq.gitlab.io/zulip-archive/.
However, this is not yet updated automatically. The documentation suggests to set up a scheduled pipeline manually, but AFAICS, this can only be set up by modifying .gitlab-ci.yml
.
@Gabriel Scherer Shouldn't the template include some code for scheduled pipelines?
That's great! Small teething problem: I'm getting 404 errors when clicking on timestamps of messages in a topic overview. There's a -gitlab-ci
in the URL which likely shouldn't be there.
@Théo Zimmermann no, you can create a scheduled pipeline manually from the web interface
actually I don't know how to add the to .gitlab-ci.yml
-- pull requests welcome!
the manual way is in the "CI/CD > Schedules" corner of the repository menu
I tried to document this in the README, but apparently I failed
Oh no, you're right and I read too fast: I was looking for this under Settings.
OK, so I've now set up a scheduled pipeline to run every hour.
Yannick Forster said:
That's great! Small teething problem: I'm getting 404 errors when clicking on timestamps of messages in a topic overview. There's a
-gitlab-ci
in the URL which likely shouldn't be there.
Now fixed, by re-running a pipeline (after I changed the name of the repo).
I guess we should add a link to https://coq.inria.fr/community and then make an announcement on #Announcements. WDYT @Cyril Cohen?
I would welcome a last PR to add a link to your archives to the "Known Deployments" list of https://gitlab.com/gasche/zulip-archive-gitlab-ci . (One reason to maintain that is that communities are terrible about advertising their Zulip chats outside their core users, so any cross-links from one to another is a win.)
@Théo Zimmermann isn't it time to announce the Zulip archive link more widely and even put a link on the Coq website? The hourly updates seem to work fine to me.
Right, I had announced in June that this would be done "in a few days".
Would you mind either opening a PR adding a link or opening an issue on the www repo and assigning it to me?
OK, I can do a www PR. But I think it should also be put on the Discourse.
any help to get the "other PR" unstuck also appreciated
I'm not so sure that it should be announced on Discourse given that it's purely related to Zulip and was already announced there...
well, how about just putting a message in the Zulip announcement thread with the link: https://coq.discourse.group/t/creation-of-a-zulip-chatroom/839
For convenience, I would find it very helpful if there would be a link from the archive to the actual discussion in Zulip. Is that possible?
Here is the tool we use: https://github.com/zulip/zulip-archive
And here is the way we deploy it: https://gitlab.com/gasche/zulip-archive-gitlab-ci
I don't know more that this. Feel free to look around / open issues / report what you found :smile:
Thanks! In fact, one can go to the actual Zulip discussion by clicking on the profile picture of the poster of a message. That wasn't very obvious too me, especially since the profile pictures are not displayed properly, but I guess it's good enough.
Two more questions: Is it intended that the profile pictures are not shown? Is it intended that we just have black on white? The Lean zulip archive looks a lot more modern and accessible. (I'm asking because it might be a bug or it might be just that nobody yet found the time to giving it a nicer look and feel)
I wouldn't know. We should ask @Gabriel Scherer.
It's possible to customize the HTML&CSS of the generated archive, and the Learn archive does it, but I never worked on doing this within zulip-archive-gitlab-ci . @Yannick Forster if you (or someone you know) would be willing to give it a try, Merge Requests are warmly welcome.
Note: older versions of the zulip-archive tool used Jekyll, which made customization somewhat easy (drop Mustache templates in a _layout
directory), but newer versions of the script have a more ad-hoc and simpler customization mechanism. The Lean archive still uses an older version of the tool, so their approach is not directly reusable / future-proof.
Hello @Gabriel Scherer, since this morning, the Zulip archive pipeline fails consistently with:
Traceback (most recent call last):
File "/builds/coq/zulip-archive/zulip-archive/archive.py", line 42, in <module>
import zulip
ModuleNotFoundError: No module named 'zulip'
Here is an example: https://gitlab.com/coq/zulip-archive/-/jobs/3812590329
Do you know what this means?
probably related to the "error: externally-managed-environment" a bit earlier in the log
I have no idea what this means, sorry. Can I let you investigate?
(I wondered if this was due to an upstream change in the zulip-archive repo, but I am pulling from a feature branch that shouldn't evolve in time so this is (possible but) less likely.)
it's a change in debian/ubuntu's python packaging
you have to use a "virtual env" (I don't know what that is btw) to use pip, you can't just pip install anymore
OK, thanks for the diagnosis. I think I can fix it by switching to Nix to install the required dependencies (I do not know how to use pip / venv even if I kind of know what this is, it's like a local opam switch).
Fixed with: https://gitlab.com/coq/zulip-archive/-/commit/62eb7182b3f5957e1fb26736006c0d9497572c7b
Possibly another fix would have been to replace debian:testing
by debian:stable
or something like that (but it would have broken at the next Debian stable release).
@Gabriel Scherer I've noticed that the pipelines at https://gitlab.com/gasche/types-chat-archive/-/pipelines keep failing since this day. FWIW, my fix at the URL above should work there as well. Let me know if you want me to do a PR.
Do we still need a separate archive? It seems Zulip itself allows anon browsing now
@Théo Zimmermann Thanks! For some reason I had missed the conversation above (I don't stay connected on the Coq Zulip, but was hoping for a notification in case of further reply.) Yes, a PR would be very kind of you.
Should I do it on https://gitlab.com/gasche/zulip-archive-gitlab-ci/ or directly on https://gitlab.com/gasche/types-chat-archive?
Actually I guess I should just get motivated and push myself -- to both repos indeed.
@Paolo Giarrusso two reasons to keep the archive around:
Paolo Giarrusso said:
Do we still need a separate archive? It seems Zulip itself allows anon browsing now
Indeed, we have turned all the public streams into web-public so Zulip allows anonymous browsing. However, at the time it was introduced, this was not web-search-indexed. I don't know what the status is today, but I have kept the archive because the cost was small.
Hm, looking at the patch, I see that you sneakily nixified the script :-p
Nix sounds like it is going to be harder to maintain in the future for me given that I know nothing about it yet. I should either get a standard-distro fix, or decide that you are now the maintainer of the archive script. (I don't know which is easier for other potential users.)
This was the only fix I was able to write quickly with my knowledge. At least, it works, but I agree this is not ideal.
Looks like the Python people decided to break a common workflow to force users to move to virtual environments, and distros are gradually migrating towards following the new rule (PEP 668).
When I looked for, discovered and learned Nix in 2016, this was because I never wanted to learn again the quirks and changing moods of yet another application-specific package manager. This has worked pretty well for me, but this also means that I cannot be of help here ;-)
https://gitlab.com/gasche/types-chat-archive/-/merge_requests/1 looks like it fixes the issue
BTW, looking at the pipeline history at https://gitlab.com/coq/zulip-archive/-/pipelines, I noticed that there are two cases: when the pipeline takes about 2 minutes and when it takes about 30. The second case apparently corresponds to a cache miss, when Zulip archive has to rebuild the whole archive. This apparently never happens in the types-chat-archive pipelines. Cache misses are becoming way more common lately and are causing some random failures (failures always happen after ~21 minutes, because of some timeout, probably because of some large thing to fetch). Any idea what could cause cache misses? I suppose this is a GitLab CI issue.
I pushed my pip-level fix to the types-chat archive and the upstream repo, so that should fix it.
I must say that I have no clue about the cache/timeout issue. I wondered if nix was somehow interacting badly with the cache, but it looks like you also had the issue before moving to nix.
Yes, sorry I should have clarified that I checked for this.
(thanks @Gaëtan Gilbert for letting me know about the pip+debian issue)
In any case, it's bedtime for me, so I will wonder about this -- maybe -- tomorrow. Have fun, and thanks all for the help.
It's also bedtime for me, I will also wonder about this tomorrow, or later. Anyway, I'm sure I will remember to think about it because I receive an email each time a pipeline fails, and I've been receiving too many of these emails lately!
BTW this pip break will probably get us when we try to regenerate the docker image for CI some day
Last updated: Oct 13 2024 at 01:02 UTC