Properly use Zimfarm offliner definition version
This is a follow-up to https://github.com/openzim/zimfarm/pull/1266
This PR introduced the notion of offliner definition to correctly model that scraper flags are changing over scraper releases.
We introduced it in a non-breaking way so we have "time" to adapt, but we need to move forward to clean things afterwards.
We need to adapt wp1 to:
- store somewhere which zimit offliner definition version is currently in use
- properly set this
versionto use when creating a schedule - properly retrieve the definition of current version to display flags
@elfkuzco I feel like you can propose a PR here, and @audiodude and myself will review. Is it ok for you?
Yes
This was intended for wp1 ... my bad
In openzim/zimfarm#1422, the backend determines the "latest" version to use. Is there any need for wp1 to set the version again?
I think this is not such a good idea. It will work "in general", but might fail in some occasion.
WP1 has the ability to define which Docker image tag (mwoffliner version) to use, see https://github.com/openzim/wp1/blob/36c92a55b02970b78976bacf952ccf8408adcd5e/wp1/zimfarm.py#L209-L214
It should be able to define the offliner definition version as well.
Should WP1 decide to use a "non-latest" mwoffliner version (it does anytime after release event for few hours before its configuration gets updated), then it should use "non-latest" offliner definition version.
And it should also be able to use a custom version if needed for whatever reason.
We should probably have same behavior than in zimit-frontend:
- introduce a new configuration in credentials.py to specify offliner definition version to use
- if this configuration is not set, fallback to assume we can use the tag of Docker image as offliner definition version (because this is in general correct)
Fixed by https://github.com/openzim/wp1/pull/1027